Skip to main content

Request

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/list"}'

Response shape

{
  "jsonrpc": "2.0",
  "id": 2,
  "result": {
    "tools": [
      {
        "name": "bash_tool",
        "description": "Execute bash commands in the sandbox. ...",
        "inputSchema": { "type": "object", "properties": {...}, "required": [...] }
      },
      {
        "name": "view",
        "description": "View files and directories. ...",
        "inputSchema": {...}
      },
      {
        "name": "create_file",
        "description": "Create files with auto-parent-directory creation. ...",
        "inputSchema": {...}
      },
      {
        "name": "str_replace",
        "description": "Edit files via find-and-replace with uniqueness validation. ...",
        "inputSchema": {...}
      },
      {
        "name": "sub_agent",
        "description": "Delegate a task to an autonomous Claude Code agent. ...",
        "inputSchema": {...}
      }
    ]
  }
}

Tools

bash_tool

Run arbitrary shell commands inside the sandbox. Streams stdout/stderr with 15-second heartbeats, caps output at 30K chars (first 15K + last 15K), handles semantic exit codes (grep returning 1 is “no match”, not an error). Timeout: COMMAND_TIMEOUT (default 120s). Arguments
NameTypeRequiredPurpose
commandstringYesShell command to execute
descriptionstringYesOne-line description (for logs + UI)
cwdstringNoWorking directory inside the sandbox
timeoutnumberNoOverride COMMAND_TIMEOUT (s)

view

Read files and directories. Returns content with line numbers for text; base64 for binaries; an auto-resized thumbnail for images when the MCP transport supports it. Arguments
NameTypeRequiredPurpose
pathstringYesAbsolute path inside the sandbox
view_range[int, int]NoStart/end lines (1-indexed, inclusive)

create_file

Create a new file. Parent directories are created automatically. Arguments
NameTypeRequiredPurpose
pathstringYesAbsolute path to create
contentstringYesFile contents

str_replace

Find-and-replace a single occurrence. Fails loudly if old_str matches zero or more than one location — forces callers to be specific. Arguments
NameTypeRequiredPurpose
pathstringYesFile to edit
old_strstringYesExact text to find (must be unique)
new_strstringYesReplacement text

sub_agent

Launch Claude Code CLI inside the sandbox as a long-running autonomous agent. Arguments
NameTypeRequiredPurpose
promptstringYesTask description
model"sonnet" | "opus" | "haiku"NoModel alias (resolves to ANTHROPIC_DEFAULT_*_MODEL)
resume_session_idstringNoResume a prior Claude Code session
max_turnsnumberNoOverride SUB_AGENT_MAX_TURNS
See Sub-agents for the full picture.

Next