FastAPI SSE MCP Random
FastAPI SSE MCP Random
Ein FastAPI-Server, der das Model Context Protocol (MCP) mithilfe von Server-Sent Events (SSE) für die Streaming-Kommunikation implementiert. Dieses Projekt bietet verschiedene Dienstprogramme, darunter die Generierung von Zufallszahlen, die Bildgenerierung mit Azure OpenAI DALL-E und die Generierung von KI-Podcasts.
Merkmale
Server-Sent Events (SSE) für Echtzeit-Streaming-Kommunikation
Model Context Protocol (MCP) -Implementierung für strukturierte Tool-Nutzung
Mehrere Dienstprogramme :
Echo-Tool und Ressourcen
Zufallszahlengenerator
Bildgenerierung über Azure OpenAI DALL-E 3
KI-Podcast-Generierung
„Denkwerkzeug“ für reflektierte Antworten
Related MCP server: AI Agent MCP Server
Voraussetzungen
Python 3.10+
Azure OpenAI API-Zugriff (zur Bildgenerierung)
Installation
Klonen Sie das Repository:
git clone <repository-url>
cd fastapi_sse_mcp_randomInstallieren Sie die Abhängigkeiten:
pip install -r requirements.txtOder mit uv :
uv pip install -e .Verwendung
Starten des Servers
Führen Sie den Server aus mit:
python main.pyDer Server startet unter http://0.0.0.0:8000
Verfügbare Endpunkte
GET /: Endpunkt der IntegritätsprüfungGET /sse/: SSE-VerbindungsendpunktPOST /messages/: Endpunkt für Client-Nachrichten
Verfügbare Tools
Echo-Tool
{
"name": "echo_tool",
"parameters": {
"message": "Hello, world!"
}
}Zufallszahlengenerator
{
"name": "random_number",
"parameters": {
"min_value": 1,
"max_value": 100
}
}Bilderzeugung
{
"name": "generate_image",
"parameters": {
"prompt": "A beautiful landscape with mountains and a lake"
}
}Podcast-Generierung
{
"name": "generate_podcast",
"parameters": {
"prompt": "The future of artificial intelligence",
"duration": 5,
"name1": "Mark",
"voice1": "Thomas",
"name2": "Sophia",
"voice2": "Emily"
}
}Denkwerkzeug
{
"name": "think_tool",
"parameters": {
"input": "What are the implications of quantum computing?"
}
}Projektstruktur
main.py: Haupt-FastAPI-Anwendung und Implementierung der MCP-Toolssse.py: Implementierung von Server-Sent Events (SSE)pyproject.toml: Projektmetadaten und Abhängigkeitenrequirements.txt: Liste grundlegender Abhängigkeiten
Abhängigkeiten
FastAPI: Webframework zum Erstellen von APIs
MCP: Implementierung des Model Context Protocol
OpenAI: Client für Azure OpenAI-Dienste
Uvicorn: ASGI-Server zum Ausführen von FastAPI-Anwendungen
Requests: HTTP-Bibliothek für API-Aufrufe
Lizenz
[Geben Sie hier Ihre Lizenz an]
Beitragen
[Anleitung zur Mitarbeit am Projekt]
This server cannot be deployed
Maintenance
Related MCP Connectors
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
Focused MCP server for OpenAI image/audio generation (v2.0.0). Wraps endpoints via HAPI CLI.
Related MCP Servers
- AlicenseAqualityDmaintenanceA Model Context Protocol server that enables AI assistants to make HTTP requests (GET, POST, PUT, DELETE) to external APIs through standardized MCP tools.42MIT
- FlicenseNot gradedqualityDmaintenanceA Model Context Protocol server implementation built with FastAPI that enables AI agent interactions. Provides a structured foundation for building AI-powered applications with proper data validation and modern Python tooling.-
- FlicenseNot gradedqualityDmaintenanceA FastMCP-based server providing tools for weather queries, random number generation, and real-time stock market data retrieval. It enables AI models to interact with external data and perform specific tasks through the Model Context Protocol.-
- AlicenseNot gradedqualityDmaintenanceModel Context Protocol server that standardizes tool discovery, execution, and context management for AI applications.MIT