tmux-mcp
v0.3.3MCP server for tmux — browse sessions, capture output, send commands.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
list_sessions
List all active tmux sessions. Returns session name, window count, creation time, and attached status. WHEN TO CALL: Call this immediately whenever the user mentions tmux, asks to attach a session, wants to see terminal output, check logs, run a command in a pane, or interact with any running process. Do not answer from memory — always call this tool first to get live state. WORKFLOW: After getting sessions, ask the user which session, call list_windows, ask which window, call list_panes, ask which pane, then call capture_pane.
list_windows
List all windows in a tmux session. Returns window index, name, pane count, and active status. If there is only one window, auto-select it without asking. If multiple, ask the user which window to use.
| Parameter | Type | Description |
|---|---|---|
session * | string | Session name (from list_sessions) |
list_panes
List panes in a tmux target. Pass a session name ('work') or session:window ('work:0'). When only a session name is passed, lists all panes across all windows in that session. Returns pane index, size, active status, and running command. If there is only one pane, auto-select it without asking. If multiple, present them as choices and ask the user which pane to use.
| Parameter | Type | Description |
|---|---|---|
target * | string | Session name or 'session:window' |
capture_pane
Capture current output of a tmux pane. Target format: 'session:window.pane' (e.g. 'work:0.0'). Use list_sessions → list_windows → list_panes to build the target. WARNING: pane output may contain environment variables, API keys, tokens, and credentials — do not call if the pane may contain sensitive data unless the user has confirmed it is safe. AFTER displaying the output, always ask the user what to do next with these options: Refresh (call capture_pane again), Send command (ask what command then call send_keys), Switch pane (restart from list_sessions), Done (stop). Loop until the user…
| Parameter | Type | Description |
|---|---|---|
target * | string | Pane target: 'session:window.pane' |
lines | integer | Lines of scrollback to include (default: 150) |
send_keys
Send keys or a command to a tmux pane, then capture its output. Target format: 'session:window.pane'. Use enter=false for raw tmux key sequences like 'C-c', 'Escape', or arrow keys — these are not shell commands and must not have Enter appended. Use enter=true (default) for shell commands. Set wait_ms higher for long-running commands; 0 captures immediately before output appears. WARNING: this executes arbitrary commands in your shell — only use with trusted input.
| Parameter | Type | Description |
|---|---|---|
keys * | string | Command or key sequence (tmux notation: 'C-c', 'Escape', 'Up', etc.) |
target * | string | Pane target: 'session:window.pane' |
capture_lines | integer | Lines to capture after sending (default: 50) |
enter | boolean | Press Enter after keys (default: true). Set false for raw key sequences like C-c, Escape, arrow keys. |
wait_ms | integer | Milliseconds to wait before capturing (default: 400). Set higher for slow commands, 0 to capture immediately. |
new_session
Create a new detached tmux session. Before calling, use list_sessions to check whether a session with the requested name already exists.
| Parameter | Type | Description |
|---|---|---|
command | string | Shell command to run immediately in the first window. WARNING: executes in your shell. |
cwd | string | Working directory for the session. |
name | string | Session name. Omit to let tmux auto-assign one. |
new_window
Create a new window in an existing tmux session.
| Parameter | Type | Description |
|---|---|---|
session * | string | Session name to create the window in. |
command | string | Shell command to run immediately. WARNING: executes in your shell. |
cwd | string | Working directory for the new window. |
name | string | Window name. |
split_pane
Split a tmux pane horizontally or vertically. 'horizontal' = left/right panes side by side. 'vertical' = top/bottom panes stacked. Target format: 'session:window.pane' or 'session:window'.
| Parameter | Type | Description |
|---|---|---|
target * | string | Target pane or window to split: 'session:window.pane' |
command | string | Shell command to run in the new pane. WARNING: executes in your shell. |
cwd | string | Working directory for the new pane. |
direction | string | 'horizontal' splits left/right, 'vertical' splits top/bottom (default: horizontal) |
size | integer | Size of the new pane as a percentage (e.g. 50). |
kill_session
Kill a tmux session and all its windows and panes. ALWAYS confirm with the user before calling — this is destructive and cannot be undone.
| Parameter | Type | Description |
|---|---|---|
session * | string | Session name to kill. |
kill_window
Kill a tmux window and all its panes. ALWAYS confirm with the user before calling — this is destructive and cannot be undone. Target format: 'session:window'.
| Parameter | Type | Description |
|---|---|---|
target * | string | Window target: 'session:window' |
kill_pane
Kill a tmux pane and terminate its running process. ALWAYS confirm with the user before calling — this is destructive and cannot be undone. Target format: 'session:window.pane'.
| Parameter | Type | Description |
|---|---|---|
target * | string | Pane target: 'session:window.pane' |
rename_session
Rename an existing tmux session.
| Parameter | Type | Description |
|---|---|---|
new_name * | string | New session name. |
session * | string | Current session name. |
rename_window
Rename a window in a tmux session. Target format: 'session:window'.
| Parameter | Type | Description |
|---|---|---|
new_name * | string | New window name. |
target * | string | Window target: 'session:window' |
get_config
Returns the current tmux-mcp configuration: whether tmux is installed, the default session name, and whether the agent is configured to always route shell commands through tmux. Call this at the start of any task to check how the agent should behave. If alwaysUseTmux is true, route all shell commands through send_keys in the configured session instead of direct Bash for the remainder of the task.