FastAPI MCP

Stale
GitHub Python MIT

Description

Library to expose FastAPI endpoints as Model Context Protocol tools with authentication support, enabling AI agents to call existing APIs directly

Key Features

  • Native FastAPI extension — not just an OpenAPI-to-MCP converter
  • Authentication built in using existing FastAPI Depends() dependencies
  • Zero/minimal configuration — point at your FastAPI app and it works
  • Preserves request/response schemas and endpoint documentation from Swagger
  • ASGI transport for efficient direct communication without HTTP overhead
  • Flexible deployment — mount to same app or deploy as separate MCP server

Use Cases

💡 Exposing existing FastAPI microservices as MCP tools for AI agents
💡 Adding AI-callable interfaces to authenticated internal APIs
💡 Building MCP-compatible APIs without rewriting from scratch
💡 Enabling Claude or other AI assistants to invoke your REST endpoints
💡 Rapid prototyping of AI-connected backends with existing OpenAPI specs

Strengths & Limitations

Strengths

  • High community interest (12.0k stars)
  • Permissive open-source license (MIT)

⚠️ Limitations

  • No updates in over 8 months

Quick Start

uv add fastapi-mcp (or pip install fastapi-mcp). In your FastAPI app: from fastapi import FastAPI; from fastapi_mcp import FastApiMCP; app = FastAPI(); mcp = FastApiMCP(app); mcp.mount(). Your MCP server is available at /mcp

Related Projects

Awesome LLM Skills

1.5k · Python
Normal C

A curated list of awesome LLM and AI Agent Skills, resources and tools for customising AI Agent workflows. Works with Claude Code, Codex, Gemini CLI and custom agents.

agenttoolsmcp +2
  • · Curated collection of LLM skills for Claude Code, Codex, Gemini CLI, and more
  • · Covers document processing (docx, pdf, pptx, xlsx), development tools, and research workflows
  • · Cross-platform compatibility with Anthropic, OpenAI, Google, and Alibaba AI tools

Excel MCP Server

4.1k · Python
Stale B

Model Context Protocol server for Excel file manipulation, enabling AI agents to read, create and modify spreadsheets

mcpexcelspreadsheet +2
  • · Create, read, update, and manage Excel workbooks and worksheets without Microsoft Excel installed
  • · Full data manipulation: formulas, formatting, charts, pivot tables, and Excel table operations
  • · Data validation for ranges, formulas, and data integrity with conditional formatting support

Continuous Claude

3.9k · Python
Stale C

Context management for Claude Code with hooks for state maintenance via ledgers and handoffs. Enables MCP execution without context pollution and agent orchestration with isolated context windows for long-running conversations.

mcpagentpython +3
  • · Persistent learning system with YAML handoffs that preserve context across sessions, solving Claude Code's compaction problem
  • · 109 natural-language-triggered skills with automatic activation via rule-based context injection hooks
  • · 32 specialized agents including scout (exploration), oracle (research), debug-agent, and kraken for parallelized task execution