Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.mcp-use.com/llms.txt

Use this file to discover all available pages before exploring further.

Auth0 supports two integration modes depending on whether you have access to Auth0’s Dynamic Client Registration (DCR) feature.
Auth0’s built-in DCR feature is currently in Early Access. MCP clients register and authenticate directly with Auth0
To use the built-in Auth0 provider, you need to join Auth0’s Early Access program. See the Auth0 MCP Authorization Guide for details on how to get access.

Auth0 Setup

1. Configure your tenant

In the Auth0 Dashboard:
  1. Go to Settings → Advanced and enable Resource Parameter Compatibility Profile
  2. Promote connections to domain-level so third-party clients (like MCP Inspector) can use them:
    # List connections to get their IDs
    auth0 api get connections
    
    # Promote a connection (e.g. username-password database)
    auth0 api patch connections/YOUR_CONNECTION_ID --data '{"is_domain_connection": true}'
    

2. Create an API

auth0 api post resource-servers --data '{
  "identifier": "https://your-api.example.com",
  "name": "MCP Tools API",
  "signing_alg": "RS256",
  "token_dialect": "rfc9068_profile_authz",
  "enforce_policies": true,
  "scopes": [
    {"value": "read:data", "description": "Read data"}
  ]
}'
The rfc9068_profile_authz token dialect includes the permissions claim in access tokens, enabling scope-based access control.

3. Environment variables

MCP_USE_OAUTH_AUTH0_DOMAIN=your-tenant.auth0.com
MCP_USE_OAUTH_AUTH0_AUDIENCE=https://your-api.example.com

Configuration

import { MCPServer, oauthAuth0Provider } from 'mcp-use/server'

// Zero-config: reads MCP_USE_OAUTH_AUTH0_DOMAIN and MCP_USE_OAUTH_AUTH0_AUDIENCE
const server = new MCPServer({
  name: 'my-server',
  version: '1.0.0',
  oauth: oauthAuth0Provider()
})

await server.listen(3000)
Or pass config explicitly:
oauth: oauthAuth0Provider({
  domain: 'your-tenant.auth0.com',
  audience: 'https://your-api.example.com',

  // Disable JWT verification during development only
  verifyJwt: process.env.NODE_ENV === 'production',

  // Override advertised scopes
  scopesSupported: ['openid', 'profile', 'email', 'offline_access'],
})

Accessing user info in tools

server.tool(
  {
    name: 'get-user-info',
    description: 'Get authenticated user info',
  },
  async (_args, ctx) => ({
    userId: ctx.auth.user.userId,
    email: ctx.auth.user.email,
    name: ctx.auth.user.name,
    nickname: ctx.auth.user.nickname,
    picture: ctx.auth.user.picture,
    permissions: ctx.auth.permissions,
    scopes: ctx.auth.scopes,
  })
)

Permissions

Auth0 includes permissions directly in the access token when you use the rfc9068_profile_authz token dialect. Check them in tool callbacks:
server.tool(
  {
    name: 'delete-document',
    description: 'Delete a document (requires delete:documents)',
  },
  async ({ documentId }, ctx) => {
    if (!ctx.auth.permissions?.includes('delete:documents')) {
      return { content: [{ type: 'text', text: 'Forbidden: delete:documents permission required' }], isError: true }
    }

    await db.documents.delete({ id: documentId })
    return { content: [{ type: 'text', text: 'Document deleted' }] }
  }
)

Resources

Next Steps