FastAPI-MCP
Merkmale
Integrierte Authentifizierung unter Verwendung Ihrer vorhandenen FastAPI-Abhängigkeiten!
FastAPI-native: Nicht nur ein weiterer OpenAPI -> MCP-Konverter
Keine/minimale Konfiguration erforderlich – richten Sie es einfach auf Ihre FastAPI-App und es funktioniert
Beibehalten der Schemata Ihrer Anforderungs- und Antwortmodelle
Bewahren Sie die Dokumentation aller Ihrer Endpunkte auf, genau wie in Swagger
Flexible Bereitstellung – Binden Sie Ihren MCP-Server in dieselbe App ein oder stellen Sie ihn separat bereit
ASGI-Transport - Nutzt die ASGI-Schnittstelle von FastAPI direkt für eine effiziente Kommunikation
Related MCP server: FastAPI-MCP
Installation
Wir empfehlen die Verwendung von uv , einem schnellen Python-Paketinstallationsprogramm:
uv add fastapi-mcpAlternativ können Sie mit pip installieren:
pip install fastapi-mcpGrundlegende Verwendung
Die einfachste Möglichkeit, FastAPI-MCP zu verwenden, besteht darin, Ihrer FastAPI-Anwendung direkt einen MCP-Server hinzuzufügen:
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()Das war's! Ihr automatisch generierter MCP-Server ist jetzt unter https://app.base.url/mcp verfügbar.
Dokumentation, Beispiele und erweiterte Nutzung
FastAPI-MCP bietet eine umfassende Dokumentation . Im Beispielverzeichnis finden Sie außerdem Codebeispiele, die diese Funktionen in Aktion demonstrieren.
FastAPI-First-Ansatz
FastAPI-MCP ist als native Erweiterung von FastAPI konzipiert und nicht nur als Konverter, der MCP-Tools aus Ihrer API generiert. Dieser Ansatz bietet mehrere wichtige Vorteile:
Native Abhängigkeiten : Sichern Sie Ihre MCP-Endpunkte mit vertrauten FastAPI
Depends()zur Authentifizierung und AutorisierungASGI-Transport : Kommuniziert direkt mit Ihrer FastAPI-App über die ASGI-Schnittstelle, sodass keine HTTP-Aufrufe vom MCP an Ihre API erforderlich sind
Einheitliche Infrastruktur : Ihre FastAPI-App muss nicht separat vom MCP-Server ausgeführt werden (obwohl auch eine separate Bereitstellung unterstützt wird).
Diese Designphilosophie gewährleistet minimale Reibung beim Hinzufügen von MCP-Funktionen zu Ihren vorhandenen FastAPI-Diensten.
Entwicklung und Mitwirkung
Vielen Dank, dass Sie zu FastAPI-MCP beitragen möchten! Wir ermutigen die Community, Probleme zu melden und Pull Requests zu erstellen.
Bevor Sie beginnen, lesen Sie bitte unseren Beitragsleitfaden .
Gemeinschaft
Treten Sie der MCParty Slack-Community bei, um sich mit anderen MCP-Enthusiasten zu vernetzen, Fragen zu stellen und Ihre Erfahrungen mit FastAPI-MCP zu teilen.
Anforderungen
Python 3.10+ (empfohlen 3.12)
UV
Lizenz
MIT-Lizenz. 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