MCP サーバー - モデルコンテキストプロトコル API
MCP サーバーは、LLM モデルとアプリケーション間の相互作用のための標準化されたインターフェイスを提供するモデル コンテキスト プロトコル (MCP) の FastAPI ベースの実装です。
特徴
- 🚀 FastAPIと非同期操作に基づく高性能API
- 🔄 リソース、機器、プロンプト、サンプリングによる完全な MCP サポート
- 📊 PrometheusとGrafanaによるモニタリングとメトリクス
- 🧩 シンプルなインターフェースで新しいツールを追加できる拡張性
- 📝 データを柔軟に操作できるGraphQL API
- 💬 リアルタイムインタラクションのためのWebSocketサポート
- 🔍 Elasticsearchとの統合によるセマンティック検索
- 🗃️ Redis によるキャッシュでパフォーマンスを向上
- 📦 信頼性の高いパッケージ管理のために、Poetry で依存関係を管理します
はじめる
インストール
- リポジトリのクローン:
- Poetry をインストールします (まだインストールされていない場合):
- Poetry 経由で依存関係をインストールします。
サーバーの起動
または just ユーティリティ経由で:
起動後、APIは次の場所で利用できます: http://localhost:8000
APIドキュメント
- Swagger UI: http://localhost:8000/docs
- 再ドキュメント: http://localhost:8000/redoc
- GraphQL プレイグラウンド: http://localhost:8000/graphql
プロジェクト構造
利用可能なツール
ファイルシステムツール
ファイルの��み取り、書き込み、削除、一覧表示をサポートするファイル システム ツール。
天気ツール
座標によって天気データを取得するためのツール。
テキスト分析ツール
感情の検出や要約を含むテキスト分析ツール。
テキストプロセッサツール
書式設定、統計計算、エンティティ抽出などのテキスト処理ツール。
画像処理ツール
サイズ変更、切り取り、フィルターの適用をサポートする画像処理ツール。
WebSocket API
WebSocket API に接続するには:
GraphQL API
GraphQL 経由のクエリの例:
テストの実行
テストを実行するには、Poetry を使用します。
または just ユーティリティ経由で:
ドッカー
Docker Compose によるビルドと実行
個々のサービスを起動するには:
LLMとの統合
MCP サーバーは、さまざまなベンダーの LLM モデルとの統合のための標準化されたインターフェースを提供します。
指標と監視
MCP サーバーは/metrics
エンドポイントを介して Prometheus 形式のメトリックを提供します。指標には次のものが含まれます:
- 各ツールへのリクエスト数
- クエリ実行時間
- エラーと例外
発達
コードをフォーマットしてリンターでチェックするには:
ライセンス
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
大規模言語モデルとのシームレスな統合を実現するモデル コンテキスト プロトコル (MCP) をサポートする高性能 FastAPI サーバー。REST、GraphQL、WebSocket API に加え、リアルタイム監視およびベクトル検索機能を備えています。
Related Resources
Related MCP Servers
- -securityFlicense-qualityA 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 -32Python
- -securityAlicense-qualityA Model Context Protocol (MCP) compliant server that allows Large Language Models (LLMs) to search and retrieve content from microCMS APIs.Last updated -TypeScriptMIT License
- -securityAlicense-qualityA high-performance Model Context Protocol (MCP) server designed for large language models, enabling real-time communication between AI models and applications with support for session management and intelligent tool registration.Last updated -2PythonMIT License
- -securityFlicense-qualityA FastAPI server implementing the Model Context Protocol (MCP) for structured tool use, providing utility tools including random number generation, image generation via Azure OpenAI DALL-E, and AI podcast generation.Last updated -Python