Model Context Protocol server that lets LLMs collaboratively drive tmux
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
We haven't yet run this listing's install command through our automated sandbox check. This isn't a red flag β we're steadily working through the catalog.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
Remote-first tmux co-pilot for humans + LLMs.
mcp-tmux is a Model Context Protocol server for people who learned the hard way that large language models are extremely confident about terminals they cannot actually see. It lets an LLM operate inside tmux with real, inspectable state instead of vibes, screenshots, or remembered lies. The server anchors the model to concrete reality: SSH-aware session discovery and bootstrapping, authoritative window and pane topology, and pull-based state snapshots so context is fetched when needed rather than hallucinated continuously. It can spawn or reattach to remote tmux sessions via your SSH config, inject keystrokes into the correct pane on purpose, read scrollback with full historical context, manage windows and splits deterministically, and enforce defaults so the model doesnβt calmly execute commands in a pane that stopped existing five minutes ago.
You need this if you want an LLM to assist in real terminals without pretending the terminal is a chat log. This is for pairing with an AI on live systems, debugging multi-pane chaos, automating the boring parts while you handle the judgment calls, or letting a model help without giving it omnipotent shell access and hoping nothing exciting happens. mcp-tmux exists to replace guesswork with state, narration with observation, and βI think youβre in the left paneβ with provable fact.
Disclaimer: reasonable engineering effort has been applied to reduce the probability of reality-ending command execution. Guardrails exist. So do sharp edges. If something catastrophic happens, it will almost certainly be because a human approved it, ignored context, or decided this was a good idea at the time. Logs are kept. History remembers. Responsibility remains firmly biological.
tmux_state.confirm=true; defaults keep the model from mis-targeting panes.tmux_state snapshot that includes recent scrollback.| Pillar | What it covers |
|---|---|
| Remote orchestration | tmux_open_session, SSH-aware tmux spawn/attach, PATH/tmux-bin overrides, host profiles |
| Grounded control | tmux_state, tmux_capture_pane, tmux_list_*, default targets, pane/window labels |
| Collaboration | tmux_new_window, tmux_split_pane, sync panes, layout capture/restore, layout profiles |
| Safety | confirm=true on destructive calls, logging + audit logs, defaults to avoid mis-targeting |
| Automation | tmux_multi_run, tail/pattern/watch tasks, fan-out capture/tail/pattern modes |
TMUX_BIN=/path/to/tmux). For remote flows, tmux must be installed on the remote host.host parameter is the ssh config Host).During development you can use hot reload:
Add to your MCP client config (example for Claude Desktop/CLI style):
SSH quality-of-life: consider enabling ControlMaster/ControlPersist in your ssh config for faster repeated ssh -T <host> tmux ... invocations.
tmux_open_session: Ensure a remote tmux session exists (create if missing) given host (ssh alias) and session, and set them as defaults.tmux_default_context: Shows detected default session and a quick session listing.tmux_state: Snapshot sessions, windows, panes, and capture of the active/default pane.tmux_set_default / tmux_get_default: Persist or view default host/session/window/pane.tmux_capture_layout / tmux_restore_layout: Save and re-apply window layouts.tmux_tail_pane: Poll a pane repeatedly to follow output without reissuing commands.tmux_tail_task: Task-based tail with polling over time (client polls task results).tmux_select_window / tmux_select_pane: Change focus targets explicitly.tmux_set_sync_panes: Toggle synchronize-panes for a window.tmux_save_layout_profile / tmux_apply_layout_profile: Persist and re-apply layout profiles by name.tmux_readonly_state: Snapshot sessions/windows/panes/capture without touching defaults.tmux_batch_capture: Capture multiple panes in parallel for faster context gathering.tmux_run_batch: Run multiple commands in one call in the same pane (uses && by default, or ;/newline via joinWith for heredocs), auto-clean the prompt (bash/zsh: Ctrl+C then Ctrl+U) before writes by default (cleanPrompt=true), and auto-captures output with paging (starts ~20 lines, grows if needed).tmux_send_keys: Send keys (supports <SPACE>, <ENTER>, <TAB>, <ESC> tokens; empty + enter=true sends Enter).tmux_health: Quick health check (tmux reachable, session listing, host profile info).tmux_context_history: Pull recent scrollback (pane or session) and extract recent commands.tmux_quickstart: Return a concise playbook/do-donβt block for the LLM.tmux_multi_run: Fan-out send + capture/tail/pattern to multiple hosts/panes.tmux_state_resource (URI tmux://state/default) returns the current default snapshot on read.~/.config/mcp-tmux/logs/{host}/{session}/YYYY-MM-DD.log (override with MCP_TMUX_LOG_DIR).tmux_set_audit_logging to log commands and outputs verbosely (may grow large).tmux_list_sessions: Enumerate sessions with window/attach counts.tmux_list_windows: List windows (optionally scoped to a session).tmux_list_panes: List panes (optionally scoped to a target).tmux_capture_pane: Read scrollback from a pane (defaults to last ~200 lines).tmux_send_keys: Send keystrokes to a pane, optionally with Enter.tmux_new_session: Create a detached session to collaborate in.tmux_new_window: Create a window inside a session.tmux_split_pane: Split a pane horizontally/vertically, optionally with a command.tmux_kill_session, tmux_kill_window, tmux_kill_pane: Tear down targets (require confirm=true).tmux_rename_session, tmux_rename_window: Rename targets.tmux_command: Raw access to any tmux command/flags for advanced cases.Targets accept standard tmux notation: session, session:window, session:window.pane, or pane/window IDs. Most tools also accept an optional host (ssh alias) and will fall back to MCP_TMUX_HOST or whatever tmux_open_session last set.
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/mcp-tmux)<a href="https://allmcps.com/mcp/mcp-tmux"><img src="https://allmcps.com/api/badge/mcp-tmux?style=directory" alt="MCP Tmux on AllMCPs" /></a>