MCP OAuth: "does not support dynamic client registration" despite clientId configured

Resolved 💬 10 comments Opened Mar 24, 2026 by shivarammysore Closed May 5, 2026

Bug Description

When connecting to an HTTP MCP server with OAuth authentication, Claude Code fails with:

Error: Incompatible auth server: does not support dynamic client registration

This occurs even when clientId is explicitly configured in .mcp.json and via claude mcp add --client-id.

Expected Behavior

When a clientId is provided (either in .mcp.json oauth.clientId or via --client-id flag), Claude Code should use it directly for the OAuth authorization code flow instead of attempting dynamic client registration (RFC 7591).

Reproduction

  1. Set up an MCP server with OAuth 2.0 behind AWS Cognito (which does not support dynamic client registration)
  2. Serve /.well-known/oauth-authorization-server metadata (RFC 8414) without a registration_endpoint
  3. Serve /.well-known/oauth-protected-resource metadata (RFC 9728)
  4. Configure .mcp.json:
{
  "mcpServers": {
    "my-server": {
      "type": "http",
      "url": "https://my-server.example.com/mcp/",
      "oauth": {
        "clientId": "my-cognito-client-id",
        "callbackPort": 19876
      }
    }
  }
}
  1. Run /mcp → Authenticate → Error: "does not support dynamic client registration"

Also tried: claude mcp add --transport http --client-id <id> --callback-port 19876 my-server https://...

Same error.

Additional Notes

  • If registration_endpoint is set to null in the metadata response, Claude Code also fails with a Zod validation error: "expected string, received null" on registration_endpoint path. Removing the field entirely avoids this but triggers the dynamic registration error above.
  • AWS Cognito is a widely used OAuth provider that does NOT support dynamic client registration. The pre-registered clientId approach is the standard pattern for CLI tools (similar to gh auth login, gcloud auth login).
  • PKCE (S256) is supported by both the server and Cognito.

Environment

  • Claude Code CLI (latest)
  • macOS Darwin 25.3.0
  • OAuth provider: AWS Cognito (custom domain)

View original on GitHub ↗

This issue has 10 comments on GitHub. Read the full discussion on GitHub ↗