Repository navigation
build(deploy): let MCP clients sign a person in on the hosted cloud - #3533
Conversation
The cloud served the MCP endpoint with a project secret, but not the OAuth server a client signs a person in through: vercel.json sent /oauth/* and the well-known metadata to the website, and the launcher left oauth.enabled off. vercel.json now sends /oauth/*, /.well-known/oauth-authorization-server/* and /.well-known/oauth-protected-resource/* to the server; the website keeps /.well-known/security.txt. The launcher defaults NEXTGEN_OAUTH_ENABLED to true and NEXTGEN_OAUTH_CLIENT_DOCUMENT_HOSTS to the hosts of the MCP clients that publish a client document (Claude and Claude Code, ChatGPT and Codex, VS Code, Zed, goose, Antigravity), so the platform issuer fetches no document from any other host. Either variable on the Vercel project overrides it; NEXTGEN_OAUTH_ENABLED=false turns the server off. A deployment check reads the endpoint's metadata and its 401 challenge, and holds that the OAuth paths reach the server. The runbook and ADR 092 say what the cloud serves, how to turn it off, and that the firewall's server-per-address rule should list the new paths. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
…e rule One rule names the two documents, as the rule for the API's resources names them; the rest of /.well-known/ stays the website's, so security.txt keeps its redirect. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U
There was a problem hiding this comment.
🔵 Needs a closer look
The public OAuth rollout still requires maintainer validation of Vercel routing, the manual firewall update, and a real MCP client’s complete sign-in, consent, and token exchange flow.
No open issues 🎉
What changed in this PR
Enables MCP clients to sign users in on the hosted cloud using the existing OAuth server.
Changes:
- Routes OAuth endpoints and discovery metadata to the server.
- Enables OAuth by default with an overridable client-document host allowlist.
- Adds routing and configuration checks, and documents deployment controls.
| File | Description |
|---|---|
vercel.json |
Routes OAuth endpoints and metadata to the server. |
e2e/console/src-deployment/routes.spec.ts |
Checks MCP discovery, authentication challenges, and OAuth routing. |
docs/runbooks/cloud.md |
Documents OAuth defaults, overrides, and firewall updates. |
docs/adrs/092-mcp-server.md |
Records hosted-cloud support as implemented. |
apps/api/cmd/cloud-launcher/main.go |
Defaults OAuth on and restricts client-document hosts. |
apps/api/cmd/cloud-launcher/main_test.go |
Checks routes, defaults, host validation, and overrides. |
Review effort: Balanced
Context
/oauth/and/.well-known/" as what kept a client from signing a person in on the cloud.Summary
The hosted cloud served
/api/v1/mcpwith a project secret, but not the OAuth server an MCP client signs a person in through:vercel.jsonsent/oauth/*and the well-known metadata to the website's 404, and the launcher leftoauth.enabledoff (/console/runtime.jsonsaid"oauth_enabled": false).vercel.json):/oauth/*,/.well-known/oauth-authorization-server/*and/.well-known/oauth-protected-resource/*go to the server. The rest of/.well-known/stays the website's, sosecurity.txtkeeps its redirect.apps/api/cmd/cloud-launcher): the launcher defaultsNEXTGEN_OAUTH_ENABLEDtotrue.NEXTGEN_OAUTH_CLIENT_DOCUMENT_HOSTSto the hosts of the MCP clients that publish a client ID metadata document:claude.ai(Claude, Claude Code),chatgpt.com(ChatGPT, Codex),vscode.dev,zed.dev,goose-docs.ai,antigravity.google.NEXTGEN_OAUTH_ENABLED=falseand a redeploy turn the server off again.e2e/console/src-deployment/routes.spec.ts): reads the endpoint's metadata and its 401 challenge, and holds that the OAuth paths reach the server.What this turns on beyond MCP:
oauth.enabledis one switch for the whole OAuth server. A customer project's issuer answers once its release turns OAuth on, where the Console said "Off on this server" until now.auth.client.admitpolicy. A seeding that fails fails the build, and the serving deployment stays.Validation
go test ./cmd/cloud-launcher/passes:TestVercelJSONSendsTheServerOnlyItsOwnPathsnow holds the OAuth paths to the server andsecurity.txt,/oauthand/.well-known/openid-configurationto the website. It fails without the new rules.TestClientDocumentHostsAreAListTheServerTakesvalidates the host list with the server's own check.go vet ./cmd/cloud-launcher/andgofmt -lare clean.VERCEL_ENV, public basehttp://localhost:18741):/console/runtime.jsonsaid"oauth_enabled": true.POST /api/v1/mcpwithout a credential answered 401 withWWW-Authenticate: Bearer resource_metadata=".../.well-known/oauth-protected-resource/api/v1/mcp".http://localhost:18741/oauthas its authorization server.client_id_metadata_document_supported: true, S256 andnone.GET /oauth/authorizewithclient_id=https://example.com/client.jsonanswered 400invalid_client("this server does not admit clients whose document that host serves"), with no fetch.https://claude.ai/oauth/claude-code-client-metadata) answered 302 to/console/login?auth_request=….CLOUD_URL=http://localhost:18741 playwright test --config console/playwright.deployment.config.mts -g "MCP client finds").pnpm exec tsc --noEmit -p tsconfig.jsonine2e, biome on the spec, andnode scripts/check-pr-title.mjspass.vitest run scripts/cloud-build.test.mjsfails one case ("restored Go caches skip compilation…") in my container, onmainwithout this change as well: it runs the Vercel build script, which the container cannot.vercel.json's routes on a real Vercel deployment; the launcher test resolves them.Release notes / changeset
build(deploy)changes were; the server's behavior withoauth.enabledshipped with feat(api): sign a person in for an MCP client, with scopes and consent #3494 to feat(api): name the hosts whose OAuth clients a server admits without registration #3499.Notes
server-per-addressrule lists the server's root paths./oauth/*and the two/.well-known/oauth-*prefixes belong in it too (runbook, Firewall rules). The rules are still onlog.https://preview.zitadel.com/api/v1/mcp. Previews sit behind Vercel Authentication, and the platform issuer answers only on the public base, so a preview cannot run the sign-in.Generated by Claude Code