drio
Open app

FastAPI-MCP

Source

Expose your FastAPI endpoints as Model Context Protocol (MCP) tools, with Auth!

Catalog onlyCatalog onlySTDIO

Overview

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.

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.

  • 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.
  1. Quickly expose existing FastAPI APIs as MCP tools for easy access.
  2. Integrate with various MCP clients like Claude for enhanced functionality.
  3. Facilitate the development of AI applications that require seamless API interactions.

Add to your AI client

Use these steps to connect FastAPI-MCP in Cursor, Claude, VS Code, and other MCP-compatible apps. The same JSON appears in the Use with menu above for one-click copy.

Cursor

Add this to your .cursor/mcp.json file in your project root, then restart Cursor.

.cursor/mcp.json

{
  "mcpServers": {
    "fastapi-mcp-tadata-org": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-fastapi-mcp-tadata-org"
      ]
    }
  }
}

Claude Desktop

Add this server entry to the mcpServers object in your Claude Desktop config, then restart the app.

~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)

{
  "mcpServers": {
    "fastapi-mcp-tadata-org": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-fastapi-mcp-tadata-org"
      ]
    }
  }
}

Claude Code

Add this to your project's .mcp.json file. Claude Code will detect it automatically.

.mcp.json (project root)

{
  "mcpServers": {
    "fastapi-mcp-tadata-org": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-fastapi-mcp-tadata-org"
      ]
    }
  }
}

VS Code (Copilot)

Add this to your .vscode/mcp.json file. Requires the GitHub Copilot extension with MCP support enabled.

.vscode/mcp.json

{
  "servers": {
    "fastapi-mcp-tadata-org": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-fastapi-mcp-tadata-org"
      ]
    }
  }
}

Windsurf

Add this to your Windsurf MCP config file, then restart Windsurf.

~/.codeium/windsurf/mcp_config.json

{
  "mcpServers": {
    "fastapi-mcp-tadata-org": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-fastapi-mcp-tadata-org"
      ]
    }
  }
}

Cline

Open Cline settings, navigate to MCP Servers, and add this server configuration.

Cline MCP Settings (via UI)

{
  "mcpServers": {
    "fastapi-mcp-tadata-org": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-fastapi-mcp-tadata-org"
      ]
    }
  }
}

FAQ

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 `uv` package for installation.