|
| 1 | +--- |
| 2 | +title: Agents |
| 3 | +description: "Complete setup guides for all supported coding agents. Configure Container Use with Claude Code, Cursor, VSCode, Goose, and more." |
| 4 | +icon: robot |
| 5 | +--- |
| 6 | + |
| 7 | +## Overview |
| 8 | + |
| 9 | +Container Use works with any coding agent that supports the Model Context Protocol (MCP). This page provides comprehensive setup guides for all supported agents. |
| 10 | + |
| 11 | +<Note>All agents use the same MCP server command: `cu stdio`</Note> |
| 12 | + |
| 13 | +## Claude Code |
| 14 | + |
| 15 | +### Install Claude Code |
| 16 | + |
| 17 | +```sh |
| 18 | +npm install -g @anthropic-ai/claude-code |
| 19 | +``` |
| 20 | + |
| 21 | +### Add MCP Configuration |
| 22 | + |
| 23 | +```sh |
| 24 | +cd /path/to/repository |
| 25 | +claude mcp add container-use -- <full path to cu command> stdio |
| 26 | +``` |
| 27 | + |
| 28 | +### Add Agent Rules (Optional) |
| 29 | + |
| 30 | +Save the CLAUDE.md file at the root of your repository: |
| 31 | + |
| 32 | +```sh |
| 33 | +curl https://raw.githubusercontent.com/dagger/container-use/main/rules/agent.md >> CLAUDE.md |
| 34 | +``` |
| 35 | + |
| 36 | +### Trust Only Container Use Tools (Optional) |
| 37 | + |
| 38 | +For maximum security, restrict Claude Code to only use Container Use tools: |
| 39 | + |
| 40 | +```sh |
| 41 | +claude --allowedTools mcp__container-use__environment_checkpoint,mcp__container-use__environment_create,mcp__container-use__environment_add_service,mcp__container-use__environment_file_delete,mcp__container-use__environment_file_list,mcp__container-use__environment_file_read,mcp__container-use__environment_file_write,mcp__container-use__environment_open,mcp__container-use__environment_run_cmd,mcp__container-use__environment_update |
| 42 | +``` |
| 43 | + |
| 44 | +<Info> |
| 45 | + Learn more: [Claude Code MCP |
| 46 | + Documentation](https://docs.anthropic.com/en/docs/claude-code/tutorials#set-up-model-context-protocol-mcp) |
| 47 | +</Info> |
| 48 | + |
| 49 | +## Amazon Q Developer |
| 50 | + |
| 51 | +### Add MCP Configuration |
| 52 | + |
| 53 | +Add this configuration to `~/.aws/amazonq/mcp.json`: |
| 54 | + |
| 55 | +```json |
| 56 | +{ |
| 57 | + "mcpServers": { |
| 58 | + "container-use": { |
| 59 | + "command": "cu", |
| 60 | + "args": ["stdio"], |
| 61 | + "env": {}, |
| 62 | + "timeout": 60000 |
| 63 | + } |
| 64 | + } |
| 65 | +} |
| 66 | +``` |
| 67 | + |
| 68 | +### Add Agent Rules |
| 69 | + |
| 70 | +Save agent instructions to your project root: |
| 71 | + |
| 72 | +```sh |
| 73 | +mkdir -p ./.amazonq/rules && curl https://raw.githubusercontent.com/dagger/container-use/main/rules/agent.md > .amazonq/rules/container-use.md |
| 74 | +``` |
| 75 | + |
| 76 | +### Trust Only Container Use Tools (Optional) |
| 77 | + |
| 78 | +```sh |
| 79 | +q chat --trust-tools=container_use___environment_checkpoint,container_use___environment_file_delete,container_use___environment_file_list,container_use___environment_file_read,container_use___environment_file_write,container_use___environment_open,container_use___environment_run_cmd,container_use___environment_update |
| 80 | +``` |
| 81 | + |
| 82 | +<Card title="Video Tutorial" icon="youtube" href="https://youtu.be/C2g3vdbffOI"> |
| 83 | + Watch the Amazon Q Developer setup walkthrough |
| 84 | +</Card> |
| 85 | + |
| 86 | +## Cursor |
| 87 | + |
| 88 | +### Install MCP Server |
| 89 | + |
| 90 | +Use the one-click deeplink to install (requires Cursor and Container Use already installed): |
| 91 | + |
| 92 | +[](https://cursor.com/install-mcp?name=container-use&config=eyJjb21tYW5kIjoiY3Ugc3RkaW8ifQ%3D%3D) |
| 93 | + |
| 94 | +### Add Agent Rules |
| 95 | + |
| 96 | +Add the rules file to your project or home directory: |
| 97 | + |
| 98 | +```sh |
| 99 | +curl --create-dirs -o .cursor/rules/container-use.mdc https://raw.githubusercontent.com/dagger/container-use/main/rules/cursor.mdc |
| 100 | +``` |
| 101 | + |
| 102 | +<Info> |
| 103 | + Learn more: [Cursor MCP |
| 104 | + Documentation](https://docs.cursor.com/context/model-context-protocol) |
| 105 | +</Info> |
| 106 | + |
| 107 | +## VSCode / GitHub Copilot |
| 108 | + |
| 109 | +### Configure MCP Server |
| 110 | + |
| 111 | +Update your VSCode settings with: |
| 112 | + |
| 113 | +```json |
| 114 | +"mcp": { |
| 115 | + "servers": { |
| 116 | + "container-use": { |
| 117 | + "type": "stdio", |
| 118 | + "command": "cu", |
| 119 | + "args": ["stdio"] |
| 120 | + } |
| 121 | + } |
| 122 | +} |
| 123 | +``` |
| 124 | + |
| 125 | +### Add Copilot Instructions (Optional) |
| 126 | + |
| 127 | +```sh |
| 128 | +curl --create-dirs -o .github/copilot-instructions.md https://raw.githubusercontent.com/dagger/container-use/main/rules/agent.md |
| 129 | +``` |
| 130 | + |
| 131 | +<Card title="Video Tutorial" icon="youtube" href="https://youtu.be/Nz2sOef0gW0"> |
| 132 | + Watch the VSCode setup walkthrough |
| 133 | +</Card> |
| 134 | + |
| 135 | +<Info> |
| 136 | + Learn more: [VSCode |
| 137 | + MCP](https://code.visualstudio.com/docs/copilot/chat/mcp-servers) | [GitHub |
| 138 | + Copilot |
| 139 | + MCP](https://docs.github.com/en/copilot/customizing-copilot/extending-copilot-chat-with-mcp) |
| 140 | +</Info> |
| 141 | + |
| 142 | +## Goose |
| 143 | + |
| 144 | +### Method 1: Configuration File |
| 145 | + |
| 146 | +Add to `~/.config/goose/config.yaml`: |
| 147 | + |
| 148 | +```yaml |
| 149 | +extensions: |
| 150 | + container-use: |
| 151 | + name: container-use |
| 152 | + type: stdio |
| 153 | + enabled: true |
| 154 | + cmd: cu |
| 155 | + args: |
| 156 | + - stdio |
| 157 | + envs: {} |
| 158 | +``` |
| 159 | +
|
| 160 | +### Method 2: Interactive Setup |
| 161 | +
|
| 162 | +```sh |
| 163 | +goose configure |
| 164 | +``` |
| 165 | + |
| 166 | +Then add a command line extension with `cu stdio` as the command. |
| 167 | + |
| 168 | +### Method 3: Goose Desktop |
| 169 | + |
| 170 | +Paste this URL into your browser: |
| 171 | + |
| 172 | +``` |
| 173 | +goose://extension?cmd=cu&arg=stdio&id=container-use&name=container%20use&description=use%20containers%20with%20dagger%20and%20git%20for%20isolated%20environments |
| 174 | +``` |
| 175 | + |
| 176 | +<Info> |
| 177 | + Learn more: [Goose MCP |
| 178 | + Extensions](https://block.github.io/goose/docs/getting-started/using-extensions#mcp-servers) |
| 179 | +</Info> |
| 180 | + |
| 181 | +## Cline |
| 182 | + |
| 183 | +### Add MCP Configuration |
| 184 | + |
| 185 | +Add to your Cline MCP server configuration JSON: |
| 186 | + |
| 187 | +```json |
| 188 | +{ |
| 189 | + "mcpServers": { |
| 190 | + "container-use": { |
| 191 | + "disabled": false, |
| 192 | + "timeout": 60000, |
| 193 | + "type": "stdio", |
| 194 | + "command": "cu", |
| 195 | + "args": ["stdio"], |
| 196 | + "env": {}, |
| 197 | + "autoApprove": [] |
| 198 | + } |
| 199 | + } |
| 200 | +} |
| 201 | +``` |
| 202 | + |
| 203 | +### Add Agent Rules |
| 204 | + |
| 205 | +```sh |
| 206 | +curl --create-dirs -o .clinerules/container-use.md https://raw.githubusercontent.com/dagger/container-use/main/rules/agent.md |
| 207 | +``` |
| 208 | + |
| 209 | +<Info>Learn more: [Cline Documentation](https://cline.bot/)</Info> |
| 210 | + |
| 211 | +## Qodo Gen |
| 212 | + |
| 213 | +### Setup Steps |
| 214 | + |
| 215 | +1. Open Qodo Gen chat panel in VSCode or IntelliJ |
| 216 | +2. Click "Connect more tools" |
| 217 | +3. Click "+ Add new MCP" |
| 218 | +4. Add this configuration: |
| 219 | + |
| 220 | +```json |
| 221 | +{ |
| 222 | + "mcpServers": { |
| 223 | + "container-use": { |
| 224 | + "command": "cu", |
| 225 | + "args": ["stdio"] |
| 226 | + } |
| 227 | + } |
| 228 | +} |
| 229 | +``` |
| 230 | + |
| 231 | +<Info> |
| 232 | + Learn more: [Qodo Gen MCP |
| 233 | + Documentation](https://docs.qodo.ai/qodo-documentation/qodo-gen/qodo-gen-chat/agentic-mode/agentic-tools-mcps) |
| 234 | +</Info> |
| 235 | + |
| 236 | +## Kilo Code |
| 237 | + |
| 238 | +### Add MCP Configuration |
| 239 | + |
| 240 | +Add at global or project level: |
| 241 | + |
| 242 | +```json |
| 243 | +{ |
| 244 | + "mcpServers": { |
| 245 | + "container-use": { |
| 246 | + "command": "replace with pathname of cu", |
| 247 | + "args": ["stdio"], |
| 248 | + "env": {}, |
| 249 | + "alwaysAllow": [], |
| 250 | + "disabled": false |
| 251 | + } |
| 252 | + } |
| 253 | +} |
| 254 | +``` |
| 255 | + |
| 256 | +<Info> |
| 257 | + Kilo Code allows setting MCP servers at the global or project level. Learn |
| 258 | + more: [Kilo Code MCP |
| 259 | + Documentation](https://kilocode.ai/docs/features/mcp/using-mcp-in-kilo-code) |
| 260 | +</Info> |
| 261 | + |
| 262 | +## OpenAI Codex |
| 263 | + |
| 264 | +### Add MCP Configuration |
| 265 | + |
| 266 | +Add to `~/.codex/config.toml`: |
| 267 | + |
| 268 | +```toml |
| 269 | +[mcp_servers.container-use] |
| 270 | +command = "cu" |
| 271 | +args = ["stdio"] |
| 272 | +env = {} |
| 273 | +``` |
| 274 | + |
| 275 | +<Info> |
| 276 | + Learn more: [OpenAI Codex |
| 277 | + Documentation](https://github.com/openai/codex/tree/main/codex-rs) |
| 278 | +</Info> |
| 279 | + |
| 280 | +## Warp |
| 281 | + |
| 282 | +### Add MCP Configuration |
| 283 | + |
| 284 | +In the Warp sidebar, under Personal → MCP Servers → New: |
| 285 | + |
| 286 | +```json |
| 287 | +{ |
| 288 | + "container-use": { |
| 289 | + "command": "cu", |
| 290 | + "args": ["stdio"], |
| 291 | + "env": {}, |
| 292 | + "working_directory": null, |
| 293 | + "start_on_launch": true |
| 294 | + } |
| 295 | +} |
| 296 | +``` |
| 297 | + |
| 298 | +<Info>Warp 2.0 introduces coding agents with MCP support.</Info> |
| 299 | + |
| 300 | +## Gemini CLI |
| 301 | + |
| 302 | +### Add MCP Configuration |
| 303 | + |
| 304 | +Add to `~/.gemini/settings.json` or `.gemini/settings.json`: |
| 305 | + |
| 306 | +```json |
| 307 | +{ |
| 308 | + "coreTools": [], |
| 309 | + "mcpServers": { |
| 310 | + "container-use": { |
| 311 | + "command": "cu", |
| 312 | + "args": ["stdio"], |
| 313 | + "timeout": 60000, |
| 314 | + "trust": true |
| 315 | + } |
| 316 | + } |
| 317 | +} |
| 318 | +``` |
| 319 | + |
| 320 | +<Info> |
| 321 | + Learn more: [Gemini CLI |
| 322 | + Configuration](https://github.com/google-gemini/gemini-cli/blob/main/docs/cli/configuration.md) |
| 323 | +</Info> |
| 324 | + |
| 325 | +## Verification |
| 326 | + |
| 327 | +After setting up your agent, verify Container Use is working: |
| 328 | + |
| 329 | +1. **Check MCP Connection**: Your agent should recognize Container Use tools |
| 330 | +2. **Test Environment Creation**: Ask your agent to create a new environment |
| 331 | +3. **Verify Isolation**: Multiple environments should work independently |
| 332 | + |
| 333 | +## Troubleshooting |
| 334 | + |
| 335 | +<AccordionGroup> |
| 336 | + <Accordion title="Agent doesn't recognize Container Use"> |
| 337 | + - Verify the `cu` command is in your PATH: `which cu` |
| 338 | + - Check MCP configuration syntax |
| 339 | + - Restart your agent after configuration changes |
| 340 | + </Accordion> |
| 341 | + |
| 342 | +{" "} |
| 343 | + |
| 344 | +<Accordion title="Permission errors"> |
| 345 | + - Ensure Docker is running and accessible - Check file permissions for |
| 346 | + configuration files - Verify `cu stdio` command works: `echo '{}' | cu stdio` |
| 347 | +</Accordion> |
| 348 | + |
| 349 | + <Accordion title="Tools not appearing"> |
| 350 | + - Some agents require explicit tool trust/approval |
| 351 | + - Check your agent's MCP server logs |
| 352 | + - Verify Container Use tools are enabled in agent settings |
| 353 | + </Accordion> |
| 354 | +</AccordionGroup> |
| 355 | + |
| 356 | +## Next Steps |
| 357 | + |
| 358 | +<CardGroup cols={2}> |
| 359 | + <Card title="Back to Quickstart" icon="rocket" href="/quickstart"> |
| 360 | + Return to the quickstart guide to create your first environment |
| 361 | + </Card> |
| 362 | + <Card |
| 363 | + title="Join Community" |
| 364 | + icon="discord" |
| 365 | + href="https://discord.gg/YXbtwRQv" |
| 366 | + > |
| 367 | + Get help and share experiences in #container-use |
| 368 | + </Card> |
| 369 | +</CardGroup> |
0 commit comments