Favicon of FastAPI MCP

FastAPI MCP

A Python library turns FastAPI endpoints into MCP tools, reuses existing authentication, and supports self-hosted deployment.

Screenshot of FastAPI MCP website

FastAPI MCP is a Python library for developers who want AI applications to use an existing FastAPI service through the Model Context Protocol (MCP). It creates tools from API endpoints, so developers don't have to build a separate MCP interface for each one.

  • Endpoint tools: Makes your FastAPI endpoints available as tools that MCP clients can call.
  • Authentication and authorization: Reuses FastAPI dependencies to apply access controls to MCP endpoints, including your existing authentication logic.
  • Schemas and documentation: Retains request and response model schemas along with endpoint descriptions, carrying the API's definitions into its MCP tools.
  • Deployment choices: Runs the MCP server within your FastAPI application or as a separate deployment, depending on how you want to host the service.

The library is open source under the MIT license and supports self-hosting. Its direct connection to the FastAPI application uses ASGI, so communication between the MCP layer and the API doesn't require separate HTTP calls. It requires Python 3.10 or later. Tadata also offers a managed hosted alternative at tadata.com.

Similar to FastAPI MCP