MCP over HTTP
bobby serve exposes the MCP tools at POST /v1/mcp for clients that connect by URL, such as sandboxes and remote agents. Tools are listed in MCP tools. For a local agent host, MCP stdio is simpler.
Connect
Authentication is a bearer token only. This route does not take x-interface-version, x-correlation-id or x-deadline.
{
"mcpServers": {
"bobby-browser": {
"url": "http://127.0.0.1:7777/v1/mcp",
"transport": "streamable-http",
"headers": { "Authorization": "Bearer ${AUTOMATION_RUNTIME_TOKEN}" }
}
}
}Check the connection:
curl -sS http://127.0.0.1:7777/v1/mcp \
-H "Authorization: Bearer ${AUTOMATION_RUNTIME_TOKEN}" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-11-25","capabilities":{},"clientInfo":{"name":"curl","version":"0"}}}'Behavior
- Each
POSTcarries one JSON-RPC message. Sendinitializefirst. GET /v1/mcpopens a server-sent event stream with the principal's events asnotifications/bobby/eventandnotifications/tools/list_changedframes. An idle stream sends a keep-alive comment every 15 seconds. A principal withoutsession:readgets only control frames.- MCP state is per principal. Clients sharing a principal share initialization state, so a new
initializeresets all of them. Issue one principal per client to isolate them. - Rotating or replacing a bearer resets that principal's state. Send
initializeagain.
See Authentication to issue scoped tokens and OpenShell host for sandboxes.