local_fire_departmentHoneystax
search⌘K
loginLog Inperson_addSign Up
layers
HONEYSTAX TERMINAL v1.0
HomeNewsSavedSubmit
Back to the live board
F

fastapi_mcp

MCP Server

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

Copy the install, test the workflow, then decide if it earns a permanent slot.

11,833
Why nowLower urgency

The signal is softer here. Treat it like a pattern source unless it solves a very specific gap.

DecisionHigh-conviction move

Copy the install, test the workflow, then decide if it earns a permanent slot.

Trial costFast eval

You can test this quickly and remove it cleanly if it misses.

Risk53/100

GitHub health 62/100. no security policy. 148 open issues make this testable, but not something to trust blind.

What You Are Adopting

AI Agent

Universal

Model

Multiple

Build Time

Hours

Test This In Your Stack

One command inClean rollbackLow commitment
settingsRegistryAdds a named entry to Claude config. One command to remove.

Fastest way to find out if fastapi_mcp belongs in your setup.

Copy the install command, run a real test, and back it out cleanly if it slows you down.

Try now
claude mcp add fastapi-mcp -- npx fastapi-mcp

Run this first. You will know quickly if the workflow earns a permanent slot.

Back out
claude mcp remove fastapi-mcp

No messy cleanup loop. If it misses, remove it and keep moving.

Install Location

~/  └─ .claude.json    └─ mcp_servers/      └─ fastapi-mcp ← registers here

About

Expose your FastAPI endpoints as Model Context Protocol (MCP) tools, with Auth!. An open-source mcp server for the AI coding ecosystem.

README

fastapi-to-mcp

Built by Tadata

FastAPI-MCP

tadata-org%2Ffastapi_mcp | Trendshift

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

PyPI version Python Versions FastAPI CI Coverage

fastapi-mcp-usage

Features

  • Authentication built in, using your existing FastAPI dependencies!

  • FastAPI-native: Not just another OpenAPI -> MCP converter

  • Zero/Minimal configuration required - just point it at your FastAPI app and it works

  • Preserving schemas of your request models and response models

  • Preserve documentation of all your endpoints, just as it is in Swagger

  • Flexible deployment - Mount your MCP server to the same app, or deploy separately

  • ASGI transport - Uses FastAPI's ASGI interface directly for efficient communication

Hosted Solution

If you prefer a managed hosted solution check out tadata.com.

Installation

We recommend using uv, a fast Python package installer:

uv add fastapi-mcp

Alternatively, you can install with pip:

pip install fastapi-mcp

Basic Usage

The simplest way to use FastAPI-MCP is to add an MCP server directly to your FastAPI application:

from fastapi import FastAPI
from fastapi_mcp import FastApiMCP

app = FastAPI()

mcp = FastApiMCP(app)

# Mount the MCP server directly to your FastAPI app
mcp.mount()

That's it! Your auto-generated MCP server is now available at https://app.base.url/mcp.

Documentation, Examples and Advanced Usage

FastAPI-MCP provides comprehensive documentation. Additionaly, check out the examples directory for code samples demonstrating these features in action.

FastAPI-first Approach

FastAPI-MCP is designed as a native extension of FastAPI, not just a converter that generates MCP tools from your API. This approach offers several key advantages:

  • Native dependencies: Secure your MCP endpoints using familiar FastAPI Depends() for authentication and authorization

  • ASGI transport: Communicates directly with your FastAPI app using its ASGI interface, eliminating the need for HTTP calls from the MCP to your API

  • Unified infrastructure: Your FastAPI app doesn't need to run separately from the MCP server (though separate deployment is also supported)

This design philosophy ensures minimum friction when adding MCP capabilities to your existing FastAPI services.

Development and Contributing

Thank you for considering contributing to FastAPI-MCP! We encourage the community to post Issues and create Pull Requests.

Before you get started, please see our Contribution Guide.

Community

Join MCParty Slack community to connect with other MCP enthusiasts, ask questions, and share your experiences with FastAPI-MCP.

Requirements

  • Python 3.10+ (Recommended 3.12)
  • uv

License

MIT License. Copyright (c) 2025 Tadata Inc.

Tech Stack

FastAPIPythonGo
Open Live ProjectAudit Repo

Reviews0

Log in to write a review.

AgingLast commit 5mo ago
bug_report148open issues
Submitted March 8, 2025

auto_awesomeYour strongest next moves after fastapi_mcp