← Back to directory
F

FastAPI-MCP

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

This is a framework for building MCP servers or agents, not a server you connect a client to.

Category
Dev Tools #280 of 438
Stars
★ 12.0k Popular
Transport
Streamable HTTP
Runtime
Python 3.10+
Credentials
No credential needed
License
MIT
Last commit
⚠
48FMRS · D

FastAPI-MCP is a well-established library for converting FastAPI endpoints into MCP tools with authentication support. It takes a FastAPI-native approach, making it especially useful for existing FastAPI users. Documentation and examples are comprehensive, and the community is active with an MIT license. It is not suitable for non-FastAPI projects, and careful attention should be paid to securing sensitive endpoints.

Strongest · Setup experience 12/20 Weakest · Reliability 6/20

Reliability
6/20
Security and permissions
10/20
Maintenance
10/20
Documentation
10/20
Setup experience
12/20
Why each score
Reliability 6/20
Based only on the README: it shows a minimal FastApiMCP(app) and mount() usage, claiming automatic MCP tool generation over ASGI transport. However, no source code, tests, or CI execution evidence was supplied, so the init handshake, tool list, and real behavior cannot be verified; edge cases and error handling are undocumented. Per static review rules, missing execution evidence lowers the score.
Security and permissions 10/20
No malware, credential theft, covert exfiltration, or destructive defaults are visible, so no red line is triggered. The README clearly states authentication uses existing FastAPI dependencies, which is positive. However, by default all endpoints are exposed as MCP tools; there is no mention of tool-level allow/deny least privilege, confirmation for dangerous operations, or data-flow disclosure, and credential storage/transport details are absent. Hence 10.
Maintenance 10/20
The repository has an MIT license, is not archived, and shows copyright by Tadata Inc.; the README includes CI/coverage badges, but badges are untrusted evidence. No commit frequency, release cadence, dependency updates, or security-response channel is provided; the 164 open issues are metadata and do not add points. Ownership and license are clear, so 10, but lack of governance/update-path evidence prevents a higher score.
Documentation 10/20
The README provides installation, basic usage, feature highlights, and links to a docs site and examples directory, suggesting layered documentation. However, it lacks authentication configuration details, tool parameter reference, limitations/cost, and troubleshooting; the external docs link is not verifiable in this review. It is usable but with hidden assumptions and troubleshooting gaps, so 10.
Setup experience 12/20
Installation is clear: `uv add fastapi-mcp` or `pip install`, then a three-line mount to /mcp. However, no connection configuration examples for mainstream clients (Claude/Cursor/Windsurf) are supplied, and platform compatibility is not documented; there is no real CI/test evidence in the README, so per static calibration the score stays below 15 and is set at 12.

Static review · not runListed 2026-08-07

Read the FMRS scoring method →

Fit and risk

What it can accessUses the network

Best for

  • Developers with existing FastAPI applications who want to add MCP support with minimal configuration.
  • Teams that require secure MCP endpoints and want to use existing FastAPI dependencies for authentication and authorization.
  • Use cases where you want to deploy the MCP server together with your FastAPI app or as a standalone service.

Not for

  • Developers not already using FastAPI—this server is designed for FastAPI apps.
  • Clients that require stdio transport—FastAPI-MCP uses ASGI/HTTP transport.
  • Users who need full control over MCP tool definitions without relying on automatic generation from endpoints.

Required permissions

  • Requires access to your FastAPI application instance.
  • May require network access to the MCP endpoints (e.g., via HTTP).
  • Authentication and authorization use existing dependencies in your FastAPI app.

Risks and side effects

  • Exposed MCP endpoints could be an entry for unauthorized access if authentication is not configured properly.
  • Auto-generated tools might expose sensitive endpoints—ensure proper authentication and authorization are set up.
  • Dependency on FastAPI and Python version compatibility—requires Python 3.10+.

Setup

Before you start

Runtime:Python 3.10+

Install FastAPI-MCP using uv or pip:

uv add fastapi-mcp

or

pip install fastapi-mcp

Check that it works

After installing fastapi-mcp and running FastApiMCP(app).mount() on your FastAPI app, connect an MCP client to https://app.base.url/mcp; the auto-generated tools from your FastAPI endpoints should appear in the client's tool list.

Troubleshooting

  1. Ensure you are using Python 3.10 or higher.
  2. Verify that your FastAPI app is initialized correctly and the MCP server is mounted.
  3. Check that authentication dependencies are working as expected to avoid permission errors.
  4. Consult the documentation and examples for advanced configuration and deployment options.

Things to try

Once connected, you can ask your AI assistant things like:

  • List all my FastAPI endpoints exposed as MCP tools
  • Call one of the GET endpoints in my API and return the result
  • Describe the request and response models of an endpoint exposed by this FastAPI MCP server

Use cases

Expose existing FastAPI services as MCP tools for AI clients like Claude, Cursor, or Windsurf.
Provide protected API endpoint access to AI agents, leveraging existing FastAPI authentication mechanisms.
Quickly integrate MCP capabilities into a FastAPI service without rewriting the API code.

Overview

FastAPI-MCP is a library designed to turn an existing FastAPI application into a Model Context Protocol (MCP) server. It is not just an OpenAPI-to-MCP converter; it is a native extension of FastAPI, allowing you to mount an MCP server directly onto your FastAPI app. It features built-in authentication using your existing FastAPI dependencies, preserves schemas of request and response models, preserves documentation of all endpoints as in Swagger, and supports flexible deployment—you can mount the MCP server to the same app or deploy separately. It uses ASGI transport to communicate directly with the FastAPI app, eliminating the need for HTTP calls from the MCP to your API.

Similar servers

Context7 80 · B

Upstash's official server providing up-to-date third-party library docs for AI coding assistants

★ 62.9k · Tools 2 Compare with this →

Source revision e5cad13cabfc Data synced 2026-10-12 Read the FMRS scoring method