zswarm-mcp
Provides tools for managing git worktrees, including spawning panes with worktrees, listing/removing worktrees, and inspecting diffs or creating checkpoints.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@zswarm-mcpspawn a codex agent in a new worktree called feature-login"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
zSwarm
Coordinate CLI AI crews across Zellij terminal panes. Control agents, pass prompts between panes, manage git worktrees, inspect outputs, and sync crew tasks via CLI or Model Context Protocol (MCP).
you ──▶ any agent ──┐
│ zswarm({op:"send", to:"reviewer"})
▼
every pane can call zswarm ──▶ ┌─────────┐
so agents drive each other │ zswarm │
│ cli/mcp │
└────┬────┘
paste + Enter ┌────┴────┐ read screen / pushed state
▼ ▼
══ this machine ══════════════════════════════╗ ══ ssh user@build-01 ═════════╗
zellij "crew" ║ zellij "ci" ║
║ ║
┌────────────┐ send ┌────────────┐ ║ ┌────────────┐ ║
│ codex │────────▶│ claude │───────╫──▶│ opencode │ ║
│ builder │◀────────│ reviewer │ send ║ │ test-runner│ ║
│ wt:feat-a │ signal │ wt:rev-a │ ║ │ wt:feat-a │ ║
└────────────┘ └────────────┘ ║ └──────┬─────┘ ║
┌────────────┐ ┌────────────┐ ║ ┌──────▼─────┐ ║
│ cursor │ │ agy │ ║ │ pi │ ║
│ refactor │ │ docs │ ║ │ deploy │ ║
│ wt:feat-b │ │ wt:docs │ ║ │ cwd:/srv │ ║
└────────────┘ └────────────┘ ║ └────────────┘ ║
═══════════════════════════════════════════════╝ ══════════════════════════════╝
one pane = one agent + one role + optionally its own worktree
any pane can drive any other, on this machine or across the ssh boundary⚡ Quick Start
Requirements
Zellij ≥ 0.42 on
PATH(or setZSWARM_BIN/ZSWARM_PATH)Node.js ≥ 20
Installation
npm i -g zswarm
zswarm listEnable the optional Zellij event-bus plugin once per machine for zero-polling state updates:
zswarm bus --installMCP Server Setup
Configure zswarm-mcp (stdio MCP server bundled with the package) in your MCP host:
{
"mcpServers": {
"zswarm": {
"command": "/absolute/path/to/zswarm-mcp",
"env": {
"ZSWARM_SESSION": "my-zellij-session"
}
}
}
}Note: Use the absolute path to
zswarm-mcpand specifyZSWARM_SESSIONto prevent ambiguous session errors when multiple Zellij sessions run.
Related MCP server: multi-agent-mcp
Usage & Quick Syntax
Every operation is supported both via CLI (zswarm <op> [flags]) and MCP (zswarm({ op: "<op>", ... })).
Essential Examples
# 1. Inspect Panes & Status
zswarm list # List active panes
zswarm status # Check status: busy | waiting | idle | exited
# 2. Spawn Panes & Worktrees
zswarm spawn --command "claude" --name reviewer # Spawn agent pane
zswarm spawn --command "codex" --worktree feature-auth --name auth-dev # Isolated git worktree pane
# 3. Pass Prompts & Input
zswarm send --to reviewer --body "Review changes in src/" --submit auto
zswarm keys --to reviewer --key "Ctrl c" # Send special keys / interrupts
# 4. Read Outputs & Wait
zswarm dump --to reviewer --max 4000 # Read recent screen tail
zswarm tail --to reviewer # Incremental read since last check
zswarm wait --to reviewer --match "DONE" # Block until pattern matched or pane idle
# 5. Coordinate Crew & Sync Signals
zswarm broadcast --all --group builder --body "Run test suite" # group matches pane title or command
zswarm signal --channel tests --payload ok # Send signal to durable channel
zswarm await --channel tests --count 3 # Wait for 3 worker signals📋 Operations Reference
Operation | Purpose | Key Parameters / Flags |
| List panes or live Zellij sessions |
|
| Panes classified by state ( |
|
| Launch command in new pane, tab, or git worktree |
|
| Send text / prompt into a pane |
|
| Read screen content (screen tail) |
|
| Incremental screen read since last cursor |
|
| Block until quiet, pattern match, or idle |
|
| Send one prompt to multiple panes |
|
| Send key combos ( |
|
| Close a pane |
|
| Durable message channels & barrier sync |
|
| List or remove managed git worktrees |
|
| Inspect peer worktree patch or autocommit WIP |
|
| Retitle pane/tab or focus pane |
|
| Inspect tabs, layout KDL, or stack panes |
|
| Event bus plugin management & delivery log |
|
🛡️ Safety & Policy Guards
Self-Target Guard: Operations refuse to modify zSwarm's own pane (
allowSelf: trueto override).Execution & Exited Guards: Prevents writing to exited panes (
force: trueto override).Prompt Safety (
expect):send --expect <text>ensures target pane screen contains<text>before writing (prevents accidental shell execution).Submission Verification (
submit):autoverifies text submission into TUI composers and retries Enter if unsubmitted.
Environment Security Controls
Env Variable | Effect |
| Disable all write ops ( |
| Comma-separated list/patterns of allowed/denied pane titles |
| Disable spawning new panes |
| Disable closing panes |
| Disable removing git worktrees |
⚙️ Environment Variables
Variable | Description |
| Path to |
| Default Zellij session name |
| Active Zellij session (set automatically inside Zellij panes) |
| Sending pane id (Zellij sets the first inside a pane). Used to refuse self-target and to default |
| Sender label when |
| Directory for linked worktrees (default: |
| State storage directory for logs, signals, and cursors (default: |
|
|
| Remote |
| Remote IPC temp directory, or |
|
|
|
|
|
|
| Shared secret for |
Remote crews
Linux/macOS SSH works when it is the same user and $TMPDIR. Windows OpenSSH is session 0; live Zellij is usually the interactive desktop session. ZSWARM_TMP=auto points at that TEMP (enough to list sessions). Pane attach on Windows uses named pipes in the desktop session, so use ZSWARM_SSH_MODE=interactive or run zswarm serve next to Zellij.
# Linux/macOS, same user:
ZSWARM_SSH=user@host zswarm list
# Point SSH at the interactive TEMP (auto reads zellij --server …)
ZSWARM_SSH=user@host ZSWARM_TMP=auto zswarm sessions
# Windows: run the CLI inside the desktop session. Discovers TEMP unless ZSWARM_TMP is set.
ZSWARM_SSH=user@host ZSWARM_SSH_MODE=interactive zswarm list
# Any OS: run zswarm next to Zellij; another machine talks over a tunnel to 127.0.0.1
# On the host, in the session that owns Zellij (loopback only; a token is not a bind substitute):
ZSWARM_SERVE_TOKEN=secret zswarm serve --listen 127.0.0.1:9419
# Windows, once (bakes ZSWARM_SERVE_TOKEN into the logon task env): zswarm serve --install
# On the client:
ssh -fN -L 9419:127.0.0.1:9419 user@host
ZSWARM_SERVE=127.0.0.1:9419 ZSWARM_SERVE_TOKEN=secret zswarm listfile: plugin URLs stay on the machine that owns Zellij. A client with ZSWARM_SERVE never sends a local wasm path across the tunnel.
{
"mcpServers": {
"zswarm": {
"command": "/absolute/path/to/zswarm-mcp",
"env": {
"ZSWARM_SERVE": "127.0.0.1:9419",
"ZSWARM_SERVE_TOKEN": "secret",
"ZSWARM_SESSION": "crew"
}
}
}
}📦 Monorepo Structure
Package | Purpose |
| Main meta-package ( |
| Core Zellij client and shared dispatch engine |
|
|
| Stdio MCP server ( |
| Precompiled Rust event-bus WASM plugin |
| Extension bridge for harnesses without native MCP support |
📜 License
This server cannot be deployed
Maintenance
Related MCP Connectors
Develop, manage, and debug Railway projects, services, and deployments from within agents.
Operate Linux, macOS and Windows from your LLM. Every action runs through an auditable allowlist.
Real-time chat for AI agents. Claude Code, Cursor, Cline and Codex join channels over MCP.
Git-backed platform for skills, tools, and context for AI agents
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables comprehensive management of Zellij terminal workspace sessions, including session, pane, tab, plugin, layout operations, and LLM completion detection.22-
- AlicenseCqualityBmaintenanceManages multiple AI CLI instances (Claude Code, Codex, Gemini, Cursor) in tmux sessions for parallel task execution, with optional git worktree support.90MIT
- FlicenseAqualityDmaintenanceEnables AI agents to spawn, interact with, and orchestrate multiple concurrent terminal sessions via tmux.9-
- FlicenseNot gradedqualityDmaintenanceEnables orchestration of multiple AI coding agents (Claude Code, Gemini CLI, etc.) in isolated Wezterm panes, allowing one agent to spawn, monitor, and communicate with others across projects.101-