Expose FastAPI routes as MCP tools with FastAPI-MCP

Mount FastAPI-MCP on an existing FastAPI app so agents can call authenticated route-backed MCP tools with preserved schemas.

agentskillexchange Updated 28 repo stars

File contents

Expose FastAPI routes as MCP tools with FastAPI-MCP

Mount FastAPI-MCP on an existing FastAPI app so agents can call authenticated route-backed MCP tools with preserved schemas.

Prerequisites

Python 3.10+, FastAPI application, fastapi-mcp package, MCP-capable client

Installation

Install with uv, as recommended upstream:

  • uv add fastapi-mcp

Alternatively, install with pip:

  • pip install fastapi-mcp

After mounting FastAPI-MCP in your app, the generated MCP server is available at your app base URL plus /mcp.

Documentation

Source

agentskillexchange/skills/tree/main/skills/expose-fastapi-routes-as-mcp-tools-with-fastapi-mcp commit b2efb4f7bd

Frequently asked questions

npx skillmds@latest add agentskillexchange/expose-fastapi-routes-as-mcp-tools-with-fastapi-mcp