# Connect Claude Code

> Let your agent do it: Connect Claude Code to my remote Hermitbox install through `hermitbox mcp`. Install the Hermitbox CLI where Claude Code runs, start Claude Code with `HERMITBOX_API_URL` and `HERMITBOX_API_KEY` in its private environment, and merge the page's server entry into the project's `.mcp.json`, which names the variables and never their values. After a restart, ask the server for the project's defaults, create a sandbox, run `echo hello` in it and delete it. Never copy the key into the file or this chat. Follow the exact steps in https://docs.hermitbox.dev/v0.2.1/integrations/claude.md.

Give Claude Code the Hermitbox tools for a remote install through `hermitbox mcp` over stdio.
On the machine where you ran the installer, use the keyless setup in
[Use Hermitbox with your agent](https://docs.hermitbox.dev/v0.2.1/get-started/agents.md) instead.

1. Install the [Hermitbox CLI](https://docs.hermitbox.dev/v0.2.1/get-started/cli.md) where Claude Code runs.
2. Start Claude Code with `HERMITBOX_API_URL` and `HERMITBOX_API_KEY` in its private environment.
3. Merge this into project `.mcp.json`, restart, and ask for project defaults, a sandbox,
   hello and cleanup. Container defaults need an image; process and Wasm must omit it.

```json
{
  "mcpServers": {
    "hermitbox": {
      "type": "stdio",
      "command": "hermitbox",
      "args": ["mcp"],
      "env": {
        "HERMITBOX_API_URL": "${HERMITBOX_API_URL}",
        "HERMITBOX_API_KEY": "${HERMITBOX_API_KEY}"
      }
    }
  }
}
```

[Claude Code's reference](https://code.claude.com/docs/en/mcp) defines this file and its
variable expansion. Host admission enforces [tier limits](https://docs.hermitbox.dev/v0.2.1/reference/tiers.md), so an agent
can't grant a capability the host lacks.
