You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -360,6 +361,27 @@ The server creates a record in `mcp_oauth_clients` and responds:
360
361
361
362
The client saves this `client_id` for future use.
362
363
364
+
**Alternative: Client ID Metadata Documents**
365
+
366
+
Instead of Dynamic Client Registration, clients can use **Client ID Metadata Documents** (recommended by MCP spec for clients without prior relationship):
367
+
368
+
1. Client hosts a metadata JSON at an HTTPS URL (e.g., `https://cursor.com/oauth/client.json`)
369
+
2. Client uses this URL as its `client_id` in the authorization request
370
+
3. Server fetches the metadata document to validate redirect URIs
&resource=https://mcp.context7.com ← Must match the authorization request
444
469
```
445
470
446
-
**Step 21 — Context7app validates codeand PKCE**
471
+
**Step 21 — Context7app validates code, PKCE, and resource**
447
472
448
473
The server:
449
474
1. Looks up the code in `mcp_auth_codes`
450
475
2. Checks it hasn't expired or been used
451
-
3. Computes `SHA256(code_verifier)` and verifies it matches the stored `code_challenge`
476
+
3. Verifies `redirect_uri` matches the stored value
477
+
4. Verifies `resource` matches the stored value (RFC 8707)
478
+
5. Computes `SHA256(code_verifier)` and verifies it matches the stored `code_challenge`
452
479
453
-
This proves the same client that started the flow is completing it (prevents code interception attacks).
480
+
This proves the same client that started the flow is completing it (prevents code interception attacks) and that the token is bound to the intended resource.
454
481
455
482
**Step 22 — Context7app creates/regenerates API key**
456
483
@@ -563,8 +590,9 @@ export async function GET() {
563
590
scopes_supported: ["mcp:read", "mcp:write"],
564
591
response_types_supported: ["code"],
565
592
grant_types_supported: ["authorization_code"],
566
-
code_challenge_methods_supported: ["S256"],
593
+
code_challenge_methods_supported: ["S256"],// REQUIRED by MCP spec
567
594
token_endpoint_auth_methods_supported: ["none"],
595
+
client_id_metadata_document_supported: true, // Support Client ID Metadata Documents
568
596
});
569
597
}
570
598
```
@@ -662,6 +690,7 @@ export async function GET(request: Request) {
0 commit comments