docs(ai-tools): MCP server is enabled by default, not disabled (#1228)#1574
Conversation
…h-cms#1228) The AI Tools guide said the MCP server is "disabled by default" and showed `mcp: true` to enable it. The integration mounts the `/_emdash/api/mcp` route unless `mcp` is explicitly `false`, so it is on by default. Correct the guide to describe the actual behavior, note that the endpoint always requires authentication, and show `mcp: false` to disable it. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
There was a problem hiding this comment.
Approach
This is a docs-only correction to the AI Tools guide, aligning it with the actual code behavior of the MCP integration. The author correctly scoped it to docs rather than flipping the default to opt-in (which would be a breaking behavior change requiring a Discussion and changeset) — that judgment is called out explicitly in the PR description. The right change, solving the right problem, in a way that fits EmDash.
What I checked
I verified every factual claim the new doc text makes against the source:
- "enabled by default ... the route at
/_emdash/api/mcpis mounted unless you explicitly turn it off" — confirmed atpackages/core/src/astro/integration/index.ts:446:if (resolvedConfig.mcp !== false) { injectMcpRoute(injectRoute); }. The same!== falseguard gates the dev-server info line (line 511). mcp: falseto disable — matches the config schema atpackages/core/src/astro/integration/runtime.ts:283, which declaresmcp?: booleanwith@default trueand the docstring "Enabled by default ... Set tofalseto disable."- "It always requires authentication, so no content is exposed without valid credentials" — confirmed. The auth middleware (
packages/core/src/astro/middleware/auth.ts:275-277) returnsmcpUnauthorizedResponse(401) for/_emdash/api/mcpwhenever the request isn't bearer-token authenticated, before the route handler runs. The route handler (packages/core/src/astro/routes/api/mcp.ts) additionally returns 401 if!user; GET/DELETE return 405 and never content. So no content leaks without a valid token. - No stale contradictions — grepped
docs/for "disabled by default", "mcp: true", "Enable the MCP"; the only remaining references are in the corrected guide.docs-mcp.mdxandreference/mcp-server.mdxare consistent with the corrected behavior (the reference describes auth methods/scopes without claiming a default state).
No source code is changed, so the SQL-safety, Lingui, RTL, authorization, locale-filter, index, and changeset conventions don't apply. Changeset is correctly n/a (no published package changed).
Conclusion
Clean, accurate, well-scoped docs fix. The headline claim and the authentication note both check out against the integration, config schema, and auth middleware. No findings.
@emdash-cms/admin
@emdash-cms/auth
@emdash-cms/auth-atproto
@emdash-cms/blocks
@emdash-cms/cloudflare
@emdash-cms/contentful-to-portable-text
emdash
create-emdash
@emdash-cms/gutenberg-to-portable-text
@emdash-cms/plugin-cli
@emdash-cms/plugin-types
@emdash-cms/registry-client
@emdash-cms/registry-lexicons
@emdash-cms/sandbox-workerd
@emdash-cms/x402
@emdash-cms/plugin-ai-moderation
@emdash-cms/plugin-atproto
@emdash-cms/plugin-audit-log
@emdash-cms/plugin-color
@emdash-cms/plugin-embeds
@emdash-cms/plugin-field-kit
@emdash-cms/plugin-forms
@emdash-cms/plugin-webhook-notifier
commit: |
What does this PR do?
The AI Tools guide stated the MCP server is "disabled by default" and showed
mcp: trueto enable it. The integration mounts/_emdash/api/mcpunlessmcpis explicitlyfalse(integration/index.ts), so it is on by default. This corrects the guide to describe the actual behavior, notes the endpoint always requires authentication, and showsmcp: falseto disable it.This is the docs-only resolution of #1228 (aligning docs to code). It does not change the default; if maintainers prefer flipping the default to opt-in instead, that's a separate behavior change.
Closes #1228
Type of change
Checklist
pnpm typecheck— n/a (docs only)pnpm lint— n/a (docs only)pnpm test— n/a (docs only)pnpm formathas been run (prettier clean)AI-generated code disclosure