Container Use works with any coding agent that supports the Model Context Protocol (MCP) .
All agents use the same MCP server command: container-use stdio
Claude Code
Add MCP Configuration:
cd /path/to/repository
claude mcp add container-use -- container-use 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_add_service,mcp__container-use__environment_checkpoint,mcp__container-use__environment_config,mcp__container-use__environment_create,mcp__container-use__environment_file_delete,mcp__container-use__environment_file_edit,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_metadata
Amazon Q Developer
Add MCP Configuration:
Add this configuration to ~/.aws/amazonq/mcp.json:
{
"mcpServers" : {
"container-use" : {
"command" : "container-use" ,
"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_add_service,container_use___environment_checkpoint,container_use___environment_config,container_use___environment_create,container_use___environment_file_delete,container_use___environment_file_edit,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_metadata
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" : "container-use" ,
"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" : "container-use" ,
"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
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, choose one of the methods to add the Container Use MCP server in Zed:
Extension : Visit the Container Use extension page , open it in Zed, and hit install. Then, follow the configuration instructions that will appear on the modal.
Settings : Add the following snippet on your settings.json:
"context_servers" : {
"container-use" : {
"source" : "custom" ,
"command" : "container-use" ,
"args" : [ "stdio" ],
"env" : {}
},
}
Add Container Use Agent Profile (Optional):
To lock the Zed agent out of your host system, you can create a dedicated agent profile that only enables Container Use tools. Add this to your settings.json under the agent section:
"agent" : {
"profiles" : {
"container-use" : {
"name" : "Container Use" ,
"tools" : {
"fetch" : true ,
"thinking" : true ,
"copy_path" : false ,
"find_path" : false ,
"delete_path" : false ,
"create_directory" : false ,
"list_directory" : false ,
"diagnostics" : false ,
"read_file" : false ,
"open" : false ,
"move_path" : false ,
"grep" : false ,
"edit_file" : false ,
"terminal" : false
},
"enable_all_context_servers" : false ,
"context_servers" : {
"container-use" : {
"tools" : {
"environment_add_service" : true ,
"environment_checkpoint" : true ,
"environment_config" : true ,
"environment_create" : true ,
"environment_file_delete" : true ,
"environment_file_edit" : true ,
"environment_file_list" : true ,
"environment_file_read" : true ,
"environment_file_write" : true ,
"environment_open" : true ,
"environment_run_cmd" : true ,
"environment_update_metadata" : true
}
}
}
}
}
}
This profile ensures your agent can only use Container Use tools, preventing it from modifying your local files directly.
Next open the Zed Agent Panel ✨ in the lower right, select the “Container Use” profile from the dropdown to the left of the model dropdown, and prompt away!
OpenCode
Configure the Container Use MCP server in a opencode.json file.
Configure the Container Use MCP server:
{
"$schema" : "http://opencode.ai/config.json" ,
"mcp" : {
"container-use" : {
"type" : "local" ,
"command" : [ "container-use" , "stdio" ],
"enabled" : true
}
}
}
Add the AGENTS.md file using this command (this is optional but usually provides the best results):
curl https://raw.githubusercontent.com/dagger/container-use/main/rules/agent.md >> AGENTS.md
Run opencode and dispatch your agents to complete your tasks!
Goose
Method 1: Configuration File:
Add to ~/.config/goose/config.yaml:
extensions :
container-use :
name : container-use
type : stdio
enabled : true
cmd : container-use
args :
- stdio
envs : {}
Method 2: Interactive Setup:
Then add a command line extension with container-use stdio as the command.
Method 3: Goose Desktop:
Paste this URL into your browser:
goose://extension?cmd=container-use&arg=stdio&id=container-use&name=container%20use&description=use%20containers%20with%20dagger%20and%20git%20for%20isolated%20environments
Sourcegraph Amp
Add MCP Configuration:
Add this configuration to ~/.config/amp/settings.json:
{
"amp.mcpServers" : {
"container-use" : {
"command" : "container-use" ,
"args" : [ "stdio" ]
}
},
"amp.permissions" : [
{ "tool" : "mcp__container-use__*" , "action" : "allow" }
],
"amp.dangerouslyAllowAll" : false ,
"amp.updates.autoUpdate.enabled" : true
}
Add Agent Rules:
Save agent instructions to your project root:
curl https://raw.githubusercontent.com/dagger/container-use/main/rules/agent.md >> AGENT.md
Charm Crush
Add MCP Configuration:
Add this configuration to a valid location like ./.crush.json:
{
"$schema" : "https://charm.land/crush.json" ,
"mcp" : {
"container-use" : {
"type" : "stdio" ,
"command" : "container-use" ,
"args" : [ "stdio" ],
"env" : {}
}
},
"permissions" : {
"allowed_tools" : [
"mcp_container-use_environment_add_service" ,
"mcp_container-use_environment_checkpoint" ,
"mcp_container-use_environment_config" ,
"mcp_container-use_environment_create" ,
"mcp_container-use_environment_file_delete" ,
"mcp_container-use_environment_file_edit" ,
"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_metadata"
]
}
}
Add Agent Rules:
Save agent instructions to your project root:
curl https://raw.githubusercontent.com/dagger/container-use/main/rules/agent.md >> CRUSH.md
Cline
Add MCP Configuration:
Add to your Cline MCP server configuration JSON:
{
"mcpServers" : {
"container-use" : {
"disabled" : false ,
"timeout" : 60000 ,
"type" : "stdio" ,
"command" : "container-use" ,
"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:
Open Qodo Gen chat panel in VSCode or IntelliJ
Click “Connect more tools”
Click ”+ Add new MCP”
Add this configuration:
{
"mcpServers" : {
"container-use" : {
"command" : "container-use" ,
"args" : [ "stdio" ]
}
}
}
Kilo Code
Add MCP Configuration:
Add at global or project level:
{
"mcpServers" : {
"container-use" : {
"command" : "container-use" ,
"args" : [ "stdio" ],
"env" : {},
"alwaysAllow" : [],
"disabled" : false
}
}
}
Kiro
Add MCP Configuration:
Add to .kiro/settings/mcp.json in your project root:
{
"mcpServers" : {
"container-use" : {
"command" : "container-use" ,
"args" : [ "stdio" ],
"env" : {},
"disabled" : false ,
"autoApprove" : {}
}
}
}
Add Steering Rules:
Create .kiro/steering/container-use.md:
---
inclusion : always
---
ALWAYS use ONLY Environments for ANY and ALL file, code, or shell operations—NO EXCEPTIONS—even for simple or generic requests.
DO NOT install or use the git cli with the environment_run_cmd tool. All environment tools will handle git operations for you. Changing ".git" yourself will compromise the integrity of your environment.
You MUST inform the user how to view your work using `container-use log <env_id>` and `container-use checkout <env_id>` . Failure to do this will make your work inaccessible to others.
OpenAI Codex
Add MCP Configuration:
Add to ~/.codex/config.toml:
[ mcp_servers . container-use ]
command = "container-use"
args = [ "stdio" ]
env = {}
Add Agent Rules (Optional):
Instruct Codex to use container-use for all projects:
mkdir -p ~/.codex
curl https://raw.githubusercontent.com/dagger/container-use/main/rules/agent.md >> ~/.codex/AGENTS.md
Warp
Add MCP Configuration:
In the Warp sidebar, under Personal → MCP Servers → New:
{
"container-use" : {
"command" : "container-use" ,
"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" : "container-use" ,
"args" : [ "stdio" ],
"timeout" : 60000 ,
"trust" : true
}
}
}
JetBrains Junie
Add MCP Configuration:
Add or edit the MCP configuration in Settings under Tools → Junie → MCP Settings, or edit ~/.junie/mcp/mcp.json:
{
"mcpServers" :
{
"container-use" : {
"command" : "container-use" ,
"args" : [ "stdio" ],
"env" : {},
"timeout" : 60000
}
}
}
MCP support in Beta starting with Junie plugin 2xx.204.xx
Add Agent Rules:
Save agent instructions to your project root:
mkdir -p ./.junie && curl https://raw.githubusercontent.com/dagger/container-use/main/rules/agent.md >> .junie/guidelines.md
Trust MCP Tools (Optional):
In the settings, under Tools → Junie → Action Allowlist: add MCP Rule .
Troubleshooting
Agent doesn't recognize Container Use
Verify the container-use command is in your PATH: which container-use
Check MCP configuration syntax
Restart your agent after configuration changes
Ensure Docker is running and accessible - Check file permissions for
configuration files - Verify container-use stdio command works: echo '{}' | container-use stdio
Next Steps