FastAPI-MCP
特徴
既存の FastAPI 依存関係を使用して、認証が組み込まれています。
**FastAPIネイティブ:**単なるOpenAPI -> MCPコンバータではない
設定はゼロ/最小限で済みます。FastAPI アプリを指定するだけで動作します。
リクエストモデルとレスポンスモデルのスキーマの保持
Swaggerと同じように、すべてのエンドポイントのドキュメントを保存します。
柔軟な展開- MCP サーバーを同じアプリにマウントするか、個別に展開します
ASGIトランスポート- 効率的な通信のためにFastAPIのASGIインターフェースを直接使用します
Related MCP server: FastAPI-MCP
インストール
高速な Python パッケージ インストーラーであるuv の使用をお勧めします。
uv add fastapi-mcpあるいは、pip を使用してインストールすることもできます。
pip install fastapi-mcp基本的な使い方
FastAPI-MCP を使用する最も簡単な方法は、MCP サーバーを FastAPI アプリケーションに直接追加することです。
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は包括的なドキュメントを提供しています。さらに、これらの機能の実際の動作を示すコードサンプルについては、 examplesディレクトリをご覧ください。
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ライセンス。Copyright (c) 2024 Tadata Inc.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
No tool schema history has been recorded yet.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
The OpenRouter for tools. One MCP connection gives any AI agent 254 hosted tools, pay per call.
471One MCP endpoint for Claude, GPT & Gemini: 100+ tools + no-code connectors + agent workers.
Zero-setup MCP gateway securely connecting AI to your tools with authentication and workflows
Hosted MCP endpoint with realistic fake data for prototyping agents. 12 tools, no setup.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA 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.2MIT
- AlicenseNot gradedqualityDmaintenanceExposes FastAPI endpoints as Model Context Protocol (MCP) tools while preserving existing authentication, schemas, and documentation. It enables seamless integration of FastAPI services into MCP ecosystems using a native ASGI transport layer.MIT
- AlicenseAqualityCmaintenanceTurn any OpenAPI spec into MCP tools for Claude — instantly. Point mcp-openapi at any OpenAPI 3.x spec and Claude can call every endpoint through natural language. No custom integration code. No manual tool definitions. One line of config.2681MIT
- FlicenseNot gradedqualityDmaintenanceConverts any REST API endpoints into MCP tools, enabling AI clients like Cursor and Claude Desktop to call internal services directly.-
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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