Installation Guide
Relevant source files
The following files were used as context for generating this wiki page:
Introduction
The Container Use MCP extension for Zed integrates the Container Use Model Context Protocol (MCP) server directly into the Zed editor. This system enables coding agents to operate within isolated, containerized environments, providing a secure and reproducible workspace for automated development tasks.
The installation process involves setting up the core cu binary, configuring the Zed extension to locate this binary, and establishing agent rules to guide the behavior of AI entities within the containerized context.
Sources: README.md:1-5, extension.toml:1-5
Core Component Installation
The primary requirement for this extension is the cu (Container Use) binary. As the tool is currently in active development, users are required to build the binary from source.
The cu Binary
The extension acts as a wrapper that invokes the cu binary using the stdio communication channel. The extension attempt to locate this binary in the system's PATH using the which cu command.
Sources: src/container_use_mcp.rs:31-40, extension.toml:10-13
The diagram above illustrates the logic used by the extension to resolve the location of the required cu binary.
Sources: src/container_use_mcp.rs:25-50
Configuration and Setup
Once the binary is available, the extension facilitates communication between Zed and the containerized environment. Configuration can be handled automatically or via manual settings in Zed's settings.json.
Settings Schema
The extension defines a specific configuration structure for managing the MCP server:
| Field | Type | Description |
|---|---|---|
cu_path | Option | Explicit path to the cu binary if not in system PATH. |
| Sources: src/container_use_mcp.rs:11-14, README.md:15-25 |
Manual Configuration Snippet
If the cu binary is not in the standard path, it must be defined in the Zed settings.json file:
{
"context_servers": {
"container-use-mcp": {
"settings": {
"cu_path": "/path/to/cu"
}
}
}
}
Sources: README.md:18-28
Agent Rule Integration
To ensure that coding agents correctly utilize the containerized environment provided by the MCP server, specific rules must be placed in the project root. This is achieved by downloading the agent.md ruleset and saving it as a .rules file.
curl -o .rules https://raw.githubusercontent.com/dagger/container-use/main/rules/agent.md
Sources: README.md:32-34, configuration/installation_instructions.md:1-1
Technical Architecture
The extension is built as a Rust dynamic library (cdylib) using the zed_extension_api. It implements the Extension trait to manage the lifecycle of the Context Server.
Component Relationship
The sequence diagram shows how the extension resolves the binary path and provides Zed with the necessary command to spawn the MCP server process.
Sources: src/container_use_mcp.rs:65-85, Cargo.toml:10-11
Conclusion
Setting up the Container Use MCP extension requires the manual installation of the cu binary and the optional configuration of its path within Zed. By including the .rules file in the project root, users can ensure that AI agents leverage the containerized capabilities provided by the Dagger-based infrastructure.
Sources: README.md:7-34, src/container_use_mcp.rs:48-51