Development Prerequisites
Relevant source files
The following files were used as context for generating this wiki page:
The Container Use MCP extension for Zed integrates the Container Use Model Context Protocol (MCP) server directly into the Zed editor. This integration provides coding agents with isolated, containerized environments to execute tasks safely and predictably.
To develop, install, or configure this extension, several system-level components and specific binaries must be present. These prerequisites ensure that the Zed extension can successfully locate and execute the cu (Container Use) binary to establish a communication channel via standard input/output (stdio).
Sources: README.md:1-5, extension.toml:1-4
Core System Dependencies
The extension is built using Rust and utilizes the Zed Extension API. Development requires the standard Rust toolchain and the zed_extension_api crate.
Rust Environment
The project is configured as a library with a crate type of cdylib, targeting the 2021 edition of Rust.
| Dependency | Version | Purpose |
|---|---|---|
zed_extension_api | 0.5.0 | Provides interfaces for Zed extension integration |
serde | 1.0 | Serialization/deserialization of configuration |
schemars | 0.8 | Generating JSON schemas for settings |
Sources: Cargo.toml:1-15
The cu Binary Requirement
The primary functional prerequisite is the cu binary from the Dagger Container Use project. The extension acts as a wrapper that invokes this binary.
Binary Acquisition
Currently, the cu binary must be built from source as the project is in active development. It must be accessible either in the system PATH or through a manually specified path in the editor settings.
This diagram illustrates the logic used by the extension to resolve the location of the cu binary.
Sources: src/container_use_mcp.rs:24-50, README.md:7-11
Configuration and Permissions
For the extension to operate correctly, certain configurations must be applied within the Zed environment.
Project-Level Agent Rules
To ensure that coding agents within Zed utilize the containerized environment provided by the MCP server, a specific rules file must be present in the project root. This is a critical prerequisite for the "agent" functionality.
- File Name:
.rules - Source: https://raw.githubusercontent.com/dagger/container-use/main/rules/agent.md
Sources: README.md:27-31, configuration/installation_instructions.md:1-1
Extension Capabilities
The extension requires the ability to execute system processes, specifically the which command, to locate dependencies.
| Capability Kind | Command | Argument |
|---|---|---|
process:exec | which | cu |
Sources: extension.toml:9-12
Development Configuration Settings
If the cu binary is not in the system PATH, it must be defined in the Zed settings.json. The extension uses the following data structure to parse these settings:
#[derive(Debug, Deserialize, JsonSchema)]
struct ContainerUseMcpSettings {
/// Path to the cu binary (optional - will download if not provided)
cu_path: Option<String>,
}
Sources: src/container_use_mcp.rs:10-14
Settings Example
{
"context_servers": {
"container-use-mcp": {
"settings": {
"cu_path": "/custom/path/to/cu"
}
}
}
}
Sources: README.md:17-25
Summary of Execution Flow
When Zed initializes the extension, it follows a specific sequence to establish the MCP server connection.
The sequence diagram shows how the extension resolves the prerequisite binary and initiates the MCP server process.
Sources: src/container_use_mcp.rs:55-80
The development and usage of this extension depend entirely on the availability of the cu binary and the correct configuration of the .rules file to direct agent behavior. Without these prerequisites, the extension will fail to start the context server or the agents will bypass the containerized environment.