Skip to content

cimd: tolerate unknown grant_types in client metadata (fix claude.ai outage)#147

Merged
BorisTyshkevich merged 1 commit into
mainfrom
fix-cimd-tolerate-unknown-grant-types
Jun 24, 2026
Merged

cimd: tolerate unknown grant_types in client metadata (fix claude.ai outage)#147
BorisTyshkevich merged 1 commit into
mainfrom
fix-cimd-tolerate-unknown-grant-types

Conversation

@BorisTyshkevich

Copy link
Copy Markdown
Collaborator

Problem

claude.ai changed its published CIMD client metadata document to advertise a third grant type:

"grant_types":["authorization_code","refresh_token","urn:ietf:params:oauth:grant-type:jwt-bearer"]

The grant_types validator in parseCIMDMetadata (cmd/altinity-mcp/cimd.go) had a hard allowlist of {authorization_code, refresh_token} with a default: branch that rejected the entire metadata document on any other entry. Result: every claude.ai connector failed at /oauth/authorize with

cimd: invalid metadata document: unsupported grant_type "urn:ietf:params:oauth:grant-type:jwt-bearer"

surfacing client-side as {"error":"invalid_client","error_description":"unknown OAuth client"}. ChatGPT was unaffected (its client.json lists no extra grants). This is the same failure class as the earlier private_key_jwt rejection (#119): a too-strict CIMD parser breaks the moment a first-party client adds a field.

Fix

The CIMD grant_types array advertises client capability, not what we issue. .well-known/oauth-authorization-server only lists authorization_code and /oauth/token returns unsupported_grant_type for everything else, so tolerating unknown entries changes nothing about issued tokens. The default: branch now ignores unknown grant_types; the only retained constraint is that authorization_code must be present.

Tests

  • TestParseCIMDMetadata_OK updated to carry claude.ai's real 3-element array (incl. jwt-bearer) as a regression guard.
  • The former unsupported_grant reject case renamed grant_types_without_authcode — it still rejects, but now because authorization_code is absent, not because the other grant is unknown.
  • Full ./cmd/altinity-mcp/ suite green.

Deployment

Built arm64 and deployed to the live github-mcp fleet (mcp.demo.altinity.cloud, serving /mcp/antalya + /mcp/github) as fix-cimd-grant-types-99f0e05-arm64. Verified: /authorize with claude.ai's client_id now 302-redirects to Google, and the antalya connector reconnects successfully in claude.ai.

🤖 Generated with Claude Code

…i outage)

claude.ai's CIMD client metadata document now publishes
grant_types: ["authorization_code","refresh_token","urn:ietf:params:oauth:grant-type:jwt-bearer"].
The jwt-bearer entry hit the default branch of the grant_types validator and
failed the whole CIMD resolution with "unsupported grant_type", taking every
claude.ai connector down at /authorize (ChatGPT unaffected — its client.json
lists no extra grants).

The CIMD grant_types array advertises client capability, not what we issue:
.well-known/oauth-authorization-server lists only authorization_code and /token
rejects everything else, so tolerating unknown entries changes nothing about
issued tokens. Require authorization_code to be present; ignore the rest.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NTbw8cvu8efRe2XqcTSMvo
@BorisTyshkevich BorisTyshkevich merged commit 37dde2a into main Jun 24, 2026
4 checks passed
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