Skip to main content
Glama

FastAPI SSE MCP Random

by hk4crprasad

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

Voraussetzungen

  • Python 3.10+
  • Azure OpenAI API-Zugriff (zur Bildgenerierung)

Installation

  1. Klonen Sie das Repository:
git clone <repository-url> cd fastapi_sse_mcp_random
  1. Installieren Sie die Abhängigkeiten:
pip install -r requirements.txt

Oder mit uv :

uv pip install -e .

Verwendung

Starten des Servers

Führen Sie den Server aus mit:

python main.py

Der Server startet unter http://0.0.0.0:8000

Verfügbare Endpunkte

  • GET / : Endpunkt der Integritätsprüfung
  • GET /sse/ : SSE-Verbindungsendpunkt
  • POST /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-Tools
  • sse.py : Implementierung von Server-Sent Events (SSE)
  • pyproject.toml : Projektmetadaten und Abhängigkeiten
  • requirements.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]

-
security - not tested
F
license - not found
-
quality - not tested

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

Ein FastAPI-Server, der das Model Context Protocol (MCP) für die strukturierte Verwendung von Tools implementiert und Dienstprogramme wie die Generierung von Zufallszahlen, die Bildgenerierung über Azure OpenAI DALL-E und die Generierung von KI-Podcasts bereitstellt.

  1. Merkmale
    1. Voraussetzungen
      1. Installation
        1. Verwendung
          1. Starten des Servers
          2. Verfügbare Endpunkte
          3. Verfügbare Tools
        2. Projektstruktur
          1. Abhängigkeiten
            1. Lizenz
              1. Beitragen

                Related MCP Servers

                • A
                  security
                  F
                  license
                  A
                  quality
                  A FastMCP server implementation that facilitates resource-based access to AI model inference, focusing on image generation through the Replicate API, with features like real-time updates, webhook integration, and secure API key management.
                  Last updated -
                  18
                  15
                  Python
                  • Apple
                • -
                  security
                  A
                  license
                  -
                  quality
                  A high-performance FastAPI server supporting Model Context Protocol (MCP) for seamless integration with Large Language Models, featuring REST, GraphQL, and WebSocket APIs, along with real-time monitoring and vector search capabilities.
                  Last updated -
                  9
                  Python
                  MIT License
                • -
                  security
                  F
                  license
                  -
                  quality
                  A production-ready MCP server built with FastAPI, providing an enhanced tool registry for creating, managing, and documenting AI tools for Large Language Models (LLMs).
                  Last updated -
                  32
                  Python
                • -
                  security
                  A
                  license
                  -
                  quality
                  A FastMCP server implementation that provides a standardized interface for accessing AI models hosted on Replicate's API, currently supporting image generation with customizable parameters.
                  Last updated -
                  3
                  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/hk4crprasad/fastapi_sse_mcp_random'

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