anthropics / anthropics/claude-ai-mcp

OAuth authorization URL missing path prefix when protected-resource metadata falls back to root

Aperta
#716 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
bug
Lingua principale
Nessun dato sulla lingua
Stelle
471
Fork
76
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

### What happened?

MCP server URL: https://:8123/api/mcp
Backend: Home Assistant MCP Server integration

What works correctly (verified server-side):

/.well-known/oauth-protected-resource → 200, valid JSON
/.well-known/oauth-authorization-server → 200, valid JSON with:
authorization_endpoint: "https://:8123/auth/authorize"
token_endpoint: "https://:8123/auth/token"
issuer: "https://:8123"

What doesn't work:

/.well-known/oauth-protected-resource/api/mcp (resource-specific variant, with path) → 404

When clicking "Connect", Claude redirects the browser to:

https://:8123/authorize?response_type=code&client_id=https%3A%2F%2Fclaude.ai&redirect_uri=https%3A%2F%2Fclaude.ai%2Fapi%2Fmcp%2Fauth_callback&code_challenge=<...>&code_challenge_method=S256&state=<...>

instead of the correct, server-advertised endpoint:

https://:8123/auth/authorize?...

It appears that when the resource-specific metadata (/.well-known/oauth-protected-resource/api/mcp) returns a 404, Claude falls back to a self-constructed URL (issuer + /authorize) instead of using the authorization_endpoint from /.well-known/oauth-authorization-server.

### What did you expect to happen?

It will open https://:8123/**auth/**authorize?...

### Steps to reproduce

Home Assistant MCP server integration, externally reachable via HTTPS with a custom domain
Add a custom connector in Claude with URL https://:8123/api/mcp, Client ID https://claude.ai, no client secret
Click Connect
Browser goes to .../authorize?... (missing /auth) → 404

### Area

MCP Connector (adding/managing servers)

### MCP Server (if applicable)

_No response_

### Error messages or logs

```shell
No error message or ofid reference appears on claude.ai itself — the browser simply gets stuck on the 404 page of the broken URL and never returns to claude.ai to surface an error.
```

### Additional context

_No response_

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.