Keep the OpenAI Agents SDK.
Give your agents your machines.
AI Commander is not an alternative to OpenAI Agents SDK, Claude Code, Codex, ChatGPT, Cursor, GitHub Copilot, Sourcegraph Cody, Grok, Gemini, Windsurf, Continue, Cline, Roo Code, Zed, OpenCode, Qwen Code, goose, Amp, Kilo Code, OpenHands, Amazon Q Developer, Augment Code, Devin, JetBrains Junie, Kiro, Warp, Factory, Crush, LM Studio, Trae, Claude Desktop, or n8n. It is the remote-machine harness those tools plug into over MCP: outbound-only shell, detached jobs that outlive the chat, and file transfer on hardware you already own.
Sibling harness pages: Claude Code · Codex · ChatGPT · Cursor · OpenCode · Factory · Kiro · Warp · Crush · LM Studio · Trae · Claude Desktop · n8n · Gemini — and the rest on Connect your AI client.
Connect the OpenAI Agents SDK (Streamable HTTP)
The OpenAI Agents SDK for Python
(Agents SDK MCP docs)
connects agents to MCP servers over Streamable HTTP, SSE, stdio, or as a hosted tool run by the Responses API.
AI Commander’s hosted endpoint speaks Streamable HTTP, so MCPServerStreamableHttp is the direct fit.
Pass an AI Commander API key from the dashboard as a Bearer header — the SDK docs recommend tokens in headers, not URLs:
import asyncio, os
from agents import Agent, Runner
from agents.mcp import MCPServerStreamableHttp
async def main() -> None:
async with MCPServerStreamableHttp(
name="aicommander",
params={
"url": "https://aicommander.dev/mcp",
"headers": {"Authorization": f"Bearer {os.environ['AIC_API_KEY']}"},
},
cache_tools_list=True,
) as aic:
agent = Agent(
name="Ops agent",
instructions="Use AI Commander to work on my machines. "
"Start long builds as detached jobs.",
mcp_servers=[aic],
)
result = await Runner.run(agent, "On gpu-box, report GPU usage and free disk space.")
print(result.final_output)
asyncio.run(main())
Your Python process holds the MCP connection, so you get the SDK’s local features on AI Commander’s tools:
tool_filter (for example create_static_tool_filter(allowed_tool_names=["list_machines", "remote_job_start", "remote_job_status", "remote_job_logs"])),
require_approval for human-in-the-loop on remote_exec, tool guardrails, retries, and MCP spans in tracing.
Or let the Responses API call it (HostedMCPTool)
With HostedMCPTool, OpenAI’s Responses API connects to a publicly reachable MCP server for the model — AI Commander’s relay is public,
and your machines stay outbound-only behind it. Keep approvals on: "require_approval": "always" plus an
on_approval_request callback that approves read-only tools such as list_machines, session_status, and the job status/log readers,
and escalates the rest.
import os
from agents import Agent, HostedMCPTool, MCPToolApprovalFunctionResult, MCPToolApprovalRequest
READ_ONLY = {"list_machines", "session_status", "remote_job_list", "remote_job_status", "remote_job_logs"}
def approve_tool(request: MCPToolApprovalRequest) -> MCPToolApprovalFunctionResult:
if request.data.name in READ_ONLY:
return {"approve": True}
return {"approve": False, "reason": "Escalate to a human reviewer"}
agent = Agent(
name="Ops agent",
tools=[
HostedMCPTool(
tool_config={
"type": "mcp",
"server_label": "aicommander",
"server_url": "https://aicommander.dev/mcp",
"headers": {"Authorization": f"Bearer {os.environ['AIC_API_KEY']}"},
"require_approval": "always",
},
on_approval_request=approve_tool,
)
],
)
Prefer a local stdio bridge?
import os
from agents.mcp import MCPServerStdio
aic = MCPServerStdio(
name="aicommander",
params={
"command": "npx",
"args": ["-y", "@aicommander/mcp"],
"env": {
"AICOMMANDER_SERVER": "https://aicommander.dev",
"AICOMMANDER_TOKEN": os.environ["AIC_API_KEY"],
},
},
)
Use it with async with aic: like the HTTP example. API keys only act while you have opened the AI Commander dashboard in the last 24 hours;
for unattended runs (CI, cron) see Credential security on Connect your AI client.
Long builds and training runs belong in detached jobs (remote_job_start) so a single agent turn does not have to wait.
Using ChatGPT or Codex directly? See Keep ChatGPT and Keep Codex. Full client matrix (OpenAI Agents SDK, Claude Desktop, n8n, Claude Code, Codex, ChatGPT, Cursor, Copilot, Gemini, Trae, Crush, LM Studio, and more, plus REST): Connect your AI client. Class and parameter names can change between SDK releases — check the linked Agents SDK docs for your version.
What you get that the chat alone cannot
- Remote shell on Linux, macOS, and Windows — by session code or saved alias.
- Detached jobs for builds, test suites, and training on the box that has the repo.
- Fleet list + GPU facts so your agent picks the right machine before it burns an hour.
- File courier (Pro) for checkpoints and diffs up to 100 MiB.
- Outbound-only agent on each machine — no inbound ports, no exposed SSH, no VPN to set up.
Not a replacement — a multiplier
| You already use | AI Commander adds |
|---|---|
| OpenAI Agents SDK | MCPServerStreamableHttp(params={"url": "https://aicommander.dev/mcp", …}) or HostedMCPTool |
| Claude Desktop | Customize → Connectors → Add custom connector → https://aicommander.dev/mcp |
| n8n | AI Agent → Tool → MCP Client Tool, Endpoint https://aicommander.dev/mcp, HTTP Streamable |
| Claude Code | claude mcp add --transport http … → remote exec + jobs |
| Codex / ChatGPT | Same MCP endpoint or REST /api/v1/exec |
| Cursor / Continue / Windsurf | npx @aicommander/mcp stdio bridge |
FAQ
MCPServerStreamableHttp(name="aicommander", params={"url": "https://aicommander.dev/mcp", "headers": {"Authorization": "Bearer …"}}), open it with async with, and pass it in mcp_servers=[…] on your Agent. Or add a HostedMCPTool with server_url https://aicommander.dev/mcp so the Responses API calls it. Prefer stdio? Use MCPServerStdio with npx -y @aicommander/mcp. See /howto/ for the full matrix.MCPServerStreamableHttp when you want your own process to hold the connection and apply tool filters, approvals, guardrails, and tracing locally. Use HostedMCPTool when you want OpenAI's Responses API to make the tool calls; keep require_approval on and approve tools with a callback. Either way, your machines stay outbound-only behind the AI Commander relay.Next steps
Install the agent on a machine you control, point MCPServerStreamableHttp at https://aicommander.dev/mcp, then give your agent a real task on a remote box.