cmux-mcp
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., "@cmux-mcp create a new workspace called 'dev' in /projects"
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.
MCP server wrapping the cmux CLI. Lets an MCP client (Claude Code, etc.) drive cmux panes, workspaces, terminal input, and the embedded browser.
It shells out to the cmux binary — cmux handles socket auth and ref parsing,
so this stays a thin, robust layer rather than re-speaking the Unix-socket RPC.
Tools
Tool | What it does |
| Current + focused window/workspace/pane/surface refs (JSON) |
| window > workspace > pane > surface hierarchy |
| List |
| Read a terminal surface's screen / scrollback (workspace/window-aware) |
| Split a new terminal or browser pane (optional |
| Create a workspace (name, cwd, startup command, optional group) |
| Inspect/reload |
| List health details (e.g. stuck/unresponsive terminals) for surfaces in a workspace |
| Group workspaces under a collapsible sidebar header |
| rename / collapse / expand / pin / focus / set-color / set-icon / move / ungroup / delete (confirm-guarded) a group |
| add / remove / set-anchor of a group's member workspaces |
| Retitle a workspace (via |
| Retitle a tab (the pane's tab label, via |
| Focus a pane |
| Close a surface or workspace (explicit ref, or |
| Type literal text into a pane (no Enter, workspace/window-aware) |
| Send a named key ( |
| List a workspace's panels to discover a panel ref |
| Send text to an agent panel ( |
| Poll a panel until it's ready for input (vs. sleeping) |
| Post a cmux notification |
| Passthrough for any |
| Escape hatch — run any |
The browser and raw passthroughs cover cmux's full surface without exploding the tool list into ~90 entries. The typed tools just save the agent from hand-assembling argv for the common verbs.
Related MCP server: interminal
Workspace targeting
cmux defaults pane/workspace-spawning commands to the focused workspace,
which drifts as the user clicks around. When a tool call omits workspace, the
server falls back to CMUX_WORKSPACE_ID from its own environment — i.e. the
workspace the MCP client (and this server) was launched in — so new panes land
where the user is actually working. Pass workspace explicitly to override.
Driving a surface in another workspace
cmux_send, cmux_send_key, and cmux_capture resolve a bare surface:N ref
against the caller's workspace. To drive a pane in a workspace you spawned
elsewhere (e.g. a cmux_new_workspace running Claude), pass workspace (and
window if needed) alongside surface. Without it cmux can't find the ref and
reports a misleading Surface is not a terminal; these tools now rewrite that to
name the surface's real workspace and tell you which workspace= to pass.
For agent panels (cmux claude-teams), discover the ref with cmux_list_panels,
drive it with cmux_send_panel, and use cmux_wait_ready (with a pattern
matching the input prompt) to know when it accepts input instead of sleeping.
Splitting next to a specific pane (anchor_pane)
cmux new-pane has no pane-anchor flag — it splits the target workspace's
active pane — so a bare "split right" lands wherever focus drifted, possibly in a
different workspace than the caller. cmux_new_pane accepts an optional
anchor_pane (a pane:N or surface:N ref): the server looks up the workspace
that pane lives in, focuses it there, then splits — so the new pane lands next to
that exact pane regardless of current UI focus. Pass your own
cmux_identify → caller.pane_ref to place panes next to yourself.
Target resolution order: anchor_pane > workspace > the caller's workspace
(CMUX_WORKSPACE_ID / identify.caller) > the focused workspace. The caller's
workspace beats focused because an MCP caller almost always wants the new pane
next to itself, not wherever a human last clicked.
"Close this workspace" safety
cmux identify returns two refs: caller (the pane the calling process actually
runs in) and focused (the workspace with UI focus right now). These differ — an
agent runs in workspace A while the user clicks into workspace B, so B is focused.
cmux_close with ref: "current" always resolves the target from
identify.caller.workspace_ref, never focused. If caller is null (invoked
outside a cmux terminal) it refuses and asks for an explicit ref rather than
guessing from focus. The first call only previews the resolved target
(About to close workspace:5 — user-roles-3. Confirm?); you must call again with
confirm=true to actually close — so a wrong target is caught before it's
destructive.
Do not use
identify --no-caller(or readfocused.workspace_ref) when the intent is "act on my own workspace" — it dropscallerand can close whatever the user last clicked.--no-calleris only for queries about UI focus.
Install
Requires Node ≥ 18 and the cmux app (the cmux binary).
Without cloning (recommended)
npx installs and builds straight from GitHub — no clone, no manual build:
claude mcp add cmux -- npx -y github:puchkoff/cmux-mcpThe first run compiles the TypeScript (via the package's prepare step) and caches it; later runs start instantly.
From a clone
git clone https://github.com/puchkoff/cmux-mcp.git
cd cmux-mcp
npm install
npm run build # compiles to dist/Register with Claude Code
If you cloned, register with the absolute path to the built entrypoint:
claude mcp add cmux -- node /absolute/path/to/cmux-mcp/dist/index.js--scope userregisters it for every project (default is the current project).After adding, restart Claude Code (or reconnect via
/mcp) — MCP tools load at session start.Verify:
claude mcp get cmuxshould report✓ Connected. Thecmux_*tools then appear.
Or register by hand in .mcp.json / settings:
{
"mcpServers": {
"cmux": {
"command": "node",
"args": ["/absolute/path/to/cmux-mcp/dist/index.js"]
}
}
}Works with any MCP client (Cursor, etc.) — point it at node dist/index.js.
Env
CMUX_BIN— path to thecmuxbinary if it isn't onPATH(bundled at/Applications/cmux.app/Contents/Resources/bin/cmuxon macOS).CMUX_WORKSPACE_ID— default workspace ref (auto-set inside a cmux pane).
Available Tools
23 toolscmux_browserDrive the embedded browserB
Run a cmux browser subcommand. Pass tokens as an args array, e.g. ["goto","https://x.com","--snapshot-after"] or ["click","button#submit"]. Common subcommands: open, goto, snapshot, screenshot, click, type, fill, eval, get, find, wait, back, reload.
Inputs: args (required).
cmux_captureRead pane outputA
Read the current screen or scrollback of a terminal surface. Pass workspace/window for a surface in another workspace.
Inputs: lines, window, surface, workspace, +1 more.
cmux_closeClose a surface or workspaceA
Close a surface (tab) or an entire workspace. For kind "surface" a pane ref also works (closes that pane's selected surface). For kind "workspace", ref "current" safely closes the CALLING pane's own workspace (never the UI-focused one) — first call previews it, call again with confirm=true to close.
Inputs: ref (required), kind (required), confirm.
cmux_configInspect or reload cmux.json configA
Manage cmux settings (~/.config/cmux/cmux.json). doctor: validate JSONC. path/docs: print paths/schema URL (run before hand-editing; back up to .bak first). reload: re-read config + Ghostty, no restart needed. get/set: read/write sidebar-font-size or surface-tab-bar-font-size.
Inputs: action (required), key, path, points.
cmux_focus_paneFocus a paneC
Move focus to the given pane.
Inputs: pane (required), workspace.
cmux_group_actionAct on a workspace groupA
Run an action on a group: rename (needs name), collapse, expand, pin, unpin, focus (focuses its anchor), set-color (hex; omit to clear), set-icon (symbol; omit to clear), move (toIndex/before/after), ungroup (dissolve, keep workspaces), delete (CLOSES every member workspace — needs confirm=true; prefer ungroup).
Inputs: group (required), action (required), hex, name, +5 more.
cmux_group_membersManage group membershipB
add a workspace to a group, remove a workspace from its group (group inferred from membership), or set-anchor to make a member the group's anchor/header row.
Inputs: action (required), workspace (required), group.
cmux_identifyIdentify current contextA
Return caller and focused window/workspace/pane/surface refs as JSON. caller = you (the issuing pane); focused = current UI focus — they differ if focus moved away. Use caller.pane_ref as anchor_pane in cmux_new_pane to place panes next to yourself.
Inputs: no named parameters.
cmux_listList windows / workspaces / panesC
List cmux objects of the given kind.
Inputs: kind (required), workspace.
cmux_list_panelsList panelsA
List the panels (agent/terminal surfaces) in a workspace, so you can discover a panel ref to drive.
Inputs: window, workspace.
cmux_new_groupCreate a workspace groupA
Group workspaces under a collapsible sidebar header (spawns a fresh anchor workspace as the header row). Omitting workspaces seeds from the active sidebar selection/caller workspace — pass it explicitly to control membership.
Inputs: cwd, name, workspaces.
cmux_new_paneSplit a new paneB
Open a new pane by splitting in the given direction. Pass anchor_pane (your pane_ref from cmux_identify.caller) to split next to that specific pane regardless of UI focus. Resolution order: anchor_pane > workspace > caller's workspace > focused workspace.
Inputs: url, type, direction, workspace, +1 more.
cmux_new_workspaceCreate a workspaceB
Create a new workspace, optionally with a title, cwd, and startup command. Pass group to create it inside a workspace group.
Inputs: cwd, name, group, command.
cmux_notifyPost a notificationC
Show a cmux notification.
Inputs: title (required), body, workspace.
cmux_rawRun any cmux commandA
Escape hatch for cmux subcommands without a dedicated tool. Pass tokens after "cmux" as an array, e.g. ["new-split","right","--focus","true"]. Run ["help"] to discover commands.
Inputs: args (required).
cmux_rename_tabRename a tabA
Set a tab's title (the pane's tab label). Target the tab by ref, or by a surface inside it; defaults to the current tab.
Inputs: title (required), tab, surface, workspace.
cmux_rename_workspaceRename a workspaceB
Set a workspace title. Uses workspace-action (the legacy rename alias mangles args).
Inputs: title (required), workspace.
cmux_sendSend text to a paneA
Type literal text into a terminal surface. Does NOT press Enter — follow with cmux_send_key Enter. Pass workspace/window to target a surface in another workspace.
Inputs: text (required), window, surface, workspace.
cmux_send_keySend a key to a paneA
Send a named key such as Enter, Tab, Escape, C-c, C-d. Ctrl chords accept either form: "C-u" or "ctrl+u". Pass workspace/window to target a surface in another workspace.
Inputs: key (required), window, surface, workspace.
cmux_send_panelSend text to a panelB
Send text into an agent panel via send-panel. Use cmux_list_panels to find the panel ref. Pass workspace/window when the panel lives in another workspace.
Inputs: text (required), panel (required), window, workspace.
cmux_surface_healthCheck surface healthA
List health details (e.g. stuck/unresponsive terminals) for surfaces in a workspace.
Inputs: window, workspace.
cmux_treeShow hierarchyC
Print the window > workspace > pane > surface tree.
Inputs: all, workspace.
cmux_wait_readyWait for a panel to be readyA
Poll a surface until ready, then return the final screen. Ready = matches pattern regex, or (no pattern) the screen is non-empty and unchanged between polls. Use instead of sleeping after spawning a panel; for a live TUI that never settles, pass a pattern.
Inputs: surface (required), window, pattern, timeoutMs, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 23 tools
Most tools target distinct resource+action pairs (new_pane vs new_workspace, send vs send_key, capture vs identify). A few boundaries blur: cmux_list vs cmux_list_panels, cmux_send vs cmux_send_panel, and cmux_group_action vs cmux_group_members overlap conceptually but are differentiated by descriptions and target type. cmux_raw is a deliberate universal escape hatch that inevitably overlaps everything.
The cmux_ prefix and snake_case casing are perfectly consistent across all 23 tools. However the verb pattern is mixed: some are verb_noun (new_pane, rename_workspace, focus_pane, list_panels) while others are bare nouns or noun phrases (tree, config, browser, raw, surface_health, group_action, group_members). Readable, but the convention is not uniform.
23 tools is on the heavy side but the domain (windows, workspaces, panes, surfaces, groups, config, browser) is genuinely broad, so each tool earns a place. Some consolidation is possible—notably via the existing cmux_raw escape hatch that could cover several dedicated wrappers—but overall the count is reasonable for the scope.
The surface covers inspection (list, tree, identify, capture, health), mutation (new_pane, new_workspace, rename, focus, close), interaction (send, send_key, wait_ready), plus groups, config, notify, and browser automation. Minor gaps like pane resize/reorder exist, but the cmux_raw escape hatch makes almost any missing subcommand reachable.
Related MCP Connectors
Remote MCP server exposing your Node Command fleet (files, shell, processes, browser) to AI hosts.
The official MCP Server for the Mux API
MCP server for mandates, delegation, policy-gated execution, credential grants, and audit.
Remote MCP access to user-authorized Linux, Windows and Intel Mac devices for AI assistants.
Related MCP Servers
- AlicenseAqualityCmaintenanceTerminal multiplexer MCP server for orchestrating parallel AI agents. Manages workspaces, panes, surfaces with send_input/read_screen/spawn_agent/stop_agent tools. Supports Claude Code, Codex, Gemini, Cursor CLI agents with lifecycle management, browser automation, and agent status push via Claude --channels.1032Apache 2.0
- AlicenseAqualityCmaintenanceMCP server for SSH and local terminal access. Supports interactive commands, long-running processes, and TUI apps like tmux/zellij64MIT
- FlicenseNot gradedqualityDmaintenanceMCP server for tmux operations that provides comprehensive control over tmux sessions, windows, and panes.1-
- AlicenseBqualityDmaintenanceLocal + remote terminal interaction control MCP Server. Lets AI agents control interactive TUI programs the way a human would.296 npmMIT