New in version: 2.12.5
Install auth stack to your FastMCP server with Scalekit using the Remote OAuth pattern: Scalekit handles user authentication, and the MCP server validates issued tokens.
Configuration
Prerequisites
Before you begin- Get a Scalekit account and grab API credentials such as Client ID, Client Secret and Environment URL from Dashboard > Developers > Settings.
- Have your FastMCP server’s endpoint ready (can be localhost for development, e.g.,
http://localhost:8000/mcp
)
Step 1: Configure MCP server in Scalekit environment
1
Register MCP server and set environment
In your Scalekit dashboard:
- Open the MCP Servers section, then select Create new server
- Enter server details: a name, a resource identifier, and the desired MCP client authentication settings
- Save, then copy the Resource ID (for example, res_92015146095)
.env
:Step 2: Add auth to FastMCP server
Create your FastMCP server file and use the ScalekitProvider to handle all the OAuth integration automatically:server.py
Testing
Start the MCP server
Provider selection
Setting this environment variable allows the Scalekit provider to be used automatically without explicitly instantiating it in code.Set to
fastmcp.server.auth.providers.scalekit.ScalekitProvider
to use Scalekit authentication.Scalekit-specific configuration
These environment variables provide default values for the Scalekit provider, whether it’s instantiated manually or configured viaFASTMCP_SERVER_AUTH
.
Your Scalekit environment URL from the Admin Portal (e.g.,
https://your-env.scalekit.com
)Your Scalekit OAuth application client ID from the Applications section
Your Scalekit resource server ID from the Resources section
Public URL of your FastMCP server (e.g.,
https://your-server.com
or http://localhost:8000/mcp
for development).env
:
server.py