Selector AI FastMCP

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

Integrations

  • Manages environment variables for configuration, including Selector AI API keys and URLs.

  • Runs the MCP server in a lightweight container with health checks, and the client can spawn the Docker container for interactive sessions.

  • Used for cloning the repository during installation process.

セレクターAI FastMCP

このリポジトリは、Selector AI向けのモデルコンテキストプロトコル(MCP)の完全な実装を提供します。ストリーミング対応サーバーと、stdin/stdoutを介して通信するDockerベースのインタラクティブクライアントが含まれています。

✨ 特徴

✅ サーバー

FastMCP互換でPython上に構築

リアルタイムSSEストリーミングのサポート

セレクターAIとのインタラクティブAIチャット

最小限の定型文

コンテナ オーケストレーション用の組み込みヘルスチェック

リクエスト/レスポンスのログ記録と再試行

✅ クライアント

PythonクライアントがDocker経由でサーバーを起動する

CLIとプログラムによるアクセスの両方をサポート

stdin と stdout 経由で読み取り/書き込み

.env を使用した環境変数の設定

🚀 クイックスタート

前提条件

Python 3.8以上

ドッカー

セレクターAI APIキー

セレクター API URL

⚙️ インストール

リポジトリのクローンを作成する

git クローンhttps://github.com/automateyournetwork/selector-mcp-server

CDセレクター-AI-MCP

Pythonの依存関係をインストールする

pip インストール -r 要件.txt

環境変数を設定する .env ファイルを作成します。

SELECTOR_URL= https://セレクター API の URL

SELECTOR_AI_API_KEY=APIキー

🐳 Dockerファイル

サーバーは、次の Dockerfile を使用して軽量コンテナ内で実行されます。

python:3.11-slimから

ワークディレクトリ /app

requirements.txt をコピーします。

pip install -r requirements.txt を実行します。

コピー 。 。

コマンド ["python", "-u", "mcp_server.py"]

ヘルスチェック --interval=30s --timeout=30s --start-period=5s
CMD python -c "import socket; s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM); s.connect('/tmp/mcp.sock'); s.send(b'{"tool_name": "ready"}\n'); data = s.recv(1024); s.close(); import json; result = json.loads(data); exit(0 if result.get('status') == 'ready' else 1)" || exit 1

Dockerイメージをビルドする

docker build -t セレクター-mcp 。

🧠 クライアントの使用

クライアントを起動する

これにより、Docker コンテナが生成され、対話型シェルが開きます。

Python mcp_client.py

CLIセッションの例

あなた> AIOps とは何ですか?

セレクター> AIOps は、IT 運用への AI の適用を指します...

プログラムによるアクセス

selector_client から call_tool、spawn_server をインポートします

proc = spawn_server()

call_tool(proc, "準備完了")

response = call_tool(proc, "ask_selector", {"content": "AIOps とは何ですか?"})

印刷(応答)

🖥️ Claude Desktop での使用

Claude Desktop と統合する場合は、このサーバーを実行して、ソケットまたは HTTP エンドポイントをローカルで公開できます。

Docker またはネイティブを使用してサーバーを実行します。

Python mcp_server.py

Claude Desktop の外部ツール構成からソケットまたは HTTP エンドポイントに接続します。

メッセージが次の形式と一致していることを確認してください。

{ "method": "tools/call", "tool_name": "ask_selector", "content": "What can you tell me about device S6?" }

Claude Desktop は、stdout 経由で AI の構造化された応答を受け取ります。

🛠️ 独自のコンテナを構築する

この設定をカスタマイズするには:

このリポジトリをフォークまたはクローンする

selector_fastmcp_server.py を変更して、好みのモデルまたはルーティングロジックを統合します。

Docker イメージを再構築します。

次のコマンドを実行して、docker build -t my-custom-mcp を実行します。

代わりに my-custom-mcp を生成するようにクライアントを更新します。

「docker」、「run」、「-i」、「--rm」、「my-custom-mcp」

📁 プロジェクト構造

セレクター-ai-mcp/

├── selector_fastmcp_server.py # Server: MCP + Selector AI integration ├── selector_client.py # Client: Docker + stdin/stdout CLI ├── Dockerfile # Container config ├── requirements.txt # Python deps ├── .env # Environment secrets └── README.md # You are here

✅ 要件

requirements.txt 内の依存関係:

リクエスト

Python-dotenv

📜 ライセンス

Apacheライセンス2.0

-
security - not tested
A
license - permissive license
-
quality - not tested

ストリーミング対応サーバーと、stdin/stdout を介して通信する Docker ベースのクライアントを通じて、Selector AI とのリアルタイムのインタラクティブな AI チャットを可能にするモデル コンテキスト プロトコル (MCP) サーバー。

Appeared in Searches

ID: z6gj8vdi7r