$ timeahead.in
/ servers/pypi/fastapi-mcp
pypi

fastapi-mcp

Expose your FastAPI endpoints as Model Context Protocol (MCP) tools, with Auth!

12k stars7.9M/wkupdated 222d agogithub ↗
93excellent
▣ Overview
PyPI versionPython VersionsFastAPICICoverage

What it does

FastAPI-MCP exposes your FastAPI endpoints directly as MCP tools, allowing Claude and other LLM clients to invoke your API as though it were natively MCP-aware. Rather than treating OpenAPI as a source of truth and converting it, the server integrates directly with your FastAPI application via its ASGI interface. This preserves your endpoint schemas, documentation, and response types exactly as defined. Authentication is built in—you secure MCP tools using the same FastAPI dependency system you already use for HTTP endpoints. The server can be mounted to your existing FastAPI application for a unified deployment, or deployed separately with access to your FastAPI backend.

Who it's for

Backend engineers maintaining production FastAPI services who want to expose those services to Claude without building custom integration logic. Teams building LLM applications that need direct, authenticated access to internal FastAPI endpoints. Developers architecting multi-agent systems where FastAPI handles the business logic and Claude needs to call operations programmatically.

Common use cases

  • Expose FastAPI endpoints as MCP tools callable from Claude without middleware or conversion
  • Secure Claude's access to internal API operations using FastAPI's Depends() decorators
  • Mount an MCP server to an existing FastAPI app with minimal configuration overhead
  • Replace HTTP calls between Claude and your API with direct ASGI communication
  • Share a single FastAPI deployment between HTTP clients (web, mobile) and Claude/LLM clients

Setup pitfalls

  • Requires Python 3.10 or higher (3.12 recommended); verify your environment before installation
  • Authentication setup depends on correctly defining FastAPI Depends() functions; misconfigurations will silently expose endpoints
  • Mounting to the same app requires understanding FastAPI's startup/shutdown sequence; separate deployments add complexity
  • Last commit was over 200 days ago; compatibility with recent FastAPI releases should be verified before production use
▣ Score BreakdownMCPScore = Σ(raw × weight)
DimensionRawWeighted
Security
35%
100
35.0
Freshness
25%
100
25.0
Adoption
20%
100
20.0
Quality
10%
80
8.0
Trust
10%
50
5.0
Total
93.0
⚿ Capabilities & Risk Explainer
networksecrets
◆ Risk level: medium
network + secrets — requires access to credentials or environment secrets.
⚙ Install config
Claude Desktop · Cursor · Windsurf · VS Code (Copilot) · Claude Code
add to your MCP client config:
{
  "mcpServers": {
    "fastapi": {
      "command": "uvx",
      "args": [
        "fastapi-mcp"
      ]
    }
  }
}
📈 Score historylast 43 snapshots
5/10/20267/4/2026 · 43 snapshots
⚙ Maintenance health
38/ 100 · is this project alive?
contributors (1y)3
top contributor share87%
releases (1y)3
last release342d ago
ci✓ passing
⛁ Raw data
weekly downloads7.9M
github stars12k
forks952
open issues158
license✓ present
readme length4304 chars
last publish1d ago
last commit222d ago
last updated2d ago
install verified✓ pass · 49d ago
owner of this server? claim your listing to get a verified badgeclaim →
🔔 Score drop alerts
get notified by email when this server's score drops 5+ points