TemplatesAuth0 Authentication

Auth0 Authentication

An MCP server with Auth0 authentication and tools to interact with Auth0 client.

Auth0 Authentication preview

An authenticated MCP server using Auth0 for JWT-based authentication.

Features

  • Auth0 JWT verification via JWKS endpoint
  • Session data accessible in tools via getAuthInfo()
  • OAuth discovery endpoints auto-registered
  • Example tools: greet, random-number, whoami
  • HTTP transport with middleware-based auth

Getting Started

Prerequisites

You need an Auth0 account with:

  • An API (or create one)
  • A Machine-to-Machine application with access to your API

1. Create the project

2. Environment setup

Edit .env with your Auth0 credentials:

3. Install & run

How It Works

  1. MCP clients send requests with Authorization: Bearer <token> header
  2. The middleware verifies the JWT using Auth0's JWKS endpoint
  3. Valid sessions are stored in AsyncLocalStorage context
  4. Tools access auth data via getAuthInfo()

Using Auth Data in Tools

OAuth Endpoints

The plugin automatically registers:

  • GET /.well-known/oauth-protected-resource — Resource server metadata
  • GET /.well-known/oauth-authorization-server — Authorization server metadata

Deploy

Learn More

Other templates

One framework to rule them all