--- id: fastapi-mcp version: "0.4.0" license: MIT License Copyright (c) 2024 Tadata Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal… (full text in the JSON record) license_treatment: permissive maintenance: aging --- # fastapi-mcp — Automatic MCP server generator for FastAPI applications - converts FastAPI endpoints to MCP tools for LLM integration License: permissive · Maintenance: aging · Downloads: 17.5M/mo ## What it is and what it does FastAPI-MCP bridges FastAPI applications and the Model Context Protocol, allowing LLMs like Claude to call your API endpoints as tools. Instead of converting OpenAPI specs to MCP in isolation, it integrates directly with FastAPI's runtime, using the ASGI interface to communicate efficiently and reusing FastAPI's dependency injection for authentication and authorization. The package requires minimal setup—instantiate FastApiMCP with your app and call mount() to expose endpoints as MCP tools at /mcp. It preserves endpoint documentation, request/response schemas, and FastAPI dependencies, so your existing security and validation logic applies to MCP calls without duplication. You can mount the server on the same app or deploy separately. Use it for: - Enable Claude or other LLMs to invoke your FastAPI endpoints as tools without writing separate MCP server code. - Add LLM-native tool access to existing FastAPI services while reusing authentication and validation logic. - Prototype AI agent integrations by exposing internal APIs as MCP tools with zero additional configuration. - Preserve OpenAPI documentation and schemas when exposing endpoints to LLMs, ensuring consistency across interfaces. - Deploy an MCP server alongside or separately from your FastAPI app for flexible AI orchestration architectures. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Automatically exposes FastAPI endpoints as Model Context Protocol (MCP) tools for LLM integration, with built-in authentication support using FastAPI's dependency system. Yes, if you have a FastAPI application and want to expose endpoints to LLMs. The low install friction, permissive license, and native FastAPI integration make it straightforward to add. However, note the aging maintenance status (last release 382 days ago)—evaluate whether the current feature set and stability meet your timeline, and monitor the repository for updates before committing to production use. ## Install pip install fastapi-mcp uv add fastapi-mcp poetry add fastapi-mcp ## Installing fastapi-mcp Before you install: Low friction installation with a pure-Python wheel. The package depends on 10 runtime libraries including fastapi, uvicorn, and pydantic, all widely-used and stable. Maintenance status is aging—last release was 382 days ago, though the repository remains active with recent commits and substantial community interest (11983 stars). License in practice: MIT License permits unrestricted use, modification, and distribution with minimal obligations—suitable for both commercial and open-source projects. No copyleft or attribution requirements beyond preserving the license notice. Quickstart: pip install fastapi-mcp from fastapi import FastAPI from fastapi_mcp import FastApiMCP app = FastAPI() mcp = FastApiMCP(app) mcp.mount() # MCP server now available at /mcp Requires Python 3.10 or later (3.12 recommended). FastAPI application must already exist to wrap. Verify before relying: - Whether the ASGI transport optimization provides measurable latency benefits over HTTP in typical deployments. - How schema preservation handles complex Pydantic v2 features and custom validators. - Whether separate deployment mode (mentioned in docs) is production-ready given the aging maintenance status. ## Package facts - License: MIT License Copyright (c) 2024 Tadata Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal… (full text in the JSON record) (permissive) - Python support: supports_current - Install friction: low - Maintenance: aging - Downloads: 17.5M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags fastapi to mcp server, expose fastapi endpoints as mcp tools, llm integration fastapi, model context protocol fastapi, fastapi mcp server generator, claude api fastapi integration, openapi to mcp converter, llm-integration, mcp-server, api-bridge [View on SkillFed](https://skillfed.io/packages/fastapi-mcp) · [View on PyPI](https://pypi.org/project/fastapi-mcp/)