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: README.md
+21-25Lines changed: 21 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -423,43 +423,39 @@ The `elicit()` method returns an `ElicitationResult` with:
423
423
424
424
Authentication can be used by servers that want to expose tools accessing protected resources.
425
425
426
-
`mcp.server.auth` implements an OAuth 2.0 server interface, which servers can use by
427
-
providing an implementation of the `OAuthAuthorizationServerProvider` protocol.
426
+
`mcp.server.auth` implements OAuth 2.1 resource server functionality, where MCP servers act as Resource Servers (RS) that validate tokens issued by separate Authorization Servers (AS). This follows the [MCP authorization specification](https://modelcontextprotocol.io/specification/2025-06-18/basic/authorization) and implements RFC 9728 (Protected Resource Metadata) for AS discovery.
427
+
428
+
MCP servers can use authentication by providing an implementation of the `TokenVerifier` protocol:
428
429
429
430
```python
430
431
from mcp import FastMCP
431
-
from mcp.server.auth.provider import OAuthAuthorizationServerProvider
See [OAuthAuthorizationServerProvider](src/mcp/server/auth/provider.py) for more details.
451
+
For a complete example with separate Authorization Server and Resource Server implementations, see [`examples/servers/simple-auth/`](examples/servers/simple-auth/).
452
+
453
+
**Architecture:**
454
+
-**Authorization Server (AS)**: Handles OAuth flows, user authentication, and token issuance
455
+
-**Resource Server (RS)**: Your MCP server that validates tokens and serves protected resources
456
+
-**Client**: Discovers AS through RFC 9728, obtains tokens, and uses them with the MCP server
457
+
458
+
See [TokenVerifier](src/mcp/server/auth/verifier.py) for more details on implementing token validation.
0 commit comments