Skip to main content
Pass a FastMCP AuthProvider as mcp_auth to delegate MCP OAuth to an external authorization server. This example uses WorkOS AuthKit for identity, RBAC, and SSO. See Built-in OAuth for AgentOS-hosted authorization.
oauth_authkit_example.py

Run the Example

1

Set up your virtual environment

2

Install dependencies

3

Export environment variables

4

Run PgVector

5

Run the example

Save the code above as oauth_authkit_example.py, then run:
Full source: cookbook/05_agent_os/14_mcp/oauth_authkit.py