Computer Use Server

MCP (Model Context Protocol) endpoint and file server for Computer Use sandbox containers.

MCP Endpoint

URL: POST http://localhost:8081/mcp

Auth: Authorization: Bearer <MCP_API_KEY> (the value of the MCP_API_KEY env var on the server).

Available Tools

Step 1: Initialize (get session ID)

curl -sD - -X POST "http://localhost:8081/mcp" \
  -H "Authorization: Bearer <MCP_API_KEY>" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "X-Chat-Id: my-session" \
  -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}}}'

# Response contains header: mcp-session-id: <SESSION_ID>

Step 2: Call a tool

curl -s -X POST "http://localhost:8081/mcp" \
  -H "Authorization: Bearer <MCP_API_KEY>" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "Mcp-Session-Id: <SESSION_ID>" \
  -H "X-Chat-Id: my-session" \
  -d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"bash_tool","arguments":{"command":"echo Hello","description":"test"}}}'

Required Headers

HeaderDescription
AuthorizationBearer <MCP_API_KEY>
Acceptapplication/json, text/event-stream
X-Chat-IdUnique session ID (one sandbox container per chat ID)
Mcp-Session-IdSession ID from the initialize response (required on subsequent calls)
X-MCP-Servers(optional) Comma-separated external MCP servers for sub_agent — see below

External MCP servers for sub_agent

Pass a comma-separated list of MCP server names via the X-MCP-Servers header; the server writes ~/.mcp.json inside the sandbox before launching Claude Code. Server URLs are built from ANTHROPIC_BASE_URL; auth reuses ANTHROPIC_AUTH_TOKEN.

-H "X-MCP-Servers: confluence,jira" \
-H "X-User-Email: user@example.com"

Full recipe: docs/MCP.md.

File API

GET /files/{chat_id}/{filename}

Download a file from the container's outputs directory

GET /files/{chat_id}/archive

Download all output files as a ZIP archive

POST /api/uploads/{chat_id}/{filename}

Upload a file to the container's uploads directory

GET /api/uploads/{chat_id}/manifest

Manifest of uploaded files (filename → MD5)

System Prompt

Ready-made system prompt that teaches an AI how to use this server (files, skills, tools). Use it in n8n, custom agents, or any integration.

curl http://localhost:8081/system-prompt

The server owns the public URL (PUBLIC_BASE_URL env var) and bakes it into the returned prompt; callers no longer need to pass file_base_url/archive_url query params (legacy, still accepted for backward compatibility).

Documentation & source