# 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.2.4/integrations/vscode.md.

Give Copilot's agent mode in VS 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.4/get-started/agents.md#vs-code) instead.

1. Install the [Hermitbox CLI](https://docs.hermitbox.dev/v0.2.4/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`, restart the native agent harness, and ask for
   project defaults, a sandbox, hello 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 `COPILOT_HOME` can move its directory. The same reference
describes shared project configurations. Host [tier boundaries](https://docs.hermitbox.dev/v0.2.4/reference/tiers.md) still
apply.
