mcp-auth-fastmcp-scalekit

Protect FastMCP tools with OAuth 2.1 tokens and per-tool scopes.

1|Updated Feb 19, 2026
One-click install
npx skills add https://github.com/scalekit-inc/cursor-authstack --skill mcp-auth-fastmcp-scalekit
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mcp-auth-fastmcp-scalekit
Source: https://github.com/scalekit-inc/cursor-authstack/tree/main/plugins/mcp-auth/skills/mcp-auth-fastmcp-scalekit
Command: npx skills add https://github.com/scalekit-inc/cursor-authstack --skill mcp-auth-fastmcp-scalekit

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes assets (resource) and references (resource) components.

What problem does it solve?

The skill enables adding scalable OAuth 2.1 authentication to FastMCP servers, protecting tools and resources from unauthorized access by enforcing per-tool scopes via ScalekitProvider.

Core Features & Use Cases

  • Integrates Scalek OAuth with FastMCP to automatically serve discovery endpoints and validate tokens.
  • Enforces per-tool scopes inside each tool to prevent unauthorized actions across MCP endpoints.
  • Supports both new server scaffolds and retrofitting existing servers for quick secure deployments.

Quick Start

Use assets/server-minimal.py as a base to scaffold a new FastMCP server with ScalekitProvider authentication.

Frequently Asked Questions about mcp-auth-fastmcp-scalekit

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add OAuth 2.1 authentication to a FastMCP server in Python?

To add OAuth 2.1 authentication to a FastMCP server, integrate ScalekitProvider to validate access tokens and enforce per-tool scopes. This secures new or existing Python MCP servers by serving discovery endpoints and checking permissions for each tool call.

Can I secure individual tools with specific scopes in FastMCP?

Yes, you can secure individual tools in FastMCP by applying per-tool scope checks. The ScalekitProvider integration uses stateless_http and get_access_token to validate OAuth scopes, preventing unauthorized actions across specific MCP endpoints.

Does this OAuth integration support existing FastMCP servers or only new projects?

This OAuth integration supports both new server scaffolds and existing FastMCP servers. You can retrofit current Python deployments by adding ScalekitProvider to enforce authenticated MCP access without rebuilding your tool architecture.

What is the best way to scaffold a secure FastMCP server with Scalekit OAuth?

The best way to scaffold a secure FastMCP server is using assets/server-minimal.py as a base template. This provides a starting point with ScalekitProvider authentication already configured to validate OAuth 2.1 tokens and protect MCP resources.

Why do I need per-tool scopes for authenticated MCP access?

Per-tool scopes are needed for authenticated MCP access to prevent unauthorized actions across endpoints. By validating specific OAuth scopes inside each tool, ScalekitProvider ensures users only execute actions they are explicitly authorized to perform.