FastAPI MCP server
FastAPI 엔드포인트를 MCP tool로 변환하며, 요청/응답 스키마를 유지하고 기존 FastAPI 인증 의존성을 그대로 사용합니다.
다른 이름 tadata-org/fastapi_mcp, fastapi-mcp
- 스타
- 12,030
- Tools
- —
- 다운로드, 30일
- —
- 최신 버전
- —
- 마지막 커밋
- 2025년 11월 24일
- 라이선스
- MIT
FastAPI MCP란?
FastAPI은(는) MCP server입니다. FastAPI 엔드포인트를 MCP tool로 변환하며, 요청/응답 스키마를 유지하고 기존 FastAPI 인증 의존성을 그대로 사용합니다.
프로젝트 README에서 생성된 요약
FastAPI MCP server 정보
fastapi_mcp를 사용하면 기존 API 엔드포인트를 AI 모델에 노출할 수 있습니다. 이 도구는 원래의 요청 및 응답 스키마를 유지하면서 FastAPI 엔드포인트를 Model Context Protocol tool로 변환합니다. 로직을 처음부터 다시 작성하지 않고 현재의 웹 서비스를 AI 클라이언트와 통합하려는 Python 개발자를 위해 설계되었습니다.
애플리케이션의 네이티브 확장 기능으로 작동하므로 통합이 매우 간단합니다. 기존 FastAPI 앱에 MCP server를 직접 마운트하거나 별도의 배포 방식을 선택할 수 있습니다. 시스템은 ASGI transport를 사용하여 애플리케이션과 직접 통신하므로 추가적인 HTTP 호출로 인한 오버헤드를 방지합니다. FastAPI 에코시스템을 기반으로 구축되었기 때문에 기존의 Depends() 인증 및 인가 의존성을 사용하여 tool을 보호할 수 있습니다.
서버 설정에는 최소한의 구성만 필요합니다. 마운트가 완료되면 서버는 기본 URL의 특정 엔드포인트에서 사용할 수 있습니다. Swagger UI의 모든 문서를 유지하므로 AI가 제공된 모든 tool의 목적과 구조를 정확히 이해할 수 있습니다.
활용 사례
- 1안전한 API 노출AI 클라이언트가 기존 보안 프로토콜을 사용하여 보호된 엔드포인트와 상호작용할 수 있습니다.
- 2자동화된 tool 생성수동 설정 거의 없이 기존 API 제품군 전체를 MCP tool로 변환합니다.
- 3스키마 인지 AI 상호작용AI 모델이 어떤 데이터를 보내야 하는지, 그리고 어떤 응답을 기대해야 하는지 정확히 이해하도록 보장합니다.
- 4효율적인 로컬 통합외부 HTTP 요청의 지연 시간 없이 AI를 웹 서비스에 연결합니다.
프로젝트의 README를 바탕으로 작성되었습니다. 모든 활용 사례는 해당 내용의 인용문과 대조하여 확인합니다.
자동 검사
2026년 11월 14일에 실행됨전체 보고서 →아직 인증되지 않았습니다. 서버는 80점 이상의 점수, 심각한 결함 없음, 그리고 검사에 충분한 데이터를 갖추어야 합니다. 검사 방식 · 점수를 높이기 위해 수정할 항목
- 소스 저장소 연결 및 접근 가능tadata-org/fastapi_mcp is public and reachablegithub.com/tadata-org/fastapi_mcp ↗통과
- 패키지가 이 저장소를 소스로 명시검사되지 않음
- 빌드 출처(Sigstore 증명)검사되지 않음
- 오픈 소스 라이선스 (OSI)MITspdx.org/licenses/MIT.html ↗통과
- 최근 1년 내 커밋 또는 릴리스Last commit or release 2025-11-24github.com/tadata-org/fastapi_mcp ↗통과
- OpenSSF Scorecard검사되지 않음
- 패키지 이름이 인기 패키지와 유사하지 않음검사되지 않음
- 패키지 및 해당 종속성에 중요한 보안 권고 없음검사되지 않음
- 모델에 대한 숨겨진 지침 없음0 tool descriptions and the README read; no override phrases, credential paths or hidden characters통과
- 파괴적인 도구에 라벨 표시됨검사되지 않음
- 원격 엔드포인트가 MCP 핸드셰이크에 응답검사되지 않음
README
GitHub에서 보기Features
-
Authentication built in, using your existing FastAPI dependencies!
-
FastAPI-native: Not just another OpenAPI -> MCP converter
-
Zero/Minimal configuration required - just point it at your FastAPI app and it works
-
Preserving schemas of your request models and response models
-
Preserve documentation of all your endpoints, just as it is in Swagger
-
Flexible deployment - Mount your MCP server to the same app, or deploy separately
-
ASGI transport - Uses FastAPI's ASGI interface directly for efficient communication
Hosted Solution
If you prefer a managed hosted solution check out tadata.com.
Installation
We recommend using uv, a fast Python package installer:
uv add fastapi-mcp
Alternatively, you can install with pip:
pip install fastapi-mcp
Basic Usage
The simplest way to use FastAPI-MCP is to add an MCP server directly to your FastAPI application:
from fastapi import FastAPI
from fastapi_mcp import FastApiMCP
app = FastAPI()
mcp = FastApiMCP(app)
# Mount the MCP server directly to your FastAPI app
mcp.mount()
That's it! Your auto-generated MCP server is now available at https://app.base.url/mcp.
Documentation, Examples and Advanced Usage
FastAPI-MCP provides comprehensive documentation. Additionaly, check out the examples directory for code samples demonstrating these features in action.
FastAPI-first Approach
FastAPI-MCP is designed as a native extension of FastAPI, not just a converter that generates MCP tools from your API. This approach offers several key advantages:
-
Native dependencies: Secure your MCP endpoints using familiar FastAPI
Depends()for authentication and authorization -
ASGI transport: Communicates directly with your FastAPI app using its ASGI interface, eliminating the need for HTTP calls from the MCP to your API
-
Unified infrastructure: Your FastAPI app doesn't need to run separately from the MCP server (though separate deployment is also supported)
This design philosophy ensures minimum friction when adding MCP capabilities to your existing FastAPI services.
Development and Contributing
Thank you for considering contributing to FastAPI-MCP! We encourage the community to post Issues and create Pull Requests.
Before you get started, please see our Contribution Guide.
Community
Join MCParty Slack community to connect with other MCP enthusiasts, ask questions, and share your experiences with FastAPI-MCP.
Requirements
- Python 3.10+ (Recommended 3.12)
- uv
License
MIT License. Copyright (c) 2025 Tadata Inc.
FastAPI MCP 질문
FastAPI 앱에 MCP server를 어떻게 추가하나요?
앱 인스턴스로 FastApiMCP를 생성한 뒤 mount()를 호출하세요. 그러면 MCP server가 앱의 기본 URL 내 /mcp 경로에서 서비스됩니다.
FastAPI-MCP는 인증을 지원하나요?
네, 인증 기능이 내장되어 있으며 인증 및 인가를 위해 기존에 사용하던 Depends()와 같은 FastAPI 의존성을 재사용할 수 있습니다.
엔드포인트 문서와 스키마가 유지되나요?
네, 요청 및 응답 모델 스키마를 유지하며 엔드포인트 문서도 Swagger에 표시되는 그대로 유지합니다.
FastAPI-MCP에 필요한 Python 버전은 무엇인가요?
Python 3.10 이상이 필요하며, 3.12 버전을 권장합니다.
MCP server를 FastAPI 앱과 별도로 배포할 수 있나요?
네, MCP server를 동일한 앱에 마운트하거나 별도로 배포할 수 있습니다.