Welcome to FastAPI-MCP!
Expose your FastAPI endpoints as Model Context Protocol (MCP) tools, with Auth!
MCP (Model Context Protocol) is the emerging standard to define how AI agents communicate with applications. Using FastAPI-MCP, creating a secured MCP server to your application takes only 3 lines of code:
That’s it! Your auto-generated MCP server is now available at https://app.base.url/mcp
Features
-
Authentication built in, using your existing FastAPI dependencies!
-
FastAPI-native: Not just another OpenAPI -> MCP converter
-
Zero 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