# Connect VS Code and Copilot

> Let your agent do it: Connect Copilot's agent mode in VS Code to my remote Hermitbox install through `hermitbox mcp`. Install the Hermitbox CLI where the Copilot MCP process runs, start VS Code with `HERMITBOX_API_URL` and `HERMITBOX_API_KEY` in its private environment, and merge the page's server entry into `~/.copilot/mcp-config.json`, which names the variables and never their values. After restarting the agent harness, 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/vscode.md.

Copilot's agent mode in VS Code gets tools to 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#vs-code) sets it up without a key.

1. Install the [Hermitbox CLI](https://docs.hermitbox.dev/v0.3.2/get-started/cli.md) where the Copilot MCP process runs.
2. Start VS Code with `HERMITBOX_API_URL` and `HERMITBOX_API_KEY` in its private environment.
3. Merge this into `~/.copilot/mcp-config.json` and restart the native agent harness. Ask it for
   the project's defaults, a sandbox, `echo hello` in it and cleanup. Use an image only for
   containers.

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

The current [VS Code reference](https://code.visualstudio.com/docs/agents/reference/mcp-configuration)
defines this native-harness file and the shared project configurations; `COPILOT_HOME` moves its
directory. Host [tier boundaries](https://docs.hermitbox.dev/v0.3.2/reference/tiers.md) still apply.
