Your @FastAPI app is powerful.
But imagine if you could turn your endpoints into agent-ready tools.
Now you can, with just 3 lines of code via @makhlevich’s FastAPI-MCP! 🤯
It exposes your endpoints as MCP tools, ready for agent use.
Free and open source too (repo in 🧵) ↓
Here’s why it changes the game:
✅ Native to FastAPI → Works with the auth system you already built.
✅ Zero settings → Just plug it in and it’s live.
✅ Saves your existing work → Models, responses, docs: all preserved!
✅ Blazing fast & adaptable → Mount or run standalone with pure ASGI performance.
The code snippet you need:
# pip install fastapi-mcp
from fastapi import FastAPI
from fastapi_mcp import FastApiMCP
app = FastAPI()
mcp = FastApiMCP(app)
mcp.mount()