https://github.com/dagger/container-use
Development environments for coding agents. Enable multiple agents to work safely and independently with your preferred stack.
https://github.com/dagger/container-use
Last synced: 4 months ago
JSON representation
Development environments for coding agents. Enable multiple agents to work safely and independently with your preferred stack.
- Host: GitHub
- URL: https://github.com/dagger/container-use
- Owner: dagger
- License: apache-2.0
- Created: 2025-05-23T23:18:43.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2025-06-05T17:45:33.000Z (4 months ago)
- Last Synced: 2025-06-05T18:37:45.934Z (4 months ago)
- Language: Go
- Homepage:
- Size: 348 KB
- Stars: 102
- Watchers: 0
- Forks: 6
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-mcp-servers - **dagger/container-use ๐๏ธ ๐ ๐ง ๐ ๐ช** - Containerized environments for coding agents. Multiple agents can work independently, isolated in fresh containers and git branches. No conflicts, many experiments. Full execution history, terminal access to agent environments, git workflow. Any agent/model/infra stack. `http` `ai` `git` `github` (Other)
- awesome-mcp-servers - **dagger/container-use ๐๏ธ ๐ ๐ง ๐ ๐ช** - Containerized environments for coding agents. Multiple agents can work independently, isolated in fresh containers and git branches. No conflicts, many experiments. Full execution history, terminal access to agent environments, git workflow. Any agent/model/infra stack. `http` `ai` `git` `github` (Other)
- best-of-mcp-servers - GitHub - 43% open ยท โฑ๏ธ 11.09.2025) (Code Execution)
- awesome - dagger/container-use - Development environments for coding agents. Enable multiple agents to work safely and independently with your preferred stack. (Go)
- awesome-repositories - dagger/container-use - Development environments for coding agents. Enable multiple agents to work safely and independently with your preferred stack. (Go)
- awesome-claude-code - `Container Use` - 2.0 (Tooling ๐งฐ [๐](#awesome-claude-code) / Total Amount Raised: [๐](#awesome-claude-code))
- awesome-starred - dagger/container-use - Development environments for coding agents. Enable multiple agents to work safely and independently with your preferred stack. (Go)
README
**Container Use** lets each of your coding agents have their own containerized environment. Go from babysitting one agent at a time to enabling multiple agents to work safely and independently with your preferred stack.
![]()
It's an open-source MCP server that works as a CLI tool with Claude Code, Cursor, and other MCP-compatible agents.
* ๐ฆ **Isolated Environments**: Each agent gets a fresh container in its own git branch - run multiple agents without conflicts, experiment safely, discard failures instantly.
* ๐ **Real-time Visibility**: See complete command history and logs of what agents actually did, not just what they claim.
* ๐ **Direct Intervention**: Drop into any agent's terminal to see their state and take control when they get stuck.
* ๐ฎ **Environment Control**: Standard git workflow - just `git checkout ` to review any agent's work.
* ๐ **Universal Compatibility**: Works with any agent, model, or infrastructure - no vendor lock-in.---
๐ฆบ This project is in early development and actively evolving. Expect rough edges, breaking changes, and incomplete documentation. But also expect rapid iteration and responsiveness to feedback.
---
## Install
```sh
curl -fsSL https://raw.githubusercontent.com/dagger/container-use/main/install.sh | bash
```This will check for Docker & Git (required), detect your platform, and install the latest `cu` binary to your `$PATH`.
## Building
To build the `cu` binary without installing it to your `$PATH`, you can use either Dagger or Go directly:
### Using Go
```sh
go build -o cu ./cmd/cu
```### Using Dagger
```sh
dagger call build --platform=current export --path ./cu
```## Integrate Agents
Enabling `container-use` requires 2 steps:
1. Adding an MCP configuration for `container-use` corresponding to the repository.
2. (Optional) Adding a rule so the agent uses containarized environments.### [Claude Code](https://docs.anthropic.com/en/docs/claude-code/tutorials#set-up-model-context-protocol-mcp)
Add the container-use MCP:
```sh
cd /path/to/repository
npx @anthropic-ai/claude-code mcp add container-use -- stdio
```Save the CLAUDE.md file at the root of the repository. Alternatively, merge the instructions into your own CLAUDE.md.
```sh
curl https://raw.githubusercontent.com/dagger/container-use/main/rules/agent.md >> CLAUDE.md
```### [goose](https://block.github.io/goose/docs/getting-started/using-extensions#mcp-servers)
Add this to `~/.config/goose/config.yaml`:
```yaml
extensions:
container-use:
name: container-use
type: stdio
enabled: true
cmd: cu
args:
- stdio
envs: {}
```### [Cursor](https://docs.cursor.com/context/model-context-protocol)
```sh
curl --create-dirs -o .cursor/rules/container-use.mdc https://raw.githubusercontent.com/dagger/container-use/main/rules/cursor.mdc
```### [VSCode](https://code.visualstudio.com/docs/copilot/chat/mcp-servers) / [GitHub Copilot](https://docs.github.com/en/copilot/customizing-copilot/extending-copilot-chat-with-mcp)
The result of the instructions above will be to update your VSCode settings with something that looks like this:
```json
"mcp": {
"servers": {
"container-use": {
"type": "stdio",
"command": "cu",
"args": [
"stdio"
]
}
}
}
```Once the MCP server is running, you can optionally) update the instructions for copilot using the following:
```sh
curl --create-dirs -o .github/copilot-instructions.md https://raw.githubusercontent.com/dagger/container-use/main/rules/agent.md
```### [Kilo Code](https://kilocode.ai/docs/features/mcp/using-mcp-in-kilo-code)
`Kilo Code` allows setting MCP servers at the global or project level.
```json
{
"mcpServers": {
"container-use": {
"command": "replace with pathname of cu",
"args": [
"stdio"
],
"env": {},
"alwaysAllow": [],
"disabled": false
}
}
}
```## Examples
| Example | Description |
|---------|-------------|
| [hello_world.md](examples/hello_world.md) | Creates a simple app and runs it, accessible via localhost HTTP URL |
| [parallel.md](examples/parallel.md) | Creates and serves two variations of a hello world app (Flask and FastAPI) on different URLs |
| [security.md](examples/security.md) | Security scanning example that checks for updates/vulnerabilities in the repository, applies updates, verifies builds still work, and generates patch file |### Run with [Claude Code](https://www.anthropic.com/claude-code)
```console
cat ./examples/hello_world.md | claude --dangerously-skip-permissions
```### Run with [goose](https://block.github.io/goose/)
```console
goose run -i ./examples/hello_world.md -s
```### Run with [Kilo Code](https://kilocode.ai/) in `vscode`
Prompt as in `parallel.md` but add a sentence 'use container-use mcp'
## Watch your agents work
Your agents will automatically commit to a container-use remote on your local filesystem. You can watch the progress of your agents in real time by running:
```console
cu watch
```## How it Works
container-use is an Model Context Protocol server that provides Environments to an agent. Environments are an abstraction over containers and git branches powered by dagger and git worktrees. For more information, see [environment/README.md](environment/README.md).