---
title: "Container Use MCP: Sandboxed Environments for Coding Agents"
url: "https://mcpshelf.co/servers/container-use"
description: "Container Use from Dagger gives each coding agent its own container and git branch, so several can work at once. Install, Claude Code setup and how to review."
updated: "2026-10-27"
site: "MCP Shelf"
---

# Container Use

> Each coding agent gets its own container and git branch, so several can work at once.

## At a glance

Container Use comes from Dagger, the team behind the CI engine. Instead of letting an agent edit your working copy directly, each task runs in a fresh container on its own git branch. You can run several agents side by side, read the full log of commands each one ran, open a terminal inside an agent's environment when it gets stuck, and review the result with an ordinary git checkout.

It is a command line tool that also speaks MCP, and Dagger still marks it experimental. It needs Docker or another container runtime that Dagger supports.

|  |  |
| --- | --- |
| Made by | Dagger (dagger/container-use) |
| GitHub | https://github.com/dagger/container-use |
| GitHub stars | 4.1K |
| Last commit | 21 Sept 2026 |
| Tools | 15 |
| Runs on | Your computer |
| Install check | Needs your setup first |
| Category | [Agent helpers and desktop control](https://mcpshelf.co/categories/agents-and-automation) |

**Our check:** It needs something our Linux test machine does not have (an account, a desktop app, a Mac or a running service), so on 27 Oct 2026 we read its tools from the source code instead of running this config.

## Tools

We listed 15 tools on 27 Oct 2026. 0 only read; the rest can change things or run commands.

| Tool | Kind | What it is for |
| --- | --- | --- |
| `environment_open` | changes | Reopens an environment created earlier. |
| `environment_create` | changes | Starts a new environment from your repository: a container plus its own git branch, built from a base image and your setup commands. |
| `environment_update_metadata` | changes | Changes an environment's title, the note that says what work it holds. |
| `environment_config` | changes | Changes the base image and setup commands for an environment. |
| `environment_list` | changes | Lists the environments that exist for the repository. |
| `environment_run_cmd` | runs | Runs a shell command in a fresh container inside the environment, in the background if needed, and can expose ports. |
| `environment_file_read` | changes | Reads a file in the environment, whole or by line range. |
| `environment_file_list` | changes | Lists a folder in the environment. |
| `environment_file_edit` | changes | Replaces a piece of text in a file in the environment. |
| `environment_file_write` | changes | Writes a whole file in the environment. |
| `environment_file_delete` | changes | Deletes a file in the environment. |
| `environment_checkpoint` | changes | Saves the environment's current state as a container image. |
| `environment_add_service` | changes | Adds a side container, such as a database or a cache, that the environment can reach. |
| `environment_log` | changes | Shows the commits the agent made and the commands it ran. |
| `environment_diff` | changes | Shows everything the agent changed since the environment was created, as one diff. |

## Set it up

1. Install the CLI: brew install dagger/tap/container-use on macOS, or the install script from the repository on Linux.
2. In Claude Code, from your repository: claude mcp add container-use -- container-use stdio. Other clients use the config below.
3. Optional: append the project's agent rules file to your CLAUDE.md or AGENTS.md so the agent always works inside an environment.

### Claude Desktop

Where: claude_desktop_config.json (Settings → Developer → Edit Config)

```json
{
  "mcpServers": {
    "container-use": {
      "command": "container-use",
      "args": [
        "stdio"
      ]
    }
  }
}
```

### Claude Code

Where: Your terminal, in the project folder

```bash
claude mcp add-json container-use '{"command":"container-use","args":["stdio"]}'
```

### Cursor

Where: ~/.cursor/mcp.json, or .cursor/mcp.json in a project

```json
{
  "mcpServers": {
    "container-use": {
      "command": "container-use",
      "args": [
        "stdio"
      ]
    }
  }
}
```

### VS Code

Where: .vscode/mcp.json in your project

```json
{
  "servers": {
    "container-use": {
      "type": "stdio",
      "command": "container-use",
      "args": [
        "stdio"
      ]
    }
  }
}
```

### Windsurf

Where: ~/.codeium/windsurf/mcp_config.json

```json
{
  "mcpServers": {
    "container-use": {
      "command": "container-use",
      "args": [
        "stdio"
      ]
    }
  }
}
```

### ChatGPT

Where: Not supported

ChatGPT only connects to remote servers by URL. This one runs on your computer, so use Claude, Cursor or VS Code.

The shorter cu command works too: cu stdio.

## Settings

| Setting | Kind | Required | What it does |
| --- | --- | --- | --- |
| `cu config base-image set` | config | no | The container image new environments start from. Example: `cu config base-image set python:3.12` |
| `cu config setup-command add` | config | no | Commands that run when an environment is built, such as installing system packages. Example: `cu config setup-command add "apt-get install -y postgresql-client"` |
| `cu config env set` | config | no | Environment variables available inside every environment. |
| `cu log / cu diff` | flag | no | Show an environment's history or changes from your own terminal. |
| `cu terminal` | flag | no | Opens a shell inside an agent's environment so you can look around or take over. |
| `cu checkout / cu apply / cu merge` | flag | no | Bring an environment's work into your repository: switch to its branch, stage its changes, or merge it. |

## What it can touch

**It can read**

- Your git repository, which it copies into each environment

**It can change**

- Files inside environment containers, never your working copy directly
- New git branches for each environment
- Containers and images on your machine, through Docker

**Safer setup:** That is the point of the tool: the agent works in containers on separate branches, and nothing reaches your branch until you run cu apply or cu merge.

## Before you start

- macOS or Linux (Windows is not supported)
- Docker (or another runtime Dagger supports)
- git

## Good for

- Running two or three coding agents in parallel without them colliding
- Letting an agent try risky changes you can throw away
- Seeing exactly what an agent ran, not just what it reports

## If it does not work

**Creating an environment fails straight away**
Docker (or another runtime Dagger supports) must be running. Container Use reports Docker errors with the fix.

**The agent edits your files directly instead**
Add the project's agent rules file to CLAUDE.md or AGENTS.md, and turn off the client's own file and shell tools for that session.

**Every environment reinstalls the same packages**
Move the installs into cu config setup-command so they are part of the environment's build.

**A service the agent started is not reachable**
Ask it to expose the port in environment_run_cmd; the result gives the address to open.

## Similar servers

| Server | Tools | Runs on | Stars |
| --- | --- | --- | --- |
| [ROS MCP Server](https://mcpshelf.co/servers/ros) | 31 | Your computer | 1.5K |
| [Sequential Thinking](https://mcpshelf.co/servers/sequential-thinking) | 1 | Your computer | 91.6K |
| [Windows-MCP](https://mcpshelf.co/servers/windows-mcp) | 21 | Your computer | 10.4K |
| [Mobile MCP](https://mcpshelf.co/servers/mobile-mcp) | 34 | Your computer | 10K |

## Questions

### Which agents does it work with?

Any MCP client that can start a command: Claude Code, Cursor, Goose, VS Code, Codex and others.

### Is it stable?

Dagger labels it experimental and it changes between releases. It works, but expect rough edges.

### Does it run on Windows?

No. Its installer refuses Windows because the tool relies on Unix system calls; use macOS or Linux.

### Is it free?

Yes, Apache-2.0.

Full docs on GitHub: https://github.com/dagger/container-use

---

From [MCP Shelf](https://mcpshelf.co/): A short shelf of MCP servers that are worth installing. Index for agents: https://mcpshelf.co/llms.txt

