wezterm-agent-mcp
Provides programmable terminal control for Wezterm, enabling spawning, monitoring, and managing AI agents across multiple panes and windows.
Click on "Install 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., "@wezterm-agent-mcplaunch a Claude Code agent for the payment-api project"
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.
wezterm-agent-mcp
Wezterm MCP Server — a programmable terminal control plane for multi-agent AI workflows.
Turns Wezterm into a remote-controllable terminal multiplexer that any AI coding CLI can be orchestrated through. One orchestrator agent spawns, monitors, and communicates with any number of AI agents running in parallel across multiple projects.
What This Does
Spawn AI agents in Wezterm panes — Claude Code, Gemini CLI, Codex CLI, OpenCode, Goose
Inject prompts into running agent sessions as if a human typed them
Read output from any pane — passive (fast) or deep (asks agents for status)
Manage windows — one window per project, auto-titled, with N/M numbering for duplicates
Session recovery — save/restore full layouts including CLI session IDs after a crash
Auto-skip permissions — each CLI's autonomous mode is handled automatically
Cross-platform — Linux, macOS, and Windows via a platform abstraction layer
Related MCP server: Claude Team MCP Server
Architecture
+---------------------------------------------------+
| Your AI Agent (Claude, etc.) |
| |
| "Launch 5 agents for the auth-service project" |
| | |
| MCP Tool Calls |
| | |
+---------------------------------------------------+
| wezterm-agent-mcp |
| (this MCP server) |
| | |
| wezterm cli commands |
| | |
+---------------------------------------------------+
| Wezterm |
| |
| +-----------+ +-----------+ +-----------+ |
| | Window 1 | | Window 2 | | Window 3 | |
| | auth-svc | | pay-api | | dashboard | |
| | +--+--+ | | +--+--+ | | +--+ | |
| | |C1|C2| | | |C1|G1| | | |C1| | |
| | +--+--+ | | +--+--+ | | +--+ | |
| | |C3|C4| | | | | | |
| | +--+--+ | | | | | |
| +-----------+ +-----------+ +-----------+ |
+---------------------------------------------------+Quick Start
Prerequisites
Install
One command:
npm install -g wezterm-agent-mcpInstall automatically registers the MCP server globally for all AI coding tools:
Config file | For |
| Claude Code |
| Cursor |
VS Code user | VS Code (platform-specific path) |
| Gemini CLI |
| OpenCode (platform-specific path) |
One install, every project, every tool. Existing config files are merged — other MCP servers won't be touched.
To re-run manually or for per-project setup:
wezterm-agent-mcp init # re-run global setup
wezterm-agent-mcp init --project # per-project setup (current dir)
wezterm-agent-mcp init --root /path # per-project setup (specific dir)Wezterm Lua config (optional)
The package includes a wezterm.lua with auto-maximize, project-derived window titles, N/M numbering, auto tab titles, and F11 fullscreen. To use it:
# After npx downloads the package, copy from the npm cache:
npx -y wezterm-agent-mcp --help # ensures package is cached
cp $(npm root -g)/wezterm-agent-mcp/wezterm.lua ~/.config/wezterm/wezterm.lua
# Or from a cloned repo:
cp wezterm.lua ~/.config/wezterm/wezterm.luaInstall from source
git clone https://github.com/multiagentcognition/wezterm-agent-mcp.git
cd wezterm-agent-mcp
npm install && npm run build
npx . init # configure MCP for this projectEnvironment Variables
Variable | Description | Default |
| Default working directory for all panes |
|
| Fallback if | — |
| Informational git branch (not enforced) | auto-detected |
Supported CLIs
CLI | Binary | Skip-permissions | Session resume |
Claude Code |
|
|
|
Gemini CLI |
|
|
|
Codex CLI |
|
|
|
OpenCode |
| Config: |
|
Goose |
| Env: |
|
Each CLI's autonomous mode is handled automatically — flags, config files, and env vars are set before launch. Directory trust is pre-configured for Claude Code, Gemini, and Codex so no interactive prompts block startup.
MCP Tools (41 total)
Status & Lifecycle
Tool | Description |
| Full status: windows, tabs, panes with CLI detection and state |
| List all panes with CLI type, state, CWD |
| Start Wezterm if not running |
Launching
Tool | Description |
| Open a project window with N agents (auto-grid layout) |
| Multiple different CLIs in one tab |
| Manual grid of panes (rows × cols) |
| New window/tab with optional CLI or command |
| Split a pane (right/bottom) with optional CLI |
Text I/O
Tool | Description |
| Type text into a pane (no Enter) |
| Type text + Enter (primary method for injecting prompts) |
| Different text to each pane in a tab |
| Broadcast same text to all panes in a tab |
| Send text to specific pane IDs |
| Read text from a pane (supports scrollback) |
Reading & Monitoring
Tool | Description |
| Quick passive read of ALL panes — fast, never interrupts |
| Deep read — prompts idle agents for status summaries |
| Read all panes in a specific tab |
| Screenshot the active Wezterm window |
| Screenshot each tab |
Special Keys
Tool | Description |
| Send ctrl+c, ctrl+d, escape, enter, arrow keys, etc. |
| Send a key to all panes in a tab |
Navigation & Layout
Tool | Description |
| Focus a pane by ID |
| Focus Up/Down/Left/Right |
| Switch to tab by index |
| Resize a pane |
| Toggle zoom (maximize/restore) |
| Move a pane into its own tab |
| Toggle fullscreen |
Titles & Workspace
Tool | Description |
| Set a tab's title |
| Set a window's title |
| Rename a workspace |
Pane Management
Tool | Description |
| Close a single pane |
| Kill all panes in a tab |
| Full shutdown (panes + GUI + mux + sockets) |
| Kill GUI process only |
| Kill mux-server only |
| Remove stale socket files |
| Kill + relaunch same CLI in place |
Session Recovery
Tool | Description |
| Save state (windows, tabs, panes, CLIs, session IDs) to manifest |
| Recreate full layout from manifest, resume each CLI session |
| Compare manifest vs live state, report drift |
Session Recovery — How It Works
Session ID Capture
Each CLI stores sessions differently. The MCP reads session IDs from the filesystem:
CLI | Session ID Source |
Claude |
|
Gemini |
|
Codex |
|
OpenCode | SQLite DB → session table with directory column |
Goose |
|
Recovery Flow
Save — captures windows → tabs → panes with CLI type, session ID, and CWD
Crash — Wezterm dies but manifest and CLI session files persist
Recover — recreates windows/tabs/panes, validates each session ID exists on disk, resumes with
--resume <id>or falls back to--continue
Platform Support
All OS-specific behavior is centralised in src/platform.ts with three implementations sharing a Unix base:
Concern | Linux | macOS | Windows |
Socket dir |
|
|
|
WezTerm binary | PATH |
|
|
Screenshot | import/scrot/grim/gnome-screenshot | screencapture | PowerShell |
Process mgmt | pgrep/pkill | pgrep/pkill | tasklist/taskkill |
Enter key | CR (PTY translates to LF) | CR | LF (ConPTY) |
Shell | bash | bash | cmd.exe |
CLI wrapping | direct exec | direct exec | cmd.exe /c (npm shims) |
Testing
The test/ directory contains 11 test suites covering all 41 tools:
Test | Focus |
| Full session recovery (7 windows, 22 panes, 14 CLI agents) |
| Status, list, start |
| Spawn, split, get_text |
| send_text, send_text_submit, send_key |
| Broadcast, per-pane, selective send |
| Focus pane, direction, tab |
| Resize, zoom, move_to_tab, fullscreen |
| Tab/window titles, workspace rename |
| read_tab, read_all, read_all_deep, screenshots |
| kill_pane, kill_tab, restart_pane, kill_gui/mux |
| launch_agents, launch_grid, launch_mixed, save/recover |
Tests are designed to be run by an AI agent via MCP tool calls — each test doc describes the steps, expected outputs, and pass criteria.
Known Limitations
Wezterm version: Tested with 20240203. The
format-window-titlecallback parameter types vary between versions.Session resume: Only works if the CLI's session file persists on disk. Short-lived sessions that get cleaned up before save can't be resumed.
Deep read timeout:
wez_read_all_deepwaits up to 30 seconds per idle agent.screenshot_all_tabs: Flaky due to tab-switching timing — may capture 0 tabs.
Stale mux servers: Wezterm can leave stale mux servers. After
wez_kill_all, usewez_startbefore spawning new panes.
Disclaimer
USE AT YOUR OWN RISK. This software launches AI coding agents in autonomous mode with permissions to read, write, and execute files on your system. By design, it bypasses each CLI's safety prompts (--dangerously-skip-permissions, --sandbox=none, -a never, etc.) so agents can operate without human approval of individual actions.
This means:
Agents can and will modify files, run shell commands, and make network requests without asking
Multiple agents running in parallel can produce unexpected interactions
There is no undo — changes agents make to your filesystem are immediate and permanent
Session recovery resumes agents with full conversation context, which may include stale or incorrect instructions
Do not run this on production systems, with access to sensitive data, or in environments where unreviewed code execution is unacceptable. Use isolated directories, sandboxed environments, or disposable VMs when possible. The authors accept no liability for any damage, data loss, or unintended consequences resulting from use of this software.
License
PolyForm Strict 1.0.0 — personal and non-commercial use only. No modifications, no commercial/enterprise use. See LICENSE for full terms.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/multiagentcognition/wezterm-agent-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server