# FastAPI-MCP > A Python library that automatically exposes FastAPI endpoints as Model Context Protocol (MCP) tools for AI integration. FastAPI-MCP is an open-source Python library that bridges FastAPI applications with the Model Context Protocol (MCP), enabling seamless integration between existing REST APIs and AI assistants. It automatically converts FastAPI endpoints into MCP-compatible tools, allowing AI models to interact with your API without requiring manual tool definitions or significant code changes. The library simplifies the process of making web services accessible to AI systems by leveraging FastAPI's existing OpenAPI schema to generate MCP tool specifications. This means developers can expose their entire API surface to AI assistants with minimal configuration, enabling powerful automation and intelligent interactions. - **Automatic Tool Generation** automatically discovers and converts all FastAPI endpoints into MCP tools based on your existing OpenAPI schema, eliminating the need for manual tool definitions. - **Zero Configuration Setup** requires minimal code changes to integrate with existing FastAPI applications—simply mount the MCP server alongside your existing routes. - **Schema Preservation** maintains full compatibility with FastAPI's request/response models, ensuring type safety and validation are preserved when AI systems interact with your endpoints. - **Flexible Transport Options** supports multiple transport mechanisms including Server-Sent Events (SSE) for real-time communication with AI clients. - **Seamless Integration** works alongside your existing FastAPI middleware, authentication, and dependency injection systems without modification. To get started, install the package via pip with `pip install fastapi-mcp`, then import and mount the MCP server in your FastAPI application. The library will automatically expose your endpoints as MCP tools that AI assistants can discover and invoke. Configuration options allow you to customize which endpoints are exposed and how they appear to AI systems. FastAPI-MCP is particularly useful for developers building AI-powered applications who want to leverage existing backend services, create chatbots that can perform real actions, or integrate AI assistants into existing workflows without rebuilding their API infrastructure. ## Features - Automatic MCP tool generation from FastAPI endpoints - OpenAPI schema-based tool discovery - Server-Sent Events (SSE) transport support - FastAPI middleware compatibility - Type-safe request/response handling - Minimal configuration required - Python package installation via pip ## Integrations FastAPI, Model Context Protocol (MCP), OpenAPI, Python ## Platforms WEB, API, DEVELOPER_SDK ## Pricing Open Source ## Links - Website: https://github.com/tadata-org/fastapi_mcp - Documentation: https://github.com/tadata-org/fastapi_mcp - Repository: https://github.com/tadata-org/fastapi_mcp - EveryDev.ai: https://www.everydev.ai/tools/fastapi-mcp