Skip to main content
Glama

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

cmux_identify

Current + focused window/workspace/pane/surface refs (JSON)

cmux_tree

window > workspace > pane > surface hierarchy

cmux_list

List windows / workspaces / panes / groups

cmux_capture

Read a terminal surface's screen / scrollback (workspace/window-aware)

cmux_new_pane

Split a new terminal or browser pane (optional anchor_pane for deterministic placement)

cmux_new_workspace

Create a workspace (name, cwd, startup command, optional group)

cmux_config

Inspect/reload cmux.json — doctor, path/docs, reload, get/set font-size keys

cmux_surface_health

List health details (e.g. stuck/unresponsive terminals) for surfaces in a workspace

cmux_new_group

Group workspaces under a collapsible sidebar header

cmux_group_action

rename / collapse / expand / pin / focus / set-color / set-icon / move / ungroup / delete (confirm-guarded) a group

cmux_group_members

add / remove / set-anchor of a group's member workspaces

cmux_rename_workspace

Retitle a workspace (via workspace-action)

cmux_rename_tab

Retitle a tab (the pane's tab label, via rename-tab)

cmux_focus_pane

Focus a pane

cmux_close

Close a surface or workspace (explicit ref, or "current" to safely close the calling pane's own workspace, confirm-guarded)

cmux_send

Type literal text into a pane (no Enter, workspace/window-aware)

cmux_send_key

Send a named key (Enter, C-c/ctrl+c, …)

cmux_list_panels

List a workspace's panels to discover a panel ref

cmux_send_panel

Send text to an agent panel (send-panel)

cmux_wait_ready

Poll a panel until it's ready for input (vs. sleeping)

cmux_notify

Post a cmux notification

cmux_browser

Passthrough for any cmux browser subcommand (args array)

cmux_raw

Escape hatch — run any cmux subcommand

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 read focused.workspace_ref) when the intent is "act on my own workspace" — it drops caller and can close whatever the user last clicked. --no-caller is only for queries about UI focus.

Install

Requires Node ≥ 18 and the cmux app (the cmux binary).

npx installs and builds straight from GitHub — no clone, no manual build:

claude mcp add cmux -- npx -y github:puchkoff/cmux-mcp

The 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 user registers 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 cmux should report ✓ Connected. The cmux_* 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 the cmux binary if it isn't on PATH (bundled at /Applications/cmux.app/Contents/Resources/bin/cmux on macOS).

  • CMUX_WORKSPACE_ID — default workspace ref (auto-set inside a cmux pane).

Available Tools

23 tools
cmux_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

    B3.2/5.0

    Scored across 23 tools

    Disambiguation4/5

    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.

    Naming Consistency3/5

    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.

    Tool Count4/5

    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.

    Completeness4/5

    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

    Related MCP Servers

    • A
      license
      A
      quality
      C
      maintenance
      Terminal 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.
      10
      32
      Apache 2.0
    • A
      license
      A
      quality
      C
      maintenance
      MCP server for SSH and local terminal access. Supports interactive commands, long-running processes, and TUI apps like tmux/zellij
      6
      4
      MIT