feat(mcp): default-on MCP surface — opt out with OS_MCP_SERVER_ENABLED=false (#2698)#2712
Merged
Conversation
…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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
📓 Docs Drift CheckThis PR changes 6 package(s): 37 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
|
This was referenced Jul 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #2709 (owner decision): MCP is a core platform capability and should not hide behind an opt-in flag.
/api/v1/mcpis 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 withOS_MCP_SERVER_ENABLED=false.What changed
isMcpServerEnabled()in@objectstack/types(default on; explicitfalse/0/off/nodisables). The four former ad-hoc=== 'true'readers all delegate to it: the runtime dispatcher's/mcproute gate, the CLI's MCP plugin auto-load, the REST/discoveryadvertisement, and plugin-auth'sreadMcpServerEnabledEnv(which the OAuth-provider/DCR follow-defaults build on). The served route, the advertised route, and the authorization track can no longer disagree.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); explicitfalse→ everything off, fail-closed (404 route, no.well-knownmetadata, no DCR, no discovery advertisement).Verification
/.well-known/oauth-protected-resource200,/discoveryadvertisesroutes.mcp, unauthenticated/api/v1/mcp→ 401 +WWW-Authenticatechallenge, DCR register → 200.OS_MCP_SERVER_ENABLED=falseboot: all of the above 404 androutes.mcpdropped.Refs #2698.
🤖 Generated with Claude Code