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
- Set up an MCP server with OAuth 2.0 behind AWS Cognito (which does not support dynamic client registration)
- Serve
/.well-known/oauth-authorization-servermetadata (RFC 8414) without aregistration_endpoint - Serve
/.well-known/oauth-protected-resourcemetadata (RFC 9728) - Configure
.mcp.json:
{
"mcpServers": {
"my-server": {
"type": "http",
"url": "https://my-server.example.com/mcp/",
"oauth": {
"clientId": "my-cognito-client-id",
"callbackPort": 19876
}
}
}
}
- 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_endpointis set tonullin the metadata response, Claude Code also fails with a Zod validation error:"expected string, received null"onregistration_endpointpath. 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
clientIdapproach is the standard pattern for CLI tools (similar togh 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)
This issue has 10 comments on GitHub. Read the full discussion on GitHub ↗