Integrations
Uses FastAPI to implement the Model Context Protocol server with Server-Sent Events for streaming communication
Connects to Azure OpenAI DALL-E 3 for image generation based on text prompts
Built with Python 3.10+ and includes various utility tools like random number generation, echo functionality, and AI podcast generation
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 アクセス (画像生成用)
インストール
- リポジトリをクローンします。
Copy
- 依存関係をインストールします。
Copy
またはuv
を使用します:
Copy
使用法
サーバーの起動
次のコマンドでサーバーを実行します。
Copy
サーバーはhttp://0.0.0.0:8000
で起動します。
利用可能なエンドポイント
GET /
: ヘルスチェックエンドポイントGET /sse/
: SSE接続エンドポイントPOST /messages/
: クライアントメッセージのエンドポイント
利用可能なツール
エコーツール
Copy
乱数ジェネレータ
Copy
画像生成
Copy
ポッドキャスト世代
Copy
シンクツール
Copy
プロジェクト構造
main.py
: メインの FastAPI アプリケーションと MCP ツールの実装sse.py
: サーバー送信イベント (SSE) の実装pyproject.toml
: プロジェクトのメタデータと依存関係requirements.txt
: 基本的な依存関係リスト
依存関係
- FastAPI: APIを構築するためのWebフレームワーク
- MCP: モデルコンテキストプロトコルの実装
- OpenAI: Azure OpenAI サービスのクライアント
- Uvicorn: FastAPI アプリケーションを実行するための ASGI サーバー
- リクエスト: API呼び出し用のHTTPライブラリ
ライセンス
[ここでライセンスを指定してください]
貢献
[プロジェクトへの貢献方法]
Related MCP Servers
- -securityAlicense-qualityA Model Context Protocol (MCP) server implementation for the OpenLedger API. This server provides structured context to AI models according to the MCP specification.Last updated -8TypeScriptApache 2.0
- -security-license-qualityA Model Context Protocol server enabling AI assistants to generate images through OpenAI's DALL-E API with full support for all available options and fine-grained control.Last updated -JavaScriptMIT License
- -securityAlicense-qualityA 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.Last updated -1PythonMIT License
- -securityAlicense-qualityA command-line tool that transforms any OpenAPI service into a Model Context Protocol (MCP) server, enabling seamless integration with AI agents and tools that support the MCP specification.Last updated -902TypeScriptMIT License