Overview

Container Use works with any coding agent that supports the Model Context Protocol (MCP). This page provides comprehensive setup guides for all supported agents.

All agents use the same MCP server command: cu stdio

Claude Code

Install Claude Code

npm install -g @anthropic-ai/claude-code

Add MCP Configuration

cd /path/to/repository
claude mcp add container-use -- <full path to cu command> stdio

Add Agent Rules (Optional)

Save the CLAUDE.md file at the root of your repository:

curl https://raw.githubusercontent.com/dagger/container-use/main/rules/agent.md >> CLAUDE.md

Trust Only Container Use Tools (Optional)

For maximum security, restrict Claude Code to only use Container Use tools:

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

Amazon Q Developer

Add MCP Configuration

Add this configuration to ~/.aws/amazonq/mcp.json:

{
  "mcpServers": {
    "container-use": {
      "command": "cu",
      "args": ["stdio"],
      "env": {},
      "timeout": 60000
    }
  }
}

Add Agent Rules

Save agent instructions to your project root:

mkdir -p ./.amazonq/rules && curl https://raw.githubusercontent.com/dagger/container-use/main/rules/agent.md > .amazonq/rules/container-use.md

Trust Only Container Use Tools (Optional)

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

Video Tutorial

Watch the Amazon Q Developer setup walkthrough

Cursor

Install MCP Server

Use the one-click deeplink to install (requires Cursor and Container Use already installed):

Add Agent Rules

Add the rules file to your project or home directory:

curl --create-dirs -o .cursor/rules/container-use.mdc https://raw.githubusercontent.com/dagger/container-use/main/rules/cursor.mdc

Windsurf

Install MCP Server

In ~/.codeium/windsurf/mcp_config.json, add the following configuration:

{
  "mcpServers": {
    "container-use": {
      "command": "cu",
      "args": ["stdio"],
      "env": {}
    }
  }
}

Add Agent Rules

Add the rules file to your project or home directory:

curl --create-dirs -o .windsurf/rules/container-use.mdc https://raw.githubusercontent.com/dagger/container-use/main/rules/windsurf.mdc

VSCode / GitHub Copilot

Configure MCP Server

Update your VSCode settings with:

"mcp": {
  "servers": {
    "container-use": {
      "type": "stdio",
      "command": "cu",
      "args": ["stdio"]
    }
  }
}

Add Copilot Instructions (Optional)

curl --create-dirs -o .github/copilot-instructions.md https://raw.githubusercontent.com/dagger/container-use/main/rules/agent.md

Video Tutorial

Watch the VSCode setup walkthrough

Zed

First add the agent rules file, either as .rules in the root of your project or as one of the other acceptable files/locations.

curl -o .rules https://raw.githubusercontent.com/dagger/container-use/main/rules/agent.md

Then configure the Container Use MCP server in the Zed settings.json. Provide the absolute path to the cu executable:

"context_servers": {
  "container-use": {
    "source": "custom",
    "command": {
      "path": "/opt/homebrew/bin/cu",
      "args": ["stdio"],
      "env": {}
    }
  }
}

Next open the Zed Agent Panel ✨ in the lower right and prompt away!

Goose

Method 1: Configuration File

Add to ~/.config/goose/config.yaml:

extensions:
  container-use:
    name: container-use
    type: stdio
    enabled: true
    cmd: cu
    args:
      - stdio
    envs: {}

Method 2: Interactive Setup

goose configure

Then add a command line extension with cu stdio as the command.

Method 3: Goose Desktop

Paste this URL into your browser:

goose://extension?cmd=cu&arg=stdio&id=container-use&name=container%20use&description=use%20containers%20with%20dagger%20and%20git%20for%20isolated%20environments

Cline

Add MCP Configuration

Add to your Cline MCP server configuration JSON:

{
  "mcpServers": {
    "container-use": {
      "disabled": false,
      "timeout": 60000,
      "type": "stdio",
      "command": "cu",
      "args": ["stdio"],
      "env": {},
      "autoApprove": []
    }
  }
}

Add Agent Rules

curl --create-dirs -o .clinerules/container-use.md https://raw.githubusercontent.com/dagger/container-use/main/rules/agent.md

Qodo Gen

Setup Steps

  1. Open Qodo Gen chat panel in VSCode or IntelliJ
  2. Click “Connect more tools”
  3. Click ”+ Add new MCP”
  4. Add this configuration:
{
  "mcpServers": {
    "container-use": {
      "command": "cu",
      "args": ["stdio"]
    }
  }
}

Kilo Code

Add MCP Configuration

Add at global or project level:

{
  "mcpServers": {
    "container-use": {
      "command": "replace with pathname of cu",
      "args": ["stdio"],
      "env": {},
      "alwaysAllow": [],
      "disabled": false
    }
  }
}

Kilo Code allows setting MCP servers at the global or project level. Learn more: Kilo Code MCP Documentation

OpenAI Codex

Add MCP Configuration

Add to ~/.codex/config.toml:

[mcp_servers.container-use]
command = "cu"
args = ["stdio"]
env = {}

Warp

Add MCP Configuration

In the Warp sidebar, under Personal → MCP Servers → New:

{
  "container-use": {
    "command": "cu",
    "args": ["stdio"],
    "env": {},
    "working_directory": null,
    "start_on_launch": true
  }
}
Warp 2.0 introduces coding agents with MCP support.

Gemini CLI

Add MCP Configuration

Add to ~/.gemini/settings.json or .gemini/settings.json:

{
  "coreTools": [],
  "mcpServers": {
    "container-use": {
      "command": "cu",
      "args": ["stdio"],
      "timeout": 60000,
      "trust": true
    }
  }
}

Verification

After setting up your agent, verify Container Use is working:

  1. Check MCP Connection: Your agent should recognize Container Use tools
  2. Test Environment Creation: Ask your agent to create a new environment
  3. Verify Isolation: Multiple environments should work independently

Troubleshooting

Next Steps