fastapi-mcp
Automatic MCP server generator for FastAPI applications - converts FastAPI endpoints to MCP tools for LLM integration
Decision gist · record as of 2026-08-14
Yes, if you have a FastAPI application and want to expose endpoints to LLMs. The low install friction, permissive license, and native FastAPI integration make it straightforward to add. However, note the aging maintenance status (last release 382 days ago)—evaluate whether the current feature set and stability meet your timeline, and monitor the repository for updates before committing to production use.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later (3.12 recommended).
- FastAPI application must already exist to wrap.
- Low friction installation with a pure-Python wheel.
License · maintenance · safety
permissive license (permissive) — MIT License permits unrestricted use, modification, and distribution with minimal obligations—suitable for both commercial and open-source projects. No copyleft or attribution requirements beyond preserving the license notice.
last release 2025-07-28 (382 days) · last repo commit 2025-11-24 · 11,983 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 17,508,920 downloads/mo, #1,114 on PyPI
Alternatives
Verify before relying
pip install fastapi-mcp
from fastapi import FastAPI
from fastapi_mcp import FastApiMCP
app = FastAPI()
mcp = FastApiMCP(app)
mcp.mount()
# MCP server now available at /mcp- Whether the ASGI transport optimization provides measurable latency benefits over HTTP in typical deployments.
- How schema preservation handles complex Pydantic v2 features and custom validators.
- Whether separate deployment mode (mentioned in docs) is production-ready given the aging maintenance status.
What it is and what it does
FastAPI-MCP bridges FastAPI applications and the Model Context Protocol, allowing LLMs like Claude to call your API endpoints as tools. Instead of converting OpenAPI specs to MCP in isolation, it integrates directly with FastAPI's runtime, using the ASGI interface to communicate efficiently and reusing FastAPI's dependency injection for authentication and authorization.
The package requires minimal setup—instantiate FastApiMCP with your app and call mount() to expose endpoints as MCP tools at /mcp. It preserves endpoint documentation, request/response schemas, and FastAPI dependencies, so your existing security and validation logic applies to MCP calls without duplication. You can mount the server on the same app or deploy separately.
Use it for
- Enable Claude or other LLMs to invoke your FastAPI endpoints as tools without writing separate MCP server code.
- Add LLM-native tool access to existing FastAPI services while reusing authentication and validation logic.
- Prototype AI agent integrations by exposing internal APIs as MCP tools with zero additional configuration.
- Preserve OpenAPI documentation and schemas when exposing endpoints to LLMs, ensuring consistency across interfaces.
- Deploy an MCP server alongside or separately from your FastAPI app for flexible AI orchestration architectures.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you have a FastAPI application and want to expose endpoints to LLMs.
The low install friction, permissive license, and native FastAPI integration make it straightforward to add. However, note the aging maintenance status (last release 382 days ago)—evaluate whether the current feature set and stability meet your timeline, and monitor the repository for updates before committing to production use.
Install
fastapi-mcp on PyPI
Before you install
Low friction installation with a pure-Python wheel. The package depends on 10 runtime libraries including fastapi, uvicorn, and pydantic, all widely-used and stable. Maintenance status is aging—last release was 382 days ago, though the repository remains active with recent commits and substantial community interest (11983 stars).
Requires Python 3.10 or later (3.12 recommended). FastAPI application must already exist to wrap.
License in practice
MIT License permits unrestricted use, modification, and distribution with minimal obligations—suitable for both commercial and open-source projects. No copyleft or attribution requirements beyond preserving the license notice.
Quickstart
pip install fastapi-mcp
from fastapi import FastAPI
from fastapi_mcp import FastApiMCP
app = FastAPI()
mcp = FastApiMCP(app)
mcp.mount()
# MCP server now available at /mcp
Verify before relying
- Whether the ASGI transport optimization provides measurable latency benefits over HTTP in typical deployments.
- How schema preservation handles complex Pydantic v2 features and custom validators.
- Whether separate deployment mode (mentioned in docs) is production-ready given the aging maintenance status.
Package facts
| License | permissive license permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 10 packagesfastapihttpxmcppydantic-settingspydanticrequestsrichtomlityperuvicorn |
| Maintenance | Aging 382 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 17,508,920 / month, #1,114 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 3 - AlphaFramework :: FastAPIIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Topic :: Internet :: WWW/HTTPTopic :: Software Development :: Libraries :: Python Modules |
Evidence: fastapi_mcp-0.4.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “fastapi to mcp server”
- fastapi-mcpAutomatically exposes FastAPI endpoints as Model Context Protocol…
- arcade-serveArcade Serve provides FastAPI and Model Context Protocol server…
- arcade-mcp-serverArcade MCP Server provides a FastAPI-like framework for building…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also mcp · mcpo · arcade-serve · mcp-server-git · mcp-types · wikipedia-mcp · django-mcp-server · cli-mcp-server · scalar-fastapi · astro-airflow-mcp