Skip to main content
Glama

FastAPI-MCP

by tadata-org

특징

  • 기존 FastAPI 종속성을 사용하여 인증 기능이 내장되었습니다!
  • FastAPI 네이티브: 단순히 OpenAPI -> MCP 변환기가 아닙니다
  • 구성이 전혀 필요하지 않거나 최소한으로 만 필요합니다. FastAPI 앱에 지정하기만 하면 작동합니다.
  • 요청 모델과 응답 모델의 스키마 보존
  • Swagger에 있는 것과 마찬가지로 모든 엔드포인트의 문서를 보존하세요 .
  • 유연한 배포 - MCP 서버를 동일한 앱에 마운트하거나 별도로 배포
  • ASGI 전송 - 효율적인 통신을 위해 FastAPI의 ASGI 인터페이스를 직접 사용합니다.

설치

빠른 Python 패키지 설치 프로그램인 uv 를 사용하는 것이 좋습니다.

지엑스피1

또는 pip를 사용하여 설치할 수 있습니다.

pip install fastapi-mcp

기본 사용법

FastAPI-MCP를 사용하는 가장 간단한 방법은 FastAPI 애플리케이션에 MCP 서버를 직접 추가하는 것입니다.

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()

이제 자동 생성된 MCP 서버를 https://app.base.url/mcp 에서 사용할 수 있습니다.

문서, 예제 및 고급 사용법

FastAPI-MCP는 포괄적인 설명서를 제공합니다. 또한, 이러한 기능의 실제 작동을 보여주는 코드 샘플은 예제 디렉터리 에서 확인하세요.

FastAPI 우선 접근 방식

FastAPI-MCP는 단순히 API에서 MCP 도구를 생성하는 변환기가 아닌, FastAPI의 기본 확장 기능으로 설계되었습니다. 이러한 접근 방식은 다음과 같은 몇 가지 주요 이점을 제공합니다.

  • 기본 종속성 : 인증 및 권한 부여를 위해 익숙한 FastAPI Depends() 사용하여 MCP 엔드포인트를 보호합니다.
  • ASGI 전송 : ASGI 인터페이스를 사용하여 FastAPI 앱과 직접 통신하므로 MCP에서 API로의 HTTP 호출이 필요 없습니다.
  • 통합 인프라 : FastAPI 앱은 MCP 서버와 별도로 실행할 필요가 없습니다( 별도 배포 도 지원됨)

이러한 디자인 철학은 기존 FastAPI 서비스에 MCP 기능을 추가할 때 최소한의 마찰을 보장합니다.

개발 및 기여

FastAPI-MCP에 기여해 주셔서 감사합니다! 커뮤니티에서 이슈를 게시하고 풀 리퀘스트를 생성해 주시기 바랍니다.

시작하기 전에 기여 가이드를 참조하세요.

지역 사회

MCParty Slack 커뮤니티 에 가입하여 다른 MCP 애호가들과 소통하고, 질문하고, FastAPI-MCP에 대한 경험을 공유하세요.

요구 사항

  • Python 3.10+ (권장 3.12)
  • 자외선

특허

MIT 라이선스. 저작권 (c) 2024 Tadata Inc.

-
security - not tested
A
license - permissive license
-
quality - not tested

Claude와 같은 LLM 시스템이 추가 코딩 없이 API와 상호 작용할 수 있도록 FastAPI 엔드포인트를 자동으로 MCP(Model Context Protocol) 도구로 노출하는 제로 구성 도구입니다.

  1. 설치
    1. 기본 사용법
      1. 문서, 예제 및 고급 사용법
        1. FastAPI 우선 접근 방식
          1. 개발 및 기여
            1. 지역 사회
              1. 요구 사항
                1. 특허

                  Related MCP Servers

                  • -
                    security
                    F
                    license
                    -
                    quality
                    A MCP server that exposes OpenAPI schema information to LLMs like Claude. This server allows an LLM to explore and understand large OpenAPI schemas through a set of specialized tools, without needing to load the whole schema into the context
                    Last updated -
                    37
                    5
                    JavaScript
                    • Apple
                    • Linux
                  • -
                    security
                    F
                    license
                    -
                    quality
                    A simple application demonstrating Model Context Protocol (MCP) integration with FastAPI and Streamlit, allowing users to interact with LLMs through a clean interface.
                    Last updated -
                    3
                    Python
                    • Linux
                  • A
                    security
                    A
                    license
                    A
                    quality
                    A Model Context Protocol server that loads multiple OpenAPI specifications and exposes them to LLM-powered IDE integrations, enabling AI to understand and work with your APIs directly in development tools like Cursor.
                    Last updated -
                    7
                    292
                    7
                    TypeScript
                    MIT License
                  • -
                    security
                    A
                    license
                    -
                    quality
                    A zero-configuration tool that automatically converts FastAPI endpoints into Model Context Protocol (MCP) tools, enabling AI systems to interact with your API through natural language.
                    Last updated -
                    1
                    Python
                    MIT License

                  View all related MCP servers

                  MCP directory API

                  We provide all the information about MCP servers via our MCP API.

                  curl -X GET 'https://glama.ai/api/mcp/v1/servers/tadata-org/fastapi_mcp'

                  If you have feedback or need assistance with the MCP directory API, please join our Discord server