# Zed Integration

URL: https://docs.hanzo.ai/docs/dev/integrations/zed

> Use Hanzo Dev as an external agent in the Zed editor via ACP.

## Setup

Add this block to Zed's `settings.json`:

```json
{
  "agent_servers": {
    "Hanzo Dev": {
      "command": "npx",
      "args": ["-y", "@hanzo/dev", "acp"]
    }
  }
}
```

## Prerequisites

- **Zed Stable 0.201.5+** (released August 27, 2025) adds ACP support with the Agent Panel
- External agents live inside the Agent Panel (`cmd-?`). Use the `+` button to start a new thread and pick Hanzo Dev from the external agent list
- Zed runs the CLI as a subprocess over JSON-RPC — all prompts and diff previews stay local

## How It Works

The Rust MCP server exposes ACP tools:

- `session/new` — Create a new session
- `session/prompt` — Send prompts
- `session/cancel` — Fast interrupts

Streaming `session/update` notifications bridge events into Zed: answer/reasoning updates, shell command progress, approvals, and apply\_patch diffs.

### Client Tools Delegation

Delegate file operations back to Zed:

```toml
[experimental_client_tools]
request_permission = { mcp_server = "zed", tool_name = "requestPermission" }
read_text_file = { mcp_server = "zed", tool_name = "readTextFile" }
write_text_file = { mcp_server = "zed", tool_name = "writeTextFile" }
```

Zed wires these tools automatically when you add the Hanzo Dev agent.

## Troubleshooting

- **Inspect handshake**: Run Zed's `dev: open acp logs` from the Command Palette
- **Prompts hang**: Ensure no other process is bound to the same MCP port and that `~/.hanzo` points to the correct config
- **History/checkpoints**: Not yet supported for third-party agents in Zed — use the TUI for these features
- **Model selector**: After a session starts, Zed lists Hanzo Dev's built-in presets. Picking a new preset updates the running session immediately
