- Auth for MCP â Auth0 handles OAuth, DCR, and CIMD; FastMCP validates tokens (
Auth0MCPProvider). Use this for MCP-native clients and Auth0âs Auth for MCP setup. - OIDC Proxy â FastMCP proxies OAuth with fixed application credentials (
Auth0Provider). Use this when you manage an Auth0 application manually and do not need tenant-level DCR.
Auth for MCP (DCR)
This path uses the Remote OAuth pattern. Auth0 acts as the authorization server; FastMCP is the resource server.Prerequisites
- An Auth0 account with Auth for MCP enabled
- Resource Parameter Compatibility Profile enabled (Settings â Advanced)
- Your FastMCP server URL (use
http://127.0.0.1:8000in development â notlocalhost)
Step 1: Create an Auth0 API
Create an API (Resource Server) whose identifier is your MCP resource URL, for examplehttp://127.0.0.1:8000/mcp. Use RS256 signing and the rfc9068_profile_authz token dialect if you need permissions claims on tokens.
When the server starts, it logs the exact aud value it validates â your API identifier must match.
Step 2: FastMCP configuration
server_mcp.py
client_id or client_secret is required on the FastMCP side â MCP clients register with Auth0 directly.
Testing
Seeexamples/auth/auth0_mcp/ for a runnable server and DCR client. Set AUTH0_CONFIG_URL to your tenantâs OIDC discovery URL before starting the server.
OIDC Proxy (fixed credentials)
This integration uses the OIDC Proxy pattern when you use a fixed Auth0 application instead of tenant-level DCR.Prerequisites
Before you begin, you will need:- An Auth0 Account with access to create Applications
- Your FastMCP serverâs URL (can be localhost for development, e.g.,
http://localhost:8000)
Step 1: Create an Auth0 Application
Create an Application in your Auth0 settings to get the credentials needed for authentication:1
Navigate to Applications
Go to Applications â Applications in your Auth0 account.Click â+ Create Applicationâ to create a new application.
2
Create Your Application
- Name: Choose a name users will recognize (e.g., âMy FastMCP Serverâ)
- Choose an application type: Choose âSingle Page Web Applicationsâ
- Click Create to create the application
3
Configure Your Application
Select the âSettingsâ tab for your application, then find the âApplication URIsâ section.
- Allowed Callback URLs: Your server URL +
/auth/callback(e.g.,http://localhost:8000/auth/callback) - Click Save to save your changes
4
Save Your Credentials
After creating the app, in the âBasic Informationâ section youâll see:
- Client ID: A public identifier like
tv2ObNgaZAWWhhycr7Bz1LU2mxlnsmsB - Client Secret: A private hidden value that should always be stored securely
5
Select Your Audience
Go to Applications â APIs in your Auth0 account.
- Find the API that you want to use for your application
- API Audience: A URL that uniquely identifies the API
Step 2: FastMCP Configuration
Create your FastMCP server using theAuth0Provider.
server.py
Testing
Running the Server
Start your FastMCP server with HTTP transport to enable OAuth flows:Testing with a Client
Create a test client that authenticates with your Auth0-protected server:test_client.py
- Your browser will open to Auth0âs authorization page
- After you authorize the app, youâll be redirected back
- The client receives the token and can make authenticated requests
Production Configuration
For production deployments with persistent token management across server restarts, configurejwt_signing_key, and client_storage:
server.py
Parameters (
jwt_signing_key and client_storage) work together to ensure tokens and client registrations survive server restarts. Wrap your storage in FernetEncryptionWrapper to encrypt sensitive OAuth tokens at rest - without it, tokens are stored in plaintext. Store secrets in environment variables and use a persistent storage backend like Redis for distributed deployments.For complete details on these parameters, see the OAuth Proxy documentation.The client caches tokens locally, so you wonât need to re-authenticate for subsequent runs unless the token expires or you explicitly clear the cache.

