Skip to content

fix(oauth): pin the Claude Code client metadata document - #2733

Closed
abnoumaru wants to merge 1 commit into
openstatusHQ:mainfrom
abnoumaru:fix/pin-claude-code-client-metadata
Closed

abnoumaru wants to merge 1 commit into
openstatusHQ:mainfrom
abnoumaru:fix/pin-claude-code-client-metadata

Conversation

@abnoumaru

@abnoumaru abnoumaru commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Why

Authenticating the openstatus MCP server from Claude Code fails in the browser:

{"error":"invalid_client","error_description":"Client metadata document responded with HTTP 403"}

claude.ai serves a Cloudflare bot challenge to some datacenter egress (observed on Fly in #2653), which is what KNOWN_CLIENT_DOCUMENTS exists for. That map only carries the Claude web client (mcp-oauth-client-metadata). Claude Code identifies itself with its own document (claude-code-client-metadata), so with nothing stored yet the 403 surfaces as-is.

The new entry is what claude.ai serves at that path, reduced to the fields ClientMetadataDocument reads. The port-less loopback redirect_uris are what claude.ai publishes; matchesRegisteredRedirectUri already matches an ephemeral port against them.

Tests

  • The pinned-fallback test iterates every entry, so a mis-typed name or redirect on any pin fails, not only the first.
  • Pinned documents bypass parseClientMetadataDocument at runtime; each is now run through it so a hand-copied entry cannot skip the validation a fetched one gets.

Note

Takes effect once api.openstatus.dev ships it. The [oauth/cimd] ... responded with HTTP 403 (cf-mitigated=...) log line from #2653 should show the Claude Code URL in the Fly logs; I cannot see them, so a maintainer's confirmation would be welcome.

@vercel

vercel Bot commented Sep 16, 2026

Copy link
Copy Markdown

@abnoumaru is attempting to deploy a commit to the OpenStatus Team on Vercel.

A member of the Team first needs to authorize it.

claude.ai answers 403 to datacenter egress, so Claude Code's own
client_id URL needs the same pinned fallback the web client already has.
@abnoumaru
abnoumaru force-pushed the fix/pin-claude-code-client-metadata branch from 5dbc2b5 to e4e2d9d Compare September 16, 2026 06:54
@abnoumaru

Copy link
Copy Markdown
Contributor Author

Every time a new client document is added, we would need to create a separate pinned entry for it. I realized that dealing with each one this way would just turn into an endless cycle. The root cause is that fetches from Fly's outbound network are being blocked, and this should be fixed by the static egress IPs mentioned in #2653 instead. I'm closing this.

@abnoumaru abnoumaru closed this Sep 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant