docs(host-cloudflare): document MCP client auth for Access-gated /mcp#1130
Open
amondnet wants to merge 3 commits into
Open
docs(host-cloudflare): document MCP client auth for Access-gated /mcp#1130amondnet wants to merge 3 commits into
amondnet wants to merge 3 commits into
Conversation
Explain why an MCP client hits 'Unexpected content type: text/html' when connecting to the Access-gated /mcp endpoint (it receives the Cloudflare Access HTML login page, not a Worker response), and document the two ways to authenticate: Managed OAuth for interactive clients and an Access service token for headless clients.
9904d03 to
4759c3e
Compare
Greptile SummaryThis PR updates the Cloudflare hosting guide for Access-gated MCP connections. The main changes are:
Confidence Score: 5/5This looks safe to merge.
Important Files Changed
Reviews (3): Last reviewed commit: "docs(cloudflare): add service-token fall..." | Re-trigger Greptile |
Note that the Access application must be scoped to the whole Worker hostname so /.well-known OAuth discovery probes are answered by Access, not the Worker SPA fallback.
…enge is unconsumable If a client cannot consume Access's Managed OAuth 401 challenge, point readers to the service-token path, which needs no client-side OAuth discovery.
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.
Summary
Documents how to connect an MCP client to the Access-gated
/mcpendpoint on the Cloudflare host, and explains the confusing failure mode users hit first.Connecting a client to
/mcpwithout an Access credential returns the Cloudflare Access HTML login page, which the streamable-HTTP client rejects with:That is the Access login page, not a Worker response. A browser passes Access interactively, but an MCP client cannot follow that redirect, so it must authenticate another way.
Changes
Rewrites the "Connect an agent" section of
apps/docs/hosted/cloudflare.mdxto cover two auth paths:Cf-Access-Jwt-Assertion).CF-Access-Client-Id/CF-Access-Client-Secretheaders.Also moves the MCP Proxy reference to the end of the section (a post-connection next step) and fixes prose to comply with the repo's no-em-dash rule.
Notes
Docs-only change. Technical claims were verified against the implementation (
wrangler.jsoncrun_worker_first,cloudflare-access.tscommon_namehandling,mcp/auth.tsJWT-only validation); no contradictions found.