# 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.2.1/integrations/mcp.md.

Give any MCP client 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) 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 project `.mcp.json`, restart, and ask for project defaults, a sandbox,
   hello 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.2.1/integrations/claude.md),
[Cursor](https://docs.hermitbox.dev/v0.2.1/integrations/cursor.md), [Codex](https://docs.hermitbox.dev/v0.2.1/integrations/codex.md), or [VS Code and Copilot](https://docs.hermitbox.dev/v0.2.1/integrations/vscode.md). A named isolation or
capability the host lacks is refused. See [MCP tools and transports](https://docs.hermitbox.dev/v0.2.1/reference/mcp.md) and
[tier boundaries](https://docs.hermitbox.dev/v0.2.1/reference/tiers.md).
