Expose your FastAPI endpoints as Model Context Protocol (MCP) tools, with Auth!
Overview
What is FastAPI-MCP?
FastAPI-MCP is a zero-configuration tool designed to automatically expose FastAPI endpoints as Model Context Protocol (MCP) tools, simplifying the integration of FastAPI applications with MCP clients.
How to use FastAPI-MCP?
To use FastAPI-MCP, simply mount the MCP server to your FastAPI application by calling the add_mcp_server function with your FastAPI app instance and desired mount path.
Key features of FastAPI-MCP?
- Direct integration with FastAPI applications.
- Zero configuration required for setup.
- Automatic discovery of FastAPI endpoints and conversion to MCP tools.
- Preservation of request and response schemas.
- Maintains documentation as seen in Swagger.
- Ability to extend with custom MCP tools.
Use cases of FastAPI-MCP?
- Quickly expose existing FastAPI APIs as MCP tools for easy access.
- Integrate with various MCP clients like Claude for enhanced functionality.
- Facilitate the development of AI applications that require seamless API interactions.
FAQ from FastAPI-MCP?
- Is FastAPI-MCP easy to set up?
Yes! It requires zero configuration; just point it at your FastAPI app.
- Can I add custom tools to my MCP server?
Yes! You can extend the MCP server with custom tools alongside the auto-generated ones.
- What are the requirements for using FastAPI-MCP?
You need Python 3.10+ and the
uvpackage for installation.