MCP Auth provides drop-in OAuth 2.1 authorization for Model Context Protocol (MCP) servers, enabling secure authentication for AI hosts like Claude Desktop, Cursor, and VS Code. Scalekit acts as your authorization server, handling client registration, token issuance, and scope-based permissions while you focus on building MCP tools.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/scalekit-inc/developer-docs/llms.txt
Use this file to discover all available pages before exploring further.
What you get
MCP Auth implements the complete OAuth 2.1 authorization server:- OAuth 2.1 authorization server: Production-ready OAuth for MCP servers
- Dynamic Client Registration (DCR): Automatic client onboarding without manual setup
- Client ID Metadata Document (CIMD): Simplified client registration via metadata
- Token management: Access token issuance, validation, and refresh
- Scope-based permissions: Granular control over tool access
- Multiple auth methods: Enterprise SSO, social logins, and custom auth
Why MCP needs authentication
MCP servers expose tools that AI hosts can discover and execute. Without authentication:- Any client could access your MCP server resources
- No way to identify which user is making requests
- Cannot implement per-user permissions or rate limits
- Difficult to audit and track tool usage
- Only authorized clients can access your server
- Every request identifies the authenticated user
- Implement fine-grained, scope-based permissions
- Complete audit trail of all tool executions
Key features
Drop-in OAuth 2.1 server
Scalekit acts as your authorization server:- Authorization endpoint (
/oauth/authorize) - Token endpoint (
/oauth/token) - Client registration endpoint (
/client_register) - JWKS endpoint for token verification
- Metadata endpoints for discovery
Dynamic Client Registration (DCR)
Automatic client onboarding:- MCP clients register themselves without manual setup
- No pre-configuration required
- Instant onboarding for new AI hosts
- Automatic client credential issuance
Client ID Metadata Document (CIMD)
Simplified client registration via metadata:- Clients publish metadata at well-known URL
- Authorization server fetches metadata automatically
- No explicit registration request needed
- Decentralized client configuration
Resource metadata endpoint
MCP clients discover your OAuth server:Scope-based permissions
Granular access control:todo:read- Read access to taskstodo:write- Create and modify taskstodo:delete- Delete tasks- Custom scopes for your tools
How it works
Discovery phase
- MCP client encounters your protected MCP server
- Server responds with
401 Unauthorizedand resource metadata URL - Client fetches resource metadata to discover Scalekit authorization server
- Client fetches authorization server metadata
Authorization phase (DCR)
- Client registers with Scalekit via DCR endpoint
- Scalekit issues client credentials
- Client initiates authorization code flow
- User authenticates and grants consent
- Scalekit issues access token with scopes
Authorization phase (CIMD)
- Client initiates authorization with PKCE challenge
- Scalekit fetches client metadata from CIMD URL
- User authenticates and grants consent
- Scalekit issues access token with scopes
Access phase
- Client includes access token in MCP requests
- MCP server validates token and enforces scopes
- Server processes request and returns response
Integration steps
1. Register MCP server
In Scalekit dashboard:- Navigate to MCP Servers > Add MCP server
- Provide server name (shown on consent page)
- Enable Dynamic Client Registration for automatic client onboarding
- Enable CIMD for metadata-based registration
- Configure Server URL (your MCP server identifier)
- Set Access token lifetime (recommended 5-60 minutes)
- Define Scopes (e.g.,
todo:read,todo:write)
2. Implement discovery endpoint
3. Validate tokens
4. Implement scope validation
Authentication methods
Enterprise SSO
Organizations authenticate through their identity providers:- Okta, Azure AD, Google Workspace
- SAML and OIDC protocols
- Centralized access control
- Single sign-on experience
Social logins
Individual users authenticate via social providers:- Google, GitHub, Microsoft
- Quick onboarding
- Familiar authentication
- Personal and small team use
Custom authentication
Integrate your own authentication system:- Use existing user database
- Custom authentication logic
- Bring your own identity provider
- Full control over authentication
Use cases
Customer-facing MCP servers
Secure MCP servers for external customers:- SaaS MCP servers: Authenticate customers before tool access
- API-backed tools: Protect sensitive data and operations
- Multi-tenant servers: Per-customer access control
Internal enterprise tools
Secure internal MCP servers:- Development tools: GitHub, Jira, internal APIs
- Business tools: CRM, project management, databases
- Compliance: Audit trail for all tool executions
AI agent integrations
Authenticate autonomous agents:- Coding assistants: Access to code repositories and tools
- Business agents: CRM updates, task creation
- Data agents: Database queries, analytics
Security features
OAuth 2.1 enhancements
- Mandatory PKCE: Prevents authorization code interception
- Strict redirect validation: Exact URI matching required
- Short-lived tokens: Configurable 5-60 minute lifetime
- Token binding: Prevents token theft and replay attacks
Audit and compliance
- Complete authentication event logs
- Token issuance and validation tracking
- Scope-based access logs
- Per-user activity monitoring
Token security
- JWT-based access tokens
- RS256 signature algorithm
- JWKS endpoint for verification
- Automatic token expiration
FastMCP integration
Using FastMCP? Add auth in 5 lines:Framework support
MCP Auth works with popular MCP frameworks:- FastMCP (Python): First-class Scalekit plugin
- Express.js (Node.js): Middleware-based integration
- FastAPI (Python): Middleware and dependency injection
- Custom servers: Any HTTP framework with middleware support
Benefits
Developer experience
- Drop-in solution: OAuth server ready in minutes
- No OAuth expertise: Scalekit handles complex OAuth flows
- Automatic client registration: DCR and CIMD support
- Simple token validation: Single SDK method
- Multi-language SDKs: Node.js, Python, Go, Java
Security and compliance
- OAuth 2.1 standard: Industry-standard authorization
- SOC 2 certified: Enterprise-grade security
- Audit logging: Complete access trail
- Scope enforcement: Fine-grained permissions
- 99.99% uptime: Production-ready reliability
Compatibility
- MCP compliant: Follows MCP authorization specification
- AI host compatible: Works with Claude, Cursor, VS Code
- Standards-based: OAuth 2.1, DCR, CIMD, PKCE
- Future-proof: Supports evolving MCP standards
Get started
Quickstart guide
Add OAuth to your MCP server in 30 minutes
MCP integration guide
Add auth to MCP servers in 5 lines
Learn MCP auth
Understand OAuth 2.1 for MCP servers
Code samples
Browse complete integration examples
Related products
- Agent Auth: OAuth for AI agents to third-party apps
- Full-stack Auth: Complete authentication platform
For FastMCP users: Use the Scalekit plugin to add authentication in just 5 lines of code. See the MCP servers guide.