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

fastapi-mcp

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

12k stars4.4M/wkupdated 193d agogithub ↗
93excellent
▣ Overview
PyPI versionPython VersionsFastAPICICoverage

What it does

FastAPI-MCP automatically exposes your FastAPI endpoints as Model Context Protocol tools, enabling Claude and other AI models to call your API methods directly. Rather than converting OpenAPI specs generically, it operates as a native FastAPI extension using the ASGI interface for direct communication with your app. The server preserves your existing endpoint schemas, request/response models, and Swagger documentation while adding zero-copy MCP compatibility.

Who it's for

Backend engineers building AI-powered workflows that need Claude to interact with internal APIs. Teams operating FastAPI-based platforms where traditional HTTP integrations are too indirect or inefficient. API developers who want their services accessible to AI agents without writing separate integration layers or maintaining multiple API formats.

Common use cases

  • Enable Claude to query and mutate data in FastAPI database services as part of agentic workflows.
  • Expose internal business logic endpoints (calculations, validations, transformations) as MCP tools for AI reasoning.
  • Build AI agents deployed alongside FastAPI microservices with low-latency, in-process API access.
  • Integrate Claude into FastAPI-backed SaaS platforms so customers' AI workflows can call backend functionality.

Setup pitfalls

  • Python 3.10+ required (3.12+ recommended); uv is the recommended package manager, though standard pip install works.
  • ASGI transport assumes direct in-process communication; separate deployments require proper network connectivity and may introduce latency compared to the default in-process setup.
  • Authentication flows through FastAPI's Depends() system — misconfigured auth decorators will block MCP access to endpoints, so test your auth dependencies with the MCP interface.
  • Last commit was 193 days ago; while stable and well-maintained, verify that your FastAPI version aligns with the server's dependencies before updating.
▣ 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 27 snapshots
5/10/20266/6/2026 · 27 snapshots
⚙ Maintenance health
45/ 100 · is this project alive?
contributors (1y)8
top contributor share65%
releases (1y)3
last release312d ago
ci✓ passing
⛁ Raw data
weekly downloads4.4M
github stars12k
forks947
open issues156
license✓ present
readme length4304 chars
last publish0d ago
last commit193d ago
last updated6h ago
install verified✓ pass · 18d 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