Container Use MCP server

Provides containerized development environments that persist state across interactions through git-based storage and Dagger's container runtime, enabling isolated environments with custom toolchains, background services, and the ability to checkpoint environments as publishable container images.
Back to servers
Setup instructions
Provider
Dagger
Release date
Jun 23, 2025
Language
JavaScript
Stats
2.7K stars

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.

Installation

Using Package Managers

# macOS (recommended)
brew install dagger/tap/container-use

# All platforms
curl -fsSL https://raw.githubusercontent.com/dagger/container-use/main/install.sh | bash

Setting Up With Your Agent

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

Command Shortcut

For convenience, you can use the shorthand cu command instead of container-use:

# These commands are equivalent
container-use stdio
cu stdio

Usage

Basic Usage

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.

Compatible Agents

Container Use works with any MCP-compatible agent, including:

  • Claude Code
  • Cursor
  • Goose
  • VSCode with MCP extensions

For specific setup instructions for each agent, visit the complete setup guide.

Example With Claude Code

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

Key Features

  • Isolated Environments: Each agent works in its own container and git branch
  • Real-time Visibility: View complete command history and logs of agent actions
  • Direct Intervention: Access any agent's terminal to monitor or take control
  • Environment Control: Use standard git workflow to review agent work
  • Universal Compatibility: Works with any MCP-compatible agent

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.

How to install this MCP server

For Claude Code

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.

For Cursor

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.

Adding an MCP server to Cursor globally

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
        }
    }
}

Adding an MCP server to a project

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.

How to use the MCP server

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.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.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

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later