ChatGPT Orchestrator MCP Server
ChatGPT Orchestrator MCP Server
以下のスキームのためのPythonによる最小限のremote MCP server:
ChatGPT -> MCP server -> main orchestrator -> helper agents第一段階として、サーバーには1つのツールが含まれています:
run_orchestrator入力:
goal: string出力: シンプルなJSON
内部には現在スタブが配置されています。後ほど、実際のメインエージェントの呼び出しに置き換えることができます。
なぜFastMCPなのか
FastMCPが選ばれた理由は、MCPツールを通常のPython関数として記述し、HTTP経由でremote MCP endpointを即座に起動できるためです。ChatGPTに接続するには、/mcp のようなパブリックなHTTPS endpointが必要です。
Related MCP server: native-agent-router
プロジェクト構造
.
├── .gitignore
├── server.py
├── requirements.txt
├── Procfile
├── render.yaml
└── README.mdローカルでの起動
要件:
Python 3.11+
pip
1. 仮想環境の作成
PowerShell:
python -m venv .venv
.\.venv\Scripts\Activate.ps1Windowsで python コマンドがMicrosoft Storeを開くか、バージョンを表示しない場合は以下を使用してください:
py -3.11 -m venv .venv
.\.venv\Scripts\Activate.ps1macOS/Linux:
python3 -m venv .venv
source .venv/bin/activate2. 依存関係のインストール
pip install -r requirements.txt3. サーバーの起動
python server.pyローカルのMCP endpoint:
http://localhost:8000/mcpサーバーが稼働しているかの通常の確認:
http://localhost:8000/healthクライアントが末尾にスラッシュ付きのendpointを要求する場合は、以下を使用してください:
http://localhost:8000/mcp/ローカルでの検証
python server.py を実行したままにします。2つ目のターミナルで以下を実行します:
Invoke-RestMethod http://localhost:8000/health期待される応答:
{
"status": "ok"
}重要: ブラウザで http://localhost:8000/mcp を開いたり、MCPヘッダーなしで通常の curl を実行したりすると、エラーが表示されることがあります:
{
"error": {
"message": "Not Acceptable: Client must accept text/event-stream"
}
}これはMCP endpointとしては正常です。/health は通常のブラウザで確認し、/mcp はMCPクライアントで確認してください。
@'
import asyncio
from fastmcp import Client
async def main():
async with Client("http://localhost:8000/mcp") as client:
tools = await client.list_tools()
print("TOOLS:")
for tool in tools:
print("-", tool.name)
result = await client.call_tool(
"run_orchestrator",
{"goal": "Create an MVP launch plan"}
)
print("RESULT:")
print(result)
asyncio.run(main())
'@ | python期待される応答の意味: サーバーは run_orchestrator ツールを表示し、スタブがタスクを受け取ったというテキストを含むJSONを返します。
MCP Inspector経由でも確認できます:
npx @modelcontextprotocol/inspectorUIで transport に Streamable HTTP を選択し、URLを入力します:
http://localhost:8000/mcpRenderへのデプロイ
GitHub経由のオプション
新しいGitHubリポジトリを作成します。
これらのファイルをそこにアップロードします。
Renderを開きます。
New->Web Serviceをクリックします。GitHubリポジトリを接続します。
Renderは通常、自動的に
render.yamlを読み取ります。手動で設定する場合:
Runtime:
PythonBuild Command:
pip install -r requirements.txtStart Command:
python server.py
Deployをクリックします。
デプロイ後、Renderは以下のようなURLを発行します:
https://chatgpt-orchestrator-mcp.onrender.comProduction MCP endpointは以下のようになります:
https://chatgpt-orchestrator-mcp.onrender.com/mcpブラウザで確認するためのProduction health endpoint:
https://chatgpt-orchestrator-mcp.onrender.com/healthこのURLをChatGPTに入力する必要があります。
ChatGPTへの接続方法
ブラウザでChatGPTを開きます。
Settingsに移動します。Apps & ConnectorsまたはConnectorsを開きます。Developer Modeがオフの場合は有効にします:
Advanced settingsDeveloper mode
CreateまたはCreate connectorをクリックします。以下を入力します:
Name:
OrchestratorDescription:
Runs my main orchestrator agent through MCP.Connector URL:
https://YOUR-RENDER-SERVICE.onrender.com/mcp
保存します。
新しいチャットでこのコネクタ/ツールを選択し、ChatGPTにオーケストレーターを呼び出すよう依頼します。
ChatGPTでのテストリクエスト例
Используй Orchestrator и вызови run_orchestrator с goal:
"Составь пошаговый план запуска MVP моего продукта"ツールからの期待される応答は現在以下のようになります:
{
"status": "ok",
"message": "Stub orchestrator accepted the goal.",
"goal": "Составь пошаговый план запуска MVP моего продукта",
"next_step": "Replace call_real_orchestrator() in server.py with your real agent call."
}スタブを実際のエージェントに置き換える場所
server.py を開き、以下の関数を探します:
def call_real_orchestrator(goal: str) -> dict[str, Any]:現在はテスト用のJSONを返しています。後ほど、その本体を実際のメインエージェントの呼び出しに置き換えてください。
将来の置き換え例:
def call_real_orchestrator(goal: str) -> dict[str, Any]:
result = my_main_agent.run(goal)
return {
"status": "ok",
"goal": goal,
"result": result,
}重要: 第一段階では、各サブエージェントごとに個別のMCPサーバーを作成しないでください。ChatGPTには run_orchestrator という1つのツールのみを見せ、内部のメインエージェントがどのサブエージェントを呼び出すかを判断するようにしてください。
最終的なURL
ローカル:
http://localhost:8000/mcpProduction URLテンプレート:
https://YOUR-RENDER-SERVICE.onrender.com/mcpChatGPT用URL:
https://YOUR-RENDER-SERVICE.onrender.com/mcp役立つ公式ドキュメント
This server cannot be deployed
Related MCP Connectors
LLM Orchestration Agent (Mcp)
MCP-Native LLM Orchestration Agent
Discover and call AI agents via MCP. Supports A2A agents and platform agents with async tasks.
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables any MCP client to drive a multi-agent orchestration engine with planning, specialist tools, critic revision, and human-in-the-loop approval for sensitive actions.3MIT
- AlicenseAqualityBmaintenanceEnables orchestrator agents to route coding tasks to native CLI worker agents via MCP, providing tools for agent discovery, task submission, waiting, inspection, and cancellation.53MIT
- FlicenseNot gradedqualityDmaintenanceEnables MCP clients to chat with a single Watson Orchestrate agent by exposing invoke_agent and get_agent tools for sending messages and fetching agent details.-
- AlicenseNot gradedqualityBmaintenanceEnables ChatGPT to interact with Engineering MCP through a secure MCP endpoint, including executing C2C plans and workspace file access with operator approval.Apache 2.0