mcp-server: protected-resource metadata `resource` should be the /mcp URL
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 56/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
- Ambito
- api, authentication
Direzione di ricerca
Start with the protected resource metadata route in packages/mcp-server/src/server.ts, then read src/oauth/metadata.ts and src/oauth/challenge.ts to trace the metadata URL and 401 pointer. Update the metadata and challenge behavior, then run the metadata, handler, and MCP end to end tests listed in the issue. Done means both metadata paths return the /mcp resource, the challenge points to the path-suffixed URL, docs are resolved, and a patch changeset is added; deployed client sign-in also needs verification.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Problem
The MCP server's protected-resource metadata (RFC 9728) names the bare origin as the resource, while clients connect to the /mcp endpoint:
$ curl https://mcp.accounter.tax/.well-known/oauth-protected-resource
{"resource":"https://mcp.accounter.tax","authorization_servers":["https://dev-cnaunfqjwhwwd8ld.us.auth0.com/"],"bearer_methods_supported":["header"]}
The connector URL users enter is https://mcp.accounter.tax/mcp. Claude's connector docs require the metadata resource to match the connector URL, path included, and RFC 9728 §3.3 has clients reject a metadata document whose resource doesn't match the resource they requested. Claude Desktop currently tolerates the mismatch, but that's not something to rely on, especially once the connector moves to CIMD (#4616) and a directory listing.
Where
packages/mcp-server/src/server.ts: thePROTECTED_RESOURCE_METADATA_PATHroute passesenv.server.publicBaseUrlasresource.packages/mcp-server/src/config/env.ts:publicBaseUrlisMCP_PUBLIC_BASE_URLwith the trailing slash stripped (an origin, by convention).packages/mcp-server/src/oauth/metadata.ts:buildProtectedResourceMetadata,protectedResourceMetadataUrl.- The 401 challenge's
resource_metadatapointer (src/oauth/challenge.ts) points at/.well-known/oauth-protected-resource.
What to decide while fixing it
- Resource value: build
resourceas${publicBaseUrl}${MCP_ROUTE_PATH}, keepingMCP_PUBLIC_BASE_URLan origin (no env change in deploys). - Metadata location: RFC 9728 puts the metadata for a resource with a path at
/.well-known/oauth-protected-resource/mcp(that returns 404 today). Serve it there and point theWWW-Authenticateresource_metadataat it. Keep the root path serving the same document for clients that probe the origin. - Audience: token verification is unaffected. Auth0 tokens carry
aud: https://api.accounter.com, not the resource URL. Gap 3 indocs/connector-gaps-and-decisions.mdcovers audience binding separately.
Done when
-
GET /.well-known/oauth-protected-resource/mcpreturnsresource: <base>/mcp; the root well-known path returns the same document. - The 401 challenge's
resource_metadatapoints at the path-suffixed URL. - Unit tests (
src/oauth/__tests__/metadata.test.ts,src/mcp/__tests__/handler.test.ts) andsrc/__tests__/mcp-e2e.test.tsupdated. - After deploy, Claude Desktop (custom connector, own OAuth client) and Cursor still connect and complete sign-in.
- The PRM note under B1 in
packages/mcp-server/docs/todo.mdand the gap 3 update inconnector-gaps-and-decisions.mdare marked resolved. - Changeset for
@accounter/mcp-server(patch).
Related: #4616.
🤖 Generated with Claude Code
- Lingua principale
- TypeScript
- Stelle
- 30
- Fork
- 10
- Merge medio
- 2g 12h
- PR unite (30g)
- 276
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Urigo/accounter-fullstack
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
Urigo/accounter-fullstack#5302 ·
I maintainer di solito rispondono entro 2 giorni
-
1214 annual-audit-workflow
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
Urigo/accounter-fullstack#5257 ·
I maintainer di solito rispondono entro 2 giorni
-
1214 annual-audit-workflow
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
Urigo/accounter-fullstack#5256 ·
I maintainer di solito rispondono entro 2 giorni
-
annual-audit-workflow
Difficoltà 1/5 1-3 ore Idoneità per principianti 87/100
Urigo/accounter-fullstack#5252 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
Urigo/accounter-fullstack#4919 ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di Urigo/accounter-fullstack
Issue simili
-
area: integrations documentation priority: P2 size: XS
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
eddiejaoude/StackDash#798 ·
I maintainer di solito rispondono entro 1 giorno
-
bot:ai-assisted component:midnight-js status:untriaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
midnightntwrk/midnight-js#1790 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
area:vscode bug has repro platform:macos platform:vscode regression
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
anthropics/claude-code#113502 ·
-
Add: Rajdhani TV HDApertacheck:passed streams:add
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 77/100
I maintainer di solito rispondono entro 1 giorno