tmux MCP, built in Rust
tmux terminal control for AI agents, built on libtmux for Rust and rmcp. This server maps tmux's object hierarchy — sessions, windows, panes — into MCP tools grouped by the operation they request. The server enforces the selected groups at the MCP tool boundary.
tmux through MCP
tmux before the first call.
tmux after create_session.
tmux after list_panes: unchanged, the call only reads.
tmux after split_window.
tmux after get_tmux_variables: unchanged, the call only reads.
$ pytest -q .. [100%] 2 passed in 0.01s
tmux after run_shell_command.
$ pytest -q .. [100%] 2 passed in 0.01s
$ cat checks.log 2026-01-01 checks started 2026-01-01 checks finished
tmux after run_shell_command.
tmux after kill_session.
Create a tmux session called checks, split its window into two panes, run pytest -q in one and show checks.log in the other, show me the results, then remove the session.
AgentCreate the session.
Result
{ "attached": false, "id": "$0", "name": "checks", "windows": 1}AgentList the panes, each with its window id.
Result
{ "panes": [ { "active": true, "caller": "unknown", "command": "sh", "id": "%0", "path": "/home/user/project", "window_id": "@0" } ]}AgentSplit the pane the list returned (%0) in two.
Result
{ "active": false, "caller": "unknown", "command": "sh", "id": "%1", "path": "/home/user/project", "window_id": "@0"}AgentRead the window's layout, which tmux calls window_layout, through the pane the list returned (%0).
Result
{ "values": { "window_layout": "8205,80x24,0,0{40x24,0,0,0,39x24,41,0,1}" }}AgentRun the tests in the pane the list returned (%0).
Result
{ "bytes": 320, "exit_status": 0, "outcome": "completed", "output": ".. [100%]\n2 passed in 0.01s\n", "pane": "%0", "truncated": false}AgentShow the log in the new pane the split returned (%1).
Result
{ "bytes": 257, "exit_status": 0, "outcome": "completed", "output": "2026-01-01 checks started\n2026-01-01 checks finished\n", "pane": "%1", "truncated": false}AgentRemove the session once the result is read.
Result
{ "id": "$0"}pytest printed 2 passed and checks.log ends with checks finished. I removed the checks session.
Install
Choose your client and configuration scope, then run the command or paste the configuration.
$ cargo install tmux-mcp$ claude mcp add tmux -- tmux-mcp$ cargo install tmux-mcp$ claude mcp add tmux --scope user -- tmux-mcp$ cargo install tmux-mcp$ claude mcp add tmux --scope project -- tmux-mcp$ cargo install tmux-mcp{
"mcpServers": {
"tmux": {
"command": "tmux-mcp"
}
}
}$ cargo install tmux-mcp$ codex mcp add tmux -- tmux-mcp$ cargo install tmux-mcp[mcp_servers.tmux]
command = "tmux-mcp"$ cargo install tmux-mcp$ gemini mcp add --scope user tmux tmux-mcp$ cargo install tmux-mcp$ gemini mcp add --scope project tmux tmux-mcp$ cargo install tmux-mcp{
"mcpServers": {
"tmux": {
"command": "tmux-mcp"
}
}
}$ cargo install tmux-mcp{
"mcpServers": {
"tmux": {
"command": "tmux-mcp"
}
}
}$ cargo install tmux-mcp$ grok mcp add --scope user tmux -- tmux-mcp$ cargo install tmux-mcp$ grok mcp add --scope project tmux -- tmux-mcp$ cargo install tmux-mcp{
"mcpServers": {
"tmux": {
"command": "tmux-mcp"
}
}
}$ cargo install tmux-mcp$ opencode mcp add tmux -- tmux-mcpWrites ~/.claude.json (this project).
The installed tmux-mcp binary speaks MCP on stdin and stdout.
Writes ~/.claude.json (all projects).
The installed tmux-mcp binary speaks MCP on stdin and stdout.
Writes .mcp.json (in repo, version-controlled).
The installed tmux-mcp binary speaks MCP on stdin and stdout.
The installed tmux-mcp binary speaks MCP on stdin and stdout.
Writes ~/.codex/config.toml.
The installed tmux-mcp binary speaks MCP on stdin and stdout.
Codex's CLI doesn't support project scope yet — paste this into .codex/config.toml at the repo root.
The installed tmux-mcp binary speaks MCP on stdin and stdout.
Writes ~/.gemini/settings.json.
The installed tmux-mcp binary speaks MCP on stdin and stdout.
Writes .gemini/settings.json (in repo).
The installed tmux-mcp binary speaks MCP on stdin and stdout.
The installed tmux-mcp binary speaks MCP on stdin and stdout.
The installed tmux-mcp binary speaks MCP on stdin and stdout.
Writes ~/.grok/config.toml.
The installed tmux-mcp binary speaks MCP on stdin and stdout.
Writes ./.grok/config.toml (in repo).
The installed tmux-mcp binary speaks MCP on stdin and stdout.
The installed tmux-mcp binary speaks MCP on stdin and stdout.
Writes ~/.config/opencode/opencode.jsonc.
The installed tmux-mcp binary speaks MCP on stdin and stdout.
tmux-mcp serves tmux over MCP stdio. It provides topology discovery,
terminal capture, command execution, bounded waits, and a static capability
resource.
Building requires Rust 1.88 or newer. Running requires tmux 3.3a or newer. A daemon older than 3.3a is refused before any effect; see tmux support.
Toolsets select inspection, management, execution, and teardown. Read
tmux://capabilities for the effective startup selection.
Start here
- Install points an MCP client at this server.
- Tools lists the MCP operations, arguments, and results.
- Guides connect a client and choose its tmux socket.
- Topics explain toolsets, command waits, and capability discovery.
- Examples run a Rust MCP client with a private tmux server.
- Language API documents embedding and implementation types.
The Rust Workspace Manager is a separate crate. The current MCP catalog does not include a workspace-file operation.
Crate documentation and prerequisites.
Tools by tier
The Rust server groups its tools by what they request. A tier badge tells you how far a call reaches before you approve it. Set LIBTMUX_TOOLSETS to a comma-separated list of tiers, such as inspect,manage, to offer only those tools.
Inspect
Request tmux state and terminal output.
-
call_read_tools_batchInspect Call a serial batch of at most sixteen enabled inspect tools. -
capture_paneInspect Read a pane's contents. -
capture_sinceInspect Read what a pane wrote since the previous call. -
find_pane_by_positionInspect Find the pane touching a named window corner. -
get_pane_infoInspect Return metadata for one pane. -
get_server_infoInspect Report every session with its windows and panes, in one call. -
get_session_infoInspect Return metadata for one session. -
get_tmux_variablesInspect Read a bounded set of tmux variables against one pane. -
get_window_infoInspect Return metadata for one window. -
list_panesInspect List every pane on the server. -
list_sessionsInspect List every tmux session on the server. -
list_windowsInspect List every window on the server. -
search_panesInspect Search what panes are displaying with Rust's linear-time regex engine. -
show_environmentInspect List the variables tmux hands to processes it starts, for the server or for one session, and whether each is set or marked for removal. -
show_hooksInspect List the hooks tmux runs when something happens on the server, such as a pane exiting. -
show_optionInspect Read a tmux option, such as history-limit or a user option like @theme. -
snapshot_paneInspect Read pane content with cursor position, mode state, and scroll position in one reply. -
wait_for_textInspect Wait until a pane writes matching text.
Manage
Change tmux structure or presentation.
-
move_windowManage Move one window to a session and index. -
rename_sessionManage Rename one session. -
rename_windowManage Rename one window. -
resize_paneManage Move one edge of a pane by a number of rows or columns. -
resize_windowManage Resize one window to exact cell dimensions. -
select_layoutManage Rearrange a window's panes using a saved tmux layout or a named layout and its unique abbreviation. -
select_paneManage Select a pane, making it its window's active pane. -
select_windowManage Select a window, making it its session's active window. -
set_mouse_enabledManage Set mouse handling for a session or the global session default. -
set_pane_titleManage Set one pane's title. -
signal_channelManage Signal a tmux wait-for channel, releasing every current waiter. -
swap_paneManage Swap the positions of two panes. -
wait_for_channelManage Block until something signals a tmux wait-for channel.
Execute
Start or drive pane processes, or store state that can control later execution.
-
create_sessionExecute Create a new detached tmux session. -
create_windowExecute Create a window running its configured process. -
paste_textExecute Put text into a pane through a tmux paste buffer instead of typing it key by key. -
respawn_paneExecute Restart a pane's configured process with no command payload. -
run_shell_commandExecute Run a shell command in a pane, wait for it to finish, and report its exit status with retained output. -
send_keysExecute Type text into a pane, press named keys in it, or both. -
send_keys_batchExecute Send an ordered batch of input operations to panes. -
set_synchronize_panesExecute Set the window default for synchronized pane input. -
split_windowExecute Split a window and start the configured process with no command payload.
Teardown
Delete tmux objects or retained scrollback. Not reversible.
-
clear_pane_scrollbackTeardown Discard a pane's retained scrollback. -
kill_paneTeardown Kill a pane. -
kill_sessionTeardown Kill a tmux session and everything in it. -
kill_windowTeardown Kill a window, closing it in every session that links it. -
set_history_limitTeardown Set the scrollback history limit for a session or its global default.
Browse every tool, with its arguments, result and protocol data.