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
Copy file name to clipboardExpand all lines: docs/router/mcp.mdx
+38-3Lines changed: 38 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -244,7 +244,10 @@ storage_providers:
244
244
| `oauth.scope_challenge_include_token_scopes` | When `true`, includes the token's existing scopes in the `scope` parameter of 403 responses. Works around MCP SDK scope accumulation bugs. See [Scope Challenge Behavior](#scope-challenge-behavior). | `false` |
245
245
| `oauth.scopes.initialize` | Scopes required for **all** HTTP requests (checked before JSON-RPC parsing). This is the baseline scope needed to establish an MCP connection. | `[]` |
246
246
| `oauth.scopes.tools_list` | Scopes required for the `tools/list` MCP method. | `[]` |
247
-
| `oauth.scopes.tools_call` | Scopes required for the `tools/call` MCP method (any tool invocation). Per-tool scopes from `@requiresScopes` are enforced additively. | `[]` |
247
+
| `oauth.scopes.tools_call` | Scopes required for the `tools/call` MCP method (any tool invocation). Per-tool and built-in tool scopes are enforced additively. | `[]` |
248
+
| `oauth.scopes.execute_graphql` | Scopes required to call the `execute_graphql` built-in tool. Additive to `tools_call`. Only relevant when `enable_arbitrary_operations` is `true`. | `[]` |
249
+
| `oauth.scopes.get_operation_info` | Scopes required to call the `get_operation_info` built-in tool. Additive to `tools_call`. | `[]` |
250
+
| `oauth.scopes.get_schema` | Scopes required to call the `get_schema` built-in tool. Additive to `tools_call`. Only relevant when `expose_schema` is `true`. | `[]` |
248
251
| `oauth.jwks` | List of JWKS providers for JWT verification. Supports remote JWKS URLs or symmetric secrets. See [JWKS Configuration](#jwks-configuration). | `[]` |
249
252
| `server.base_url` | The public base URL of the MCP server. **Required when OAuth is enabled.** Used for the RFC 9728 metadata endpoint and `resource_metadata` in `WWW-Authenticate` headers. Set this to your externally-reachable URL when behind a reverse proxy or load balancer. | - |
250
253
@@ -508,8 +511,9 @@ Scopes are enforced at multiple levels, all at the HTTP transport layer per the
508
511
HTTP Request
509
512
→ Initialize scopes (all requests)
510
513
→ Method scopes (tools/list, tools/call)
511
-
→ Per-tool scopes (from @requiresScopes on operation fields)
@@ -542,6 +546,27 @@ When both `initialize` and method-level scopes are configured, the token must co
542
546
Scopes in the JWT must be provided as a **space-separated string** in the `scope` claim (per OAuth 2.0 convention). Array-format scope claims are not supported.
543
547
</Info>
544
548
549
+
#### Built-in Tool Scopes
550
+
551
+
The MCP server provides three built-in tools: `execute_graphql`, `get_operation_info`, and `get_schema`. Each can have its own scope requirements, configured independently from `tools_call`:
552
+
553
+
```yaml
554
+
oauth:
555
+
scopes:
556
+
tools_call:
557
+
- "mcp:tools:execute" # Base gate for any tool
558
+
execute_graphql:
559
+
- "mcp:graphql:execute" # Additional scope for execute_graphql
560
+
get_operation_info:
561
+
- "mcp:ops:read" # Additional scope for get_operation_info
562
+
get_schema:
563
+
- "mcp:schema:read" # Additional scope for get_schema
564
+
```
565
+
566
+
Built-in tool scopes are **additive** to `tools_call` — the token must satisfy both. If `tools_call` is empty, only the built-in tool scope is checked.
567
+
568
+
Scopes for `execute_graphql` are only relevant when `enable_arbitrary_operations: true`, and scopes for `get_schema` are only relevant when `expose_schema: true`. When the corresponding feature is disabled, the tool is not registered and its scopes are excluded from the `scopes_supported` metadata.
569
+
545
570
#### Per-Tool Scopes (from `@requiresScopes`)
546
571
547
572
When your GraphQL schema uses the `@requiresScopes` directive on fields, the MCP server automatically extracts scope requirements for each tool at startup. If a tool's underlying GraphQL operation touches fields that require specific scopes, those scopes are enforced when the tool is called.
@@ -583,6 +608,7 @@ This runtime check uses the same OR-of-AND semantics and smart challenge selecti
583
608
| --- | --- | --- | --- |
584
609
| Initialize | Every HTTP request | `oauth.scopes.initialize` | 403 with required scopes |
0 commit comments