Skip to main content
AGENTOS_URL must be the public origin the client actually connects to (every advertised OAuth URL and the token audience derive from it) — so behind a tunnel or proxy, set it to the external HTTPS URL, not localhost. AGENTOS_MCP_SIGNING_KEY is optional but recommended in production: set it so the token trust root is env-managed and survives redeploys / is shared across replicas; when unset, a key is generated and persisted in the database.
oauth_builtin_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_builtin_example.py, then run:
Full source: cookbook/05_agent_os/mcp_demo/oauth_builtin_example.py