ChatGPT Orchestrator MCP Server
Servidor MCP del Orquestador de ChatGPT
Un servidor MCP remoto mínimo en Python para el esquema:
ChatGPT -> MCP server -> main orchestrator -> helper agentsEn la primera etapa, el servidor contiene una herramienta:
run_orchestratorentrada:
goal: stringsalida: JSON simple
Actualmente, contiene un stub. Más adelante, puede reemplazarlo con la llamada a su agente principal real.
Por qué FastMCP
Se eligió FastMCP porque permite describir una herramienta MCP con una función de Python normal y ejecutar inmediatamente un endpoint MCP remoto a través de HTTP. Para conectarse a ChatGPT, se necesita un endpoint HTTPS público del tipo /mcp.
Related MCP server: native-agent-router
Estructura del proyecto
.
├── .gitignore
├── server.py
├── requirements.txt
├── Procfile
├── render.yaml
└── README.mdEjecución local
Requisitos:
Python 3.11+
pip
1. Crear un entorno virtual
PowerShell:
python -m venv .venv
.\.venv\Scripts\Activate.ps1Si en Windows el comando python abre la Microsoft Store o no muestra la versión, utilice:
py -3.11 -m venv .venv
.\.venv\Scripts\Activate.ps1macOS/Linux:
python3 -m venv .venv
source .venv/bin/activate2. Instalar dependencias
pip install -r requirements.txt3. Iniciar el servidor
python server.pyEndpoint MCP local:
http://localhost:8000/mcpVerificación básica de que el servidor está activo:
http://localhost:8000/healthSi el cliente solicita un endpoint con una barra diagonal al final, utilice:
http://localhost:8000/mcp/Verificación local
Deje python server.py ejecutándose. En una segunda terminal, ejecute:
Invoke-RestMethod http://localhost:8000/healthRespuesta esperada:
{
"status": "ok"
}Importante: si abre http://localhost:8000/mcp en el navegador o lo consulta con un curl normal sin encabezados MCP, es posible que vea un error:
{
"error": {
"message": "Not Acceptable: Client must accept text/event-stream"
}
}Esto es normal para un endpoint MCP. Verifique /health con un navegador normal y /mcp con un cliente 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())
'@ | pythonSignificado esperado de la respuesta: el servidor mostrará la herramienta run_orchestrator y devolverá un JSON indicando que el stub ha recibido la tarea.
También puede verificarlo a través del Inspector MCP:
npx @modelcontextprotocol/inspectorEn la interfaz, seleccione el transporte Streamable HTTP y la URL:
http://localhost:8000/mcpDespliegue en Render
Opción a través de GitHub
Cree un nuevo repositorio en GitHub.
Suba estos archivos allí.
Abra Render.
Haga clic en
New->Web Service.Conecte el repositorio de GitHub.
Render normalmente leerá
render.yamlautomáticamente.Si lo configura manualmente:
Runtime:
PythonBuild Command:
pip install -r requirements.txtStart Command:
python server.py
Haga clic en
Deploy.
Después del despliegue, Render proporcionará una URL similar a esta:
https://chatgpt-orchestrator-mcp.onrender.comEl endpoint MCP de producción será:
https://chatgpt-orchestrator-mcp.onrender.com/mcpEndpoint de salud de producción para verificar en el navegador:
https://chatgpt-orchestrator-mcp.onrender.com/healthEsta es la URL que debe insertar en ChatGPT.
Cómo conectar a ChatGPT
Abra ChatGPT en el navegador.
Vaya a
Settings.Abra
Apps & ConnectorsoConnectors.Active el Developer Mode si aún no está activado:
Advanced settingsDeveloper mode
Haga clic en
CreateoCreate connector.Complete los campos:
Name:
OrchestratorDescription:
Runs my main orchestrator agent through MCP.Connector URL:
https://YOUR-RENDER-SERVICE.onrender.com/mcp
Guarde.
En un nuevo chat, seleccione este conector/herramienta y pídale a ChatGPT que llame al orquestador.
Ejemplo de solicitud de prueba en ChatGPT
Используй Orchestrator и вызови run_orchestrator с goal:
"Составь пошаговый план запуска MVP моего продукта"La respuesta esperada de la herramienta ahora será aproximadamente:
{
"status": "ok",
"message": "Stub orchestrator accepted the goal.",
"goal": "Составь пошаговый план запуска MVP моего продукта",
"next_step": "Replace call_real_orchestrator() in server.py with your real agent call."
}Dónde reemplazar el stub por el agente real
Abra server.py y busque la función:
def call_real_orchestrator(goal: str) -> dict[str, Any]:Actualmente devuelve un JSON de prueba. Más adelante, reemplace su cuerpo con la llamada real a su agente principal.
Ejemplo de reemplazo futuro:
def call_real_orchestrator(goal: str) -> dict[str, Any]:
result = my_main_agent.run(goal)
return {
"status": "ok",
"goal": goal,
"result": result,
}Importante: no cree un servidor MCP separado para cada agente auxiliar en la primera etapa. Deje que ChatGPT vea solo una herramienta run_orchestrator, y que su agente principal decida internamente a qué auxiliares llamar.
URLs finales
Localmente:
http://localhost:8000/mcpPlantilla de URL de producción:
https://YOUR-RENDER-SERVICE.onrender.com/mcpURL para ChatGPT:
https://YOUR-RENDER-SERVICE.onrender.com/mcpDocumentos oficiales útiles
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