MCP Agent Orchestration System
MCP エージェント オーケストレーション システム
モデル コンテキスト プロトコル (MCP) を使用した状態ベースのエージェント オーケストレーション システムの Python 実装。
MCPとは何ですか?
モデルコンテキストプロトコル(MCP)は、アプリケーションがLLMに標準化された方法でコンテキストを提供することを可能にし、コンテキスト提供の懸念をLLMとの実際のやり取りから分離します。MCPを使用すると、以下の情報を公開するサーバーを構築できます。
リソース: LLMに情報を提供するデータソース
ツール: LLMがアクションを実行できるようにする機能
プロンプト: LLMインタラクション用の再利用可能なテンプレート
Related MCP server: Stratum MCP Server
インストール
前提条件
Python 3.10以上
MCP Python SDK 1.2.0 以上
環境の設定
uvの使用(推奨)
# Install uv
curl -LsSf https://astral.sh/uv/install.sh | sh
# Create a new directory for our project
uv init mcp-agents-orchestra
cd mcp-agents-orchestra
# Create virtual environment and activate it
uv venv
source .venv/bin/activate # On Unix/macOS
.venv\Scripts\activate # On Windows
# Install dependencies
uv add "mcp[cli]" httpxpipの使用
# Create a new directory for our project
mkdir mcp-agents-orchestra
cd mcp-agents-orchestra
# Create a virtual environment
python -m venv venv
source venv/bin/activate # On Unix/macOS
venv\Scripts\activate # On Windows
# Install dependencies
pip install "mcp[cli]" httpxプロジェクトファイルの複製またはダウンロード
プロジェクト ファイルをディレクトリに配置します。
orchestrator.py- ステートマシンを実装するメインの MCP サーバーorchestrator_client.py- オーケストレーションフローを示すクライアントrequirements.txt- プロジェクトの依存関係.gitignore- Git 無視ファイル
プロジェクト構造
orchestrator.py- ステートマシンを実装するメインの MCP サーバーorchestrator_client.py- オーケストレーションフローを示すクライアントrequirements.txt- プロジェクトの依存関係
オーケストレーションシステムの実行
テストのためにオーケストレーション サーバーを直接起動します。
python orchestrator.py別のターミナルでクライアントを実行し、オーケストレーションの動作を確認します。
python orchestrator_client.pyClaude for Desktopとの統合
1.デスクトップ版Claudeをインストールする
Claude for Desktopがインストールされていることを確認してください。最新バージョンはAnthropicのウェブサイトからダウンロードできます。
2. デスクトップ用にClaudeを設定する
Claude for Desktop の構成ファイルを開きます。
macOS/Linux:
# Create or edit the configuration file code ~/Library/Application\ Support/Claude/claude_desktop_config.jsonウィンドウズ:
# Path may vary depending on your Windows version code %APPDATA%\Claude\claude_desktop_config.jsonオーケストレータ サーバーの構成を追加します。
{ "mcpServers": { "agent-orchestrator": { "command": "python", "args": [ "/ABSOLUTE/PATH/TO/YOUR/PROJECT/orchestrator.py" ] } } }パスを、orchestrator.py ファイルへの絶対パスに置き換えます。
設定ファイルを保存し、Claude for Desktop を再起動します。
3. ClaudeでのOrchestratorの使用
設定が完了すると、次のことが可能になります。
デスクトップ版Claudeを開く
サイドバーのMCPサーバーアイコンをクリックします
利用可能なサーバーのリストから「agent-orchestrator」を選択します
オーケストレーションシステムとのやり取りを開始する
クロードは次のことができるようになります:
異なるエージェント状態間の遷移
ナレッジベースから情報を保存および取得する
状態遷移を通じて会話のコンテキストを維持する
州固有のプロンプトにアクセスする
エージェント国家
オーケストレーション システムは、次の状態を持つステート マシンを実装します。
IDLE : 指示を待っています
計画:タスクの構造化された計画を作成する
リサーチ:タスクに必要な情報を収集する
実行:計画された行動を実行する
レビュー:結果を評価し、次のステップを決定する
エラー: エラーや予期しない状況の処理
システムのカスタマイズ
新しい州の追加
状態を
orchestrator.pyのAgentState列挙型に追加します。新しい状態のためのプロンプト関数を作成する
_get_available_transitions()の遷移ロジックを更新しますリソースアクセス関数に新しい状態のハンドラーを追加する
カスタムツールの作成
@mcp.tool()で装飾された関数を作成して新しいツールを追加します。
@mcp.tool()
def my_custom_tool(arg1: str, arg2: int, ctx: Context) -> str:
"""Description of what this tool does
Args:
arg1: Description of arg1
arg2: Description of arg2
"""
# Implementation here
return "Result"開発とテスト
MCP CLIの使用
MCP CLI は開発とテストのためのツールを提供します。
# Install MCP CLI if you haven't already
pip install "mcp[cli]"
# Test your server with the MCP Inspector
mcp dev orchestrator.py
# Install in Claude Desktop
mcp install orchestrator.pyPythonによる手動テスト
from mcp import ClientSession, StdioServerParameters
from mcp.client.stdio import stdio_client
async with stdio_client(StdioServerParameters(command="python", args=["orchestrator.py"])) as (read, write):
async with ClientSession(read, write) as session:
await session.initialize()
# Test state transitions
await session.call_tool("transition_state", arguments={"new_state": "PLANNING"})リソース
ライセンス
このプロジェクトは MIT ライセンスに基づいてライセンスされています - 詳細については LICENSE ファイルを参照してください。
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
No tool schema history has been recorded yet.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Durable agent-to-agent handoffs and shared scratchpad for multi-agent workflows.
AI-powered spec-to-task decomposition and execution orchestration for coding agents.
AI work orchestration for plans, tasks, teams, and coding-agent dispatch.
Sovereign Agent OS — Persistent Memory, Governance & Compliance for AI Agents.
Related MCP Servers
- -licenseNot gradedqualityNot gradedmaintenanceAn orchestration system that breaks down user prompts into actionable tasks and delegates them to specialized agents (Roo Modes) using LangChain.-
- AlicenseNot gradedqualityBmaintenanceEnables AI coding agents to execute formal, stateful workflows with typed contracts, postcondition enforcement, and structured retry logic.1Apache 2.0
- AlicenseAqualityCmaintenanceA persistent state machine and notification system for AI agents to manage complex, multi-step workflows via the Model Context Protocol, preventing context drift by maintaining structured checklists and sending desktop alerts.14162Apache 2.0
- AlicenseNot gradedqualityDmaintenanceOrchestrates AI agents through structured markdown documents, enabling multi-agent workflows with automatic context injection and workflow management.144MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/aviz85/mcp-agents-orchestra'
If you have feedback or need assistance with the MCP directory API, please join our Discord server