Skip to main content
Glama

FastAPI SSE MCP Random

by hk4crprasad

FastAPI SSE MCP ランダム

ストリーミング通信にServer-Sent Events (SSE)を用いたModel Context Protocol (MCP)を実装したFastAPIサーバー。このプロジェクトでは、乱数生成、Azure OpenAI DALL-Eを用いた画像生成、AIポッドキャスト生成など、様々なユーティリティツールを提供しています。

特徴

  • リアルタイムストリーミング通信のためのサーバー送信イベント(SSE)
  • 構造化されたツールの使用のための**モデルコンテキストプロトコル(MCP)**の実装
  • 複数のユーティリティツール:
    • Echoツールとリソース
    • 乱数ジェネレータ
    • Azure OpenAI DALL-E 3 による画像生成
    • AIポッドキャスト生成
    • 反省的な反応のための「考えるツール」

前提条件

  • Python 3.10以上
  • Azure OpenAI API アクセス (画像生成用)

インストール

  1. リポジトリをクローンします。
git clone <repository-url> cd fastapi_sse_mcp_random
  1. 依存関係をインストールします。
pip install -r requirements.txt

またはuvを使用します:

uv pip install -e .

使用法

サーバーの起動

次のコマンドでサーバーを実行します。

python main.py

サーバーはhttp://0.0.0.0:8000で起動します。

利用可能なエンドポイント

  • GET / : ヘルスチェックエンドポイント
  • GET /sse/ : SSE接続エンドポイント
  • POST /messages/ : クライアントメッセージのエンドポイント

利用可能なツール

エコーツール
{ "name": "echo_tool", "parameters": { "message": "Hello, world!" } }
乱数ジェネレータ
{ "name": "random_number", "parameters": { "min_value": 1, "max_value": 100 } }
画像生成
{ "name": "generate_image", "parameters": { "prompt": "A beautiful landscape with mountains and a lake" } }
ポッドキャスト世代
{ "name": "generate_podcast", "parameters": { "prompt": "The future of artificial intelligence", "duration": 5, "name1": "Mark", "voice1": "Thomas", "name2": "Sophia", "voice2": "Emily" } }
シンクツール
{ "name": "think_tool", "parameters": { "input": "What are the implications of quantum computing?" } }

プロジェクト構造

  • main.py : メインの FastAPI アプリケーションと MCP ツールの実装
  • sse.py : サーバー送信イベント (SSE) の実装
  • pyproject.toml : プロジェクトのメタデータと依存関係
  • requirements.txt : 基本的な依存関係リスト

依存関係

  • FastAPI: APIを構築するためのWebフレームワーク
  • MCP: モデルコンテキストプロトコルの実装
  • OpenAI: Azure OpenAI サービスのクライアント
  • Uvicorn: FastAPI アプリケーションを実行するための ASGI サーバー
  • リクエスト: API呼び出し用のHTTPライブラリ

ライセンス

[ここでライセンスを指定してください]

貢献

[プロジェクトへの貢献方法]

-
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.

構造化されたツールの使用のためにモデル コンテキスト プロトコル (MCP) を実装する FastAPI サーバー。乱数生成、Azure OpenAI DALL-E による画像生成、AI ポッドキャスト生成などのユーティリティ ツールを提供します。

  1. 特徴
    1. 前提条件
      1. インストール
        1. 使用法
          1. サーバーの起動
          2. 利用可能なエンドポイント
          3. 利用可能なツール
        2. プロジェクト構造
          1. 依存関係
            1. ライセンス
              1. 貢献

                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