mcp-auth-fastapi-fastmcp-scalekit

Authenticate FastAPI applications with Scalekit OAuth and FastMCP middleware.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Enables secure, scalable OAuth authentication for FastAPI applications by integrating Scalekit with FastMCP tooling, simplifying secure access control and token validation across existing apps.

Core Features & Use Cases

  • Implements a public discovery endpoint at /.well-known/oauth-protected-resource.
  • Provides an HTTP middleware gateway in FastAPI to validate Bearer tokens via Scalekit and mounts FastMCP under /.
  • Facilitates adding MCP-enabled tooling to existing FastAPI apps, including custom routes and middleware.

Quick Start

Launch the FastAPI + FastMCP setup with the required environment variables (SK_ENV_URL, SK_CLIENT_ID, SK_CLIENT_SECRET, EXPECTED_AUDIENCE, PROTECTED_RESOURCE_METADATA) and mount MCP at the root.

Frequently Asked Questions about mcp-auth-fastapi-fastmcp-scalekit

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

FAQPage Schema
How do I add OAuth authentication to a FastAPI and FastMCP application?

To add OAuth authentication to a FastAPI and FastMCP application, use this Skill to implement an HTTP middleware gateway that validates Bearer tokens via Scalekit and mounts FastMCP tooling securely under the root path.

What environment variables are required to validate Bearer tokens with Scalekit in FastAPI?

Validating Bearer tokens with Scalekit in FastAPI requires the environment variables SK_ENV_URL, SK_CLIENT_ID, SK_CLIENT_SECRET, EXPECTED_AUDIENCE, and PROTECTED_RESOURCE_METADATA to configure the authentication middleware.

Does this OAuth middleware expose a public discovery endpoint for protected resources?

Yes, the OAuth middleware exposes a public discovery endpoint at /.well-known/oauth-protected-resource to facilitate secure access control and Scalekit token validation across existing FastAPI apps.

Can I integrate MCP tooling into existing FastAPI apps with custom routes and middleware?

Yes, you can integrate MCP tooling into existing FastAPI apps by mounting FastMCP under the root path, enabling the addition of custom routes and middleware alongside the Scalekit OAuth validation gateway.

Why do I need Scalekit to handle token validation for FastAPI projects?

You need Scalekit to handle token validation for FastAPI projects because it provides a secure, scalable OAuth authentication mechanism via a dedicated HTTP middleware gateway, simplifying access control across new and existing deployments.