# Connect agents over MCP

> Let your agent do it: Connect my MCP client to my remote Hermitbox install through `hermitbox mcp`. Install the Hermitbox CLI on the machine running the agent, launch the agent with `HERMITBOX_API_URL` and `HERMITBOX_API_KEY` in its private environment, and merge the page's server entry into the client's settings file in its own variable syntax, naming the variables and never their values. After a restart, ask 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.3.2/integrations/mcp.md.

Any MCP client can create sandboxes, run commands in them, and snapshot, fork, sleep and delete
them, on a Hermitbox install on another machine, through `hermitbox mcp` over stdio.

On the machine where you ran the installer, skip this page: [Connect your
agent](https://docs.hermitbox.dev/v0.3.2/get-started/agents.md) sets your agent up without a key.

1. Install the [Hermitbox CLI](https://docs.hermitbox.dev/v0.3.2/get-started/cli.md) on the machine running your agent.
2. Launch the agent with `HERMITBOX_API_URL` and `HERMITBOX_API_KEY` in its private environment.
3. Merge this into the project's `.mcp.json` and restart the agent. Ask it for the project's
   defaults, a sandbox, `echo hello` in it and cleanup. Use an image only when the default tier is
   container.

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

Each agent reads its own file, with its own variable syntax: see [Claude Code](https://docs.hermitbox.dev/v0.3.2/integrations/claude.md),
[Cursor](https://docs.hermitbox.dev/v0.3.2/integrations/cursor.md), [Codex](https://docs.hermitbox.dev/v0.3.2/integrations/codex.md) or [VS Code and Copilot](https://docs.hermitbox.dev/v0.3.2/integrations/vscode.md). A named isolation or
capability the host lacks is refused. See [MCP tools and transports](https://docs.hermitbox.dev/v0.3.2/reference/mcp.md) and
[tier boundaries](https://docs.hermitbox.dev/v0.3.2/reference/tiers.md).
