Casdoor as MCP Auth Provider
The Model Context Protocol (MCP) specification requires servers to implement OAuth 2.1 for secure authentication. Building a compliant authorization server from scratch—with Dynamic Client Registration, PKCE, consent screens, JWKS endpoints, and token issuance—is a significant engineering burden for developers who just want to build MCP tools.
Casdoor solves this problem. As a full-featured, open-source identity platform, Casdoor provides all the OAuth 2.1 infrastructure your MCP server needs. Point your server's Protected Resource Metadata to Casdoor, and it handles user authentication, consent, token issuance, and validation—while you focus on building your MCP tools.
Why use Casdoor for MCP auth?
The MCP spec separates the authorization server from the resource server. While this separation allows MCP servers to delegate authentication to external providers, it also requires implementing:
- OAuth 2.1 endpoints: Authorization, token, and introspection endpoints
- Dynamic Client Registration (DCR): RFC 7591 for automatic client registration
- PKCE: Proof Key for Code Exchange for secure authorization flows
- Consent screens: User-facing UI for granting permissions
- Token validation: JWKS endpoints and JWT signature verification
- Resource indicators: RFC 8707 for audience-restricted tokens
- Metadata discovery: RFC 8414 and OIDC Discovery for endpoint advertising
Building and maintaining this yourself is a large effort. Casdoor provides it out of the box.
Using Casdoor as the MCP auth provider
Instead of building your own authorization server, configure your MCP server to use Casdoor as its OAuth provider. Casdoor provides:
What Casdoor Provides
Casdoor implements the complete OAuth 2.1 stack required for MCP authorization:
Standards Compliance:
- ✅ RFC 8414: OAuth 2.0 Authorization Server Metadata (
/.well-known/oauth-authorization-server) - ✅ OIDC Discovery: OpenID Connect Discovery (
/.well-known/openid-configuration) - ✅ RFC 7591: Dynamic Client Registration (
/api/oauth/register) - ✅ RFC 7636: PKCE support in authorization flow
- ✅ RFC 8707: Resource Indicators (audience-restricted tokens)
- ✅ RFC 7517: JWKS endpoint for token validation
Built-in Features:
- 🔐 User authentication: Password, SSO, MFA, WebAuthn, Face ID
- 👤 User management: Organizations, roles, permissions, user directory
- ✅ Consent screens: Customizable authorization prompts with scope descriptions
- 🎟️ Token management: JWT issuance, refresh tokens, token introspection
- 🔑 Custom scopes: Define granular permissions for your MCP tools (see Custom Scopes)
- 🏢 Multi-tenancy: Organization-based isolation for different deployments
- 📊 Audit logs: Track authorization events and token usage
Developer Experience: