Container Use is an MCP server that enables coding agents to work in parallel containerized environments. It isolates each agent in its own container and git branch, allowing multiple agents to work independently without conflicts while providing real-time visibility into their actions.
# macOS (recommended)
brew install dagger/tap/container-use
# All platforms
curl -fsSL https://raw.githubusercontent.com/dagger/container-use/main/install.sh | bash
Container Use works with any MCP-compatible agent by adding it as an MCP server. The basic command structure is:
# Add Container Use MCP server
cd /path/to/repository
claude mcp add container-use -- container-use stdio
You can also add optional agent rules:
# Add agent rules (optional)
curl https://raw.githubusercontent.com/dagger/container-use/main/rules/agent.md >> CLAUDE.md
For convenience, you can use the shorthand cu
command instead of container-use
:
# These commands are equivalent
container-use stdio
cu stdio
After installation, navigate to your project directory and ask your agent to create something. For example:
Ask your agent: "Create a hello world app in python using flask"
The agent will work in an isolated container environment and provide URLs to view the application and explore the code.
Container Use works with any MCP-compatible agent, including:
For specific setup instructions for each agent, visit the complete setup guide.
To set up Container Use with Claude Code:
# Navigate to your repository
cd /path/to/repository
# Add Container Use as an MCP server
claude mcp add container-use -- container-use stdio
When an agent is working, it will provide URLs for accessing the running application and reviewing the code changes, all within isolated environments that won't affect your main codebase.
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "container-use" '{"command":"cu","args":["stdio"],"env":[],"timeout":60000}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"container-use": {
"command": "cu",
"args": [
"stdio"
],
"env": [],
"timeout": 60000
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"container-use": {
"command": "cu",
"args": [
"stdio"
],
"env": [],
"timeout": 60000
}
}
}
3. Restart Claude Desktop for the changes to take effect