mcp-auth
MCP Auth Provider. Add Authentication to your MCP server instantly.
claude mcp add --transport stdio auth-agent-mcp-auth docker run -i auth-agent-mcp-auth:latest \ --env LOG_LEVEL="info" \ --env REDIS_URL="Redis URL for session/storage caching" \ --env ISSUER_URL="Issuer identifier for OAuth endpoints (e.g., https://auth.yourdomain.com)" \ --env PKCE_METHOD="S256" \ --env DATABASE_URL="PostgreSQL connection string (e.g., postgres://user:pass@host:5432/dbname)" \ --env AUTH_BASE_URL="Public base URL for the auth server (e.g., https://auth.yourdomain.com)"
How to use
MCP-Auth acts as a centralized OAuth 2.1 authorization server for MCP servers. It implements PKCE (S256), RFC 8707 resource indicators, token introspection, revocation, and discovery metadata so MCP servers can delegate authentication to a trusted OAuth provider without building their own authorization infrastructure. Clients (such as Claude Code or install-mcp) discover endpoints via the well-known metadata and perform the standard OAuth 2.1 flow to obtain access tokens that are scoped to specific MCP servers and audiences. The server coordinates with a shared Auth-Agent ecosystem and stores session and token data in a PostgreSQL database (via Supabase integration) and optional caching in Redis for performance.
How to install
Prerequisites:
- Docker installed and running
- Access to a PostgreSQL database (or a Supabase instance) for shared storage
- Optional Redis for caching
- Provision the environment
- Ensure your database URL and Redis URL are available to the container via environment variables.
- Prepare a base URL for the OAuth server (AUTH_BASE_URL) and an issuer URL (ISSUER_URL).
- Pull and run the Docker image
# Run the MCP-Auth server container
docker run -d --name mcp-auth \
-e DATABASE_URL="postgres://user:pass@host:5432/dbname" \
-e REDIS_URL="redis://host:6379" \
-e AUTH_BASE_URL="https://auth.yourdomain.com" \
-e ISSUER_URL="https://auth.yourdomain.com" \
-e PKCE_METHOD="S256" \
-e LOG_LEVEL="info" \
-p 8080:8080 \
auth-agent-mcp-auth:latest
- Configure MCP servers to use this provider
- Point your MCP server(s) to the discovery endpoints at https://auth.yourdomain.com/.well-known/oauth-authorization-server and https://auth.yourdomain.com/.well-known/oauth-protected-resource.
- Use the token introspection, revocation, and userinfo endpoints as documented by the server.
- Verify installation
- Check container logs: docker logs -f mcp-auth
- Ensure the endpoints respond and that access tokens minted by this server are accepted by your MCP services.
Additional notes
Notes and tips:
- PKCE is required; ensure your clients perform the PKCE challenge/verification using S256.
- Token audience (RFC 8707) ensures tokens are bound to a specific MCP server; do not reuse tokens across different servers.
- If you use Supabase/PostgreSQL, keep database credentials in a secure secret manager and rotate keys periodically.
- Enable introspection and revocation endpoints to allow MCP servers to validate and revoke tokens as needed.
- If you encounter connection issues to Redis or Postgres, verify network access, TLS settings, and correct environment variable values.
- Monitor logs for authentication failures to identify misconfigured client IDs, redirect URIs, or scopes.
Related MCP Servers
obsidian -tools
Add Obsidian integrations like semantic search and custom Templater prompts to Claude or any MCP client.
ironcurtain
A secure* runtime for autonomous AI agents. Policy from plain-English constitutions. (*https://ironcurtain.dev)
CanvasMCPClient
Canvas MCP Client is an open-source, self-hostable dashboard application built around an infinite, zoomable, and pannable canvas. It provides a unified interface for interacting with multiple MCP (Model Context Protocol) servers through a flexible, widget-based system.
vikunja
Model Context Protocol server for Vikunja task management. Enables AI assistants to interact with Vikunja instances via MCP.
grok-faf
First MCP server for Grok | FAST⚡️AF • URL-based AI context • Vercel-deployed
mcp-turso
MCP server for interacting with Turso-hosted LibSQL databases