mcp-auth-fastmcp-scalekit
Installation
SKILL.md
Add OAuth auth to a FastMCP server (Scalekit)
What this skill builds
- A FastMCP server with
stateless_http=Truethat boots an HTTP transport on a configured port. - OAuth protection via
ScalekitProvider— handles token validation, .well-known discovery, and WWW-Authenticate on 401 automatically. - Per-tool scope enforcement using
get_access_token()fromfastmcp.server.dependencies. - Scopes are pre-configured in the Scalekit dashboard; tools check them at runtime.
Key difference from Express skill
- No manual middleware, no manual .well-known route.
- Auth is injected at the
FastMCP(auth=...)constructor. ScalekitProviderusesresource_id(starts withres_) andmcp_url(base URL + trailing slash).- FastMCP appends
/mcpto the base URL automatically — always register the BASE URL with trailing slash in Scalekit, not the /mcp path.