feat(auth): support Client ID Metadata Documents - #195
Merged
Conversation
mattzcarey
force-pushed
the
feat/strict-oauth-resource
branch
from
August 4, 2026 21:09
bacf749 to
0254956
Compare
mattzcarey
force-pushed
the
feat/cimd-auth
branch
from
August 4, 2026 21:10
9a48933 to
373d533
Compare
Client auth method negotiation now offers the provider-supported none alternative alongside private_key_jwt, and CIMD documents are parsed with the typed metadata parser pinned to draft-ietf-oauth-client-id-metadata- document-00. Adopt the 0.10.1 resource-handling semantics in tests: a wrong authorize resource redirects with invalid_target, and a token request omitting resource inherits the grant's canonical resource instead of failing. The provider types now accept the Hono default handler, so drop the ts-ignore.
mattzcarey
force-pushed
the
feat/cimd-auth
branch
from
August 7, 2026 15:09
fd5a443 to
7757ed9
Compare
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.
Stack
Depends on #183 and is intentionally based on
feat/strict-oauth-resourceso CIMD is tested with the canonical/mcpresource policy.Summary
Enable OAuth Client ID Metadata Documents (CIMD) while retaining Dynamic Client Registration as a compatibility fallback.
client_id_metadata_document_supported: trueglobal_fetch_strictly_publicCimdFetchErrorfailures explicitly127.0.0.0/8, and::1.env_exampleand regenerate types for the compatibility flagFailure behavior
503 temporarily_unavailablewithRetry-After: 30500 server_errorinstructing the user to restart; the upstream code and local state have already been consumed, so retrying that callback cannot succeedCommits
fix(auth): stop creating phantom clients during callbacksfeat(auth): enable Client ID Metadata DocumentsValidation
npm run check— 21 test files, 281 testsnpm run types -- --checkgit diff --checknpx wrangler deploy --dry-run --env stagingnpx wrangler deploy --dry-run --env productionCoverage includes metadata advertisement, a complete CIMD authorization/token/MCP flow, no phantom KV clients, DCR compatibility, metadata fetch failures at both phases, consent identity rendering/escaping, localhost warnings, and unsafe redirect rejection.
Staging
The exact rebased branch is deployed to
cloudflare-api-mcp-staging:https://staging.mcp.cloudflare.com/mcp5575a427-fce6-4ac3-aa01-7978ebaa023bLive preflight passed:
/registerhttps://staging.mcp.cloudflare.com/mcphttps://claude.ai/oauth/claude-code-client-metadataClaude Code, theclaude.aiclient hostname, thelocalhostredirect hostname, and the local-redirect warningLive client E2E
Full browser-OAuth and real
searchtool-call results for Claude Code, Codex, OpenCode, and Pi will be added after the four explicitly confirmed staging grants are completed.