/ ディレクトリ / プレイグラウンド / Container Use
● 公式 dagger ⚡ 即起動

Container Use

作者 dagger · dagger/container-use

Isolated, parallel containerized environments for coding agents.

Container Use gives every coding agent its own ephemeral container — so multiple Claude sessions can build, test, and run the same repo at the same time without stepping on each other. Built on Dagger; each environment has its own filesystem, branch, and process tree.

なぜ使うのか

主な機能

ライブデモ

実際の動作

container-use-mcp.replay ▶ 準備完了
0/0

インストール

クライアントを選択

~/Library/Application Support/Claude/claude_desktop_config.json  · Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "container-use-mcp": {
      "command": "cu",
      "args": [
        "mcp"
      ]
    }
  }
}

Claude Desktop → Settings → Developer → Edit Config を開く。保存後、アプリを再起動。

~/.cursor/mcp.json · .cursor/mcp.json
{
  "mcpServers": {
    "container-use-mcp": {
      "command": "cu",
      "args": [
        "mcp"
      ]
    }
  }
}

Cursor は Claude Desktop と同じ mcpServers スキーマを使用。プロジェクト設定はグローバルより優先。

VS Code → Cline → MCP Servers → Edit
{
  "mcpServers": {
    "container-use-mcp": {
      "command": "cu",
      "args": [
        "mcp"
      ]
    }
  }
}

Cline サイドバーの MCP Servers アイコンをクリックし、"Edit Configuration" を選択。

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "container-use-mcp": {
      "command": "cu",
      "args": [
        "mcp"
      ]
    }
  }
}

Claude Desktop と同じ形式。Windsurf を再起動して反映。

~/.continue/config.json
{
  "mcpServers": [
    {
      "name": "container-use-mcp",
      "command": "cu",
      "args": [
        "mcp"
      ]
    }
  ]
}

Continue はマップではなくサーバーオブジェクトの配列を使用。

~/.config/zed/settings.json
{
  "context_servers": {
    "container-use-mcp": {
      "command": {
        "path": "cu",
        "args": [
          "mcp"
        ]
      }
    }
  }
}

context_servers に追加。保存時に Zed がホットリロード。

claude mcp add container-use-mcp -- cu mcp

ワンライナー。claude mcp list で確認、claude mcp remove で削除。

ユースケース

実用的な使い方: Container Use

Try three refactoring approaches in parallel, keep the best

👤 Engineers exploring design space ⏱ ~15 min intermediate

使うタイミング: You have 3 different ideas for a refactor and want to see all of them run/pass tests before picking one.

前提条件
  • Server/skill installed and authenticated — See repo README
フロー
  1. Spin up three isolated envs
    Create three container-use environments named refactor-a/b/c, all on this repo at HEAD.✓ コピーしました
    → Three env_ids printed
  2. Apply each approach in its own env
    In refactor-a do the strategy-pattern version; in -b inline everything; in -c extract a service object. Run the full test suite in each. Report pass/fail and diff size.✓ コピーしました
    → Per-env test summary and diff stats
  3. Pick the winner and merge
    Apply the diff from refactor-b to my working copy. Discard the other two environments.✓ コピーしました
    → Patch applied locally

結果: Three real experiments evaluated side-by-side without ever breaking your host repo.

注意点
  • Forgetting to discard old envs leaks disk — Forgetting to discard old envs leaks disk — cu environment list then cu environment discard <id> periodically.
組み合わせ: github · filesystem

組み合わせ

他のMCPと組み合わせて10倍の力を

container-use-mcp + github

Pair with github for complementary capabilities

Use this server together with github to complete a multi-step task.✓ コピーしました
container-use-mcp + filesystem

Pair with filesystem for complementary capabilities

Use this server together with filesystem to complete a multi-step task.✓ コピーしました

ツール

このMCPが提供する機能

ツール入力呼び出すタイミングコスト
environment_create name: str, image: str Start a fresh sandbox for the next task Local CPU/disk
environment_run_cmd env_id, cmd Execute build/test commands inside the sandbox free
environment_file_write env_id, path, contents Apply edits without touching the host free
environment_diff env_id Review the agent's work before merging back free

コストと制限

運用コスト

APIクォータ
See provider docs for rate limits
呼び出しあたりのトークン
Varies by tool
金額
See repo README for pricing details
ヒント
Cache tool results and avoid repeated identical calls.

セキュリティ

権限、シークレット、影響範囲

認証情報の保管: Use environment variables; never commit secrets
データ送信先: Tool calls go to the provider's API as documented

トラブルシューティング

よくあるエラーと対処法

docker daemon not running

Container Use requires a local Docker or compatible runtime. Start Docker Desktop or colima.

確認: Run `docker ps` successfully
out of disk

Old environments aren't auto-pruned. Run cu environment list then cu environment discard <id> for anything older than a day.

確認: Check `docker system df`

代替案

Container Use 他との比較

代替案代わりに使う場面トレードオフ
Dagger CloudYou want hosted, multi-tenant agent envsPaid; container-use is local-first

その他

リソース

📖 GitHub の公式 README を読む

🐙 オープンな issue を見る

🔍 400以上のMCPサーバーとSkillsを見る