fastapi_mcp
FastAPI-MCP is a development library that exposes FastAPI endpoints as Model Context Protocol (MCP) tools, with built-in authentication based on FastAPI dependencies. It is implemented in a FastAPI-native way, rather than being a simple OpenAPI-to-MCP converter. With minimal configuration, it can point to a FastAPI application and run, while preserving the schemas of request models and response models as well as the Swagger documentation for all endpoints. The library supports flexible deployment: the MCP server can be mounted on the same application or deployed separately, and it uses ASGI transport to communicate efficiently directly through FastAPI's ASGI interface. Installation is recommended with uv, and pip can also be used.