π The fast, Pythonic way to build MCP servers and clients.
AuthKit Example
Protects a FastMCP server with WorkOS AuthKit. The server binds the JWT
aud claim to its own resource URL automatically β you just paste that same
URL into the WorkOS Dashboard as a resource indicator.
WorkOS Dashboard setup
In the WorkOS Dashboard for your project, go to Connect β Configuration and:
- Under MCP Auth, enable Dynamic Client Registration (or Client ID Metadata Document if your MCP client supports it).
- Under MCP resource indicators, add
http://127.0.0.1:8000/mcpas a valid resource indicator.
Running
Set your AuthKit domain:
export AUTHKIT_DOMAIN="https://your-app.authkit.app"Start the server. It logs the resource URL it's validating against β that's the URL that must match your dashboard resource indicator:
python server.pyIn another terminal, run the client. Your browser will open for AuthKit authentication:
python client.py