fastmcp.server.auth.providers.scalekit
Scalekit authentication provider for FastMCP.
This module provides ScalekitProvider - a complete authentication solution that integrates
with Scalekit’s OAuth 2.1 and OpenID Connect services, supporting Resource Server
authentication for seamless MCP client authentication.
Classes
ScalekitProviderSettings
ScalekitProvider
Scalekit resource server provider for OAuth 2.1 authentication.
This provider implements Scalekit integration using resource server pattern.
FastMCP acts as a protected resource server that validates access tokens issued
by Scalekit’s authorization server.
IMPORTANT SETUP REQUIREMENTS:
-
Create an MCP Server in Scalekit Dashboard:
- Go to your Scalekit Dashboard
- Navigate to MCP Servers section
- Register a new MCP Server with appropriate scopes
- Ensure the Resource Identifier matches exactly what you configure as MCP URL
- Note the Resource ID
-
Environment Configuration:
- Set SCALEKIT_ENVIRONMENT_URL (e.g., https://your-env.scalekit.com)
- Set SCALEKIT_CLIENT_ID from your OAuth application
- Set SCALEKIT_RESOURCE_ID from your created resource
- Set MCP_URL to your FastMCP server’s public URL
get_routes
mcp_path
: The path where the MCP endpoint is mounted (e.g., “/mcp”)mcp_endpoint
: The MCP endpoint handler to protect with auth