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

fastapi-mcp

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

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

What it does

FastAPI-MCP is a Python library that exposes your FastAPI endpoints as Model Context Protocol tools, enabling Claude to call them directly. Unlike tools that convert OpenAPI specs to MCP, this integrates natively with FastAPI using ASGI transport—no separate HTTP layer between MCP and your API. You add it to your existing FastAPI application (or deploy separately), and endpoints instantly become MCP tools while preserving their documentation and request/response schemas. Authentication is handled through FastAPI's dependency injection, so you secure MCP access using the same Depends() patterns as your web API.

Who it's for

Backend engineers and platform teams running FastAPI microservices who want to give Claude direct, authenticated access to internal APIs. Use this when you need Claude to query, update, or monitor data behind your FastAPI service.

Common use cases

  • Expose a FastAPI microservice as MCP tools so Claude can query or modify backend data
  • Add MCP capabilities to an existing FastAPI application without external infrastructure or manual OpenAPI conversion
  • Secure Claude's access to FastAPI endpoints using your existing authentication logic
  • Build Claude-integrated admin panels or monitoring dashboards on top of FastAPI services

Setup pitfalls

  • This is a library for wrapping an existing FastAPI app, not a standalone MCP server—you need a functioning FastAPI application to integrate it with
  • If deploying the MCP server separately from your original FastAPI app, ensure the ASGI interface and any shared dependencies are properly configured across both instances
  • Authentication relies on FastAPI Depends(); misconfigured dependency logic will silently allow or deny MCP access incorrectly
  • Requires Python 3.10 or higher
▣ 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 30 snapshots
5/10/20266/11/2026 · 30 snapshots
⚙ Maintenance health
43/ 100 · is this project alive?
contributors (1y)8
top contributor share72%
releases (1y)3
last release318d ago
ci✓ passing
⛁ Raw data
weekly downloads3.9M
github stars12k
forks951
open issues155
license✓ present
readme length4304 chars
last publish0d ago
last commit199d ago
last updated1d ago
install verified✓ pass · 25d 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