Skip to content

feat(mcp): default-on MCP surface — opt out with OS_MCP_SERVER_ENABLED=false (#2698) - #2712

Merged
os-zhuang merged 1 commit into
mainfrom
feat/mcp-default-on
Jul 9, 2026
Merged

feat(mcp): default-on MCP surface — opt out with OS_MCP_SERVER_ENABLED=false (#2698)#2712
os-zhuang merged 1 commit into
mainfrom
feat/mcp-default-on

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

Follow-up to #2709 (owner decision): MCP is a core platform capability and should not hide behind an opt-in flag. /api/v1/mcp is now served — and advertised in /discovery — by default, and the OAuth 2.1 / DCR track follows it, so a fresh deployment is connectable by any MCP client with zero configuration. Opt out with OS_MCP_SERVER_ENABLED=false.

What changed

  • New single decision pointisMcpServerEnabled() in @objectstack/types (default on; explicit false/0/off/no disables). The four former ad-hoc === 'true' readers all delegate to it: the runtime dispatcher's /mcp route gate, the CLI's MCP plugin auto-load, the REST /discovery advertisement, and plugin-auth's readMcpServerEnabledEnv (which the OAuth-provider/DCR follow-defaults build on). The served route, the advertised route, and the authorization track can no longer disagree.
  • Env var is now tri-state: unset → HTTP surface on; explicit true → additionally auto-start the long-lived stdio transport at boot (unchanged, deliberately still opt-in — a default must not claim the process's stdin/stdout); explicit false → everything off, fail-closed (404 route, no .well-known metadata, no DCR, no discovery advertisement).
  • OAuth 2.1 TLS rule unaffected: plain-HTTP non-loopback origins keep the OAuth track dark and stay API-key-only.
  • Docs updated (environment-variables, deployment, api, ai/agents, build-with-claude-code, mcp README) + changesets.

Verification

  • Unit: runtime 472 ✓, plugin-auth 285 ✓, rest 217 ✓, cli 466 ✓, mcp 62 ✓, types 7 ✓ (default-on cases added; legacy plugin-list suite pinned to opted-out so it keeps testing config resolution in isolation).
  • Live on the showcase app:
    • default boot (no env): /.well-known/oauth-protected-resource 200, /discovery advertises routes.mcp, unauthenticated /api/v1/mcp → 401 + WWW-Authenticate challenge, DCR register → 200.
    • OS_MCP_SERVER_ENABLED=false boot: all of the above 404 and routes.mcp dropped.

Refs #2698.

🤖 Generated with Claude Code

…MCP_SERVER_ENABLED=false (#2698)
MCP is a core platform capability: /api/v1/mcp is now served (and advertised
in /discovery) by default, and the OAuth 2.1 / DCR track follows it, so a
fresh deployment is connectable by any MCP client with zero configuration.
Single decision point: isMcpServerEnabled() in @objectstack/types — the
dispatcher route gate, CLI plugin auto-load, REST /discovery advertisement,
and auth-service OAuth/DCR follow-defaults all delegate to it. Explicit
'true' additionally auto-starts the stdio transport (unchanged, opt-in: a
default must not claim the process's stdio); explicit 'false' turns the
whole surface off fail-closed (404, no metadata, no DCR).
Verified live on the showcase app: default boot serves MCP + PRM + DCR and
401s with the WWW-Authenticate challenge; OS_MCP_SERVER_ENABLED=false boot
404s all of them and drops the /discovery advertisement.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vercel

vercelBot commented Jul 9, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

ProjectDeploymentActionsUpdated (UTC)
specReadyReadyPreview, CommentJul 9, 2026 6:08am

Request Review

@github-actionsgithub-actionsBot added documentation Improvements or additions to documentation dependencies Pull requests that update a dependency file tests tooling size/m labels Jul 9, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 6 package(s): @objectstack/cli, @objectstack/mcp, @objectstack/plugin-auth, @objectstack/rest, @objectstack/runtime, @objectstack/types.

37 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:

  • content/docs/ai/actions-as-tools.mdx(via @objectstack/mcp)
  • content/docs/ai/agents.mdx(via @objectstack/mcp)
  • content/docs/ai/index.mdx(via @objectstack/mcp)
  • content/docs/ai/natural-language-queries.mdx(via @objectstack/mcp)
  • content/docs/ai/skills-reference.mdx(via packages/cli)
  • content/docs/api/client-sdk.mdx(via @objectstack/cli)
  • content/docs/api/data-flow.mdx(via @objectstack/cli)
  • content/docs/api/environment-routing.mdx(via @objectstack/cli)
  • content/docs/api/error-catalog.mdx(via @objectstack/cli, @objectstack/rest)
  • content/docs/api/error-handling-server.mdx(via @objectstack/rest)
  • content/docs/api/index.mdx(via @objectstack/mcp, @objectstack/rest, @objectstack/runtime)
  • content/docs/api/wire-format.mdx(via @objectstack/runtime)
  • content/docs/automation/hook-bodies.mdx(via packages/cli, @objectstack/runtime)
  • content/docs/concepts/north-star.mdx(via packages/runtime)
  • content/docs/data-modeling/drivers.mdx(via @objectstack/runtime)
  • content/docs/deployment/environment-variables.mdx(via @objectstack/mcp)
  • content/docs/deployment/index.mdx(via @objectstack/runtime)
  • content/docs/deployment/production-readiness.mdx(via @objectstack/plugin-auth, @objectstack/runtime)
  • content/docs/deployment/single-project-mode.mdx(via @objectstack/runtime)
  • content/docs/deployment/vercel.mdx(via @objectstack/runtime)
  • content/docs/getting-started/cli.mdx(via @objectstack/cli, @objectstack/plugin-auth)
  • content/docs/kernel/runtime-services/data-service.mdx(via packages/cli)
  • content/docs/kernel/runtime-services/index.mdx(via packages/cli)
  • content/docs/kernel/services-checklist.mdx(via @objectstack/plugin-auth)
  • content/docs/permissions/authentication.mdx(via @objectstack/cli, @objectstack/plugin-auth, @objectstack/runtime)
  • content/docs/permissions/authorization.mdx(via packages/rest)
  • content/docs/permissions/sso.mdx(via @objectstack/plugin-auth)
  • content/docs/plugins/index.mdx(via @objectstack/plugin-auth, @objectstack/rest)
  • content/docs/plugins/packages.mdx(via @objectstack/cli, @objectstack/mcp, @objectstack/plugin-auth, @objectstack/rest, @objectstack/runtime, @objectstack/types)
  • content/docs/protocol/knowledge.mdx(via @objectstack/mcp)
  • content/docs/protocol/objectos/http-protocol.mdx(via @objectstack/runtime)
  • content/docs/protocol/objectos/index.mdx(via @objectstack/runtime)
  • content/docs/protocol/objectos/lifecycle.mdx(via @objectstack/runtime)
  • content/docs/protocol/objectos/plugin-spec.mdx(via @objectstack/cli)
  • content/docs/protocol/objectos/realtime-protocol.mdx(via @objectstack/cli)
  • content/docs/releases/implementation-status.mdx(via @objectstack/cli, @objectstack/mcp, @objectstack/plugin-auth, @objectstack/rest, @objectstack/runtime)
  • content/docs/releases/v9.mdx(via @objectstack/plugin-auth)

Advisory only. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs origin/main → pass the list as args.docs.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependenciesPull requests that update a dependency filedocumentationImprovements or additions to documentationsize/mteststooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@os-zhuang