MCPpre-alphaHome

Choose documentation 3

latest

Current version

latest
English

Early release libtmux is released, and its APIs may still change between releases. This site's structure and URLs may change too.

MoreLess about this notice

In development Server behavior and tool contracts may change. Tool availability depends on the server configuration.

Edit this page on GitHub

tmux MCP, built in Python

tmux terminal control for AI agents, built on libtmux for Python and FastMCP. 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

Replay Hover a call to preview the tmux state after it. Use its pin button to hold it. With the replay focused, the arrow keys, Home and End step through the calls.

tmux before the first call.

tmux window of 1 pane
%0 sh
[checks] 0:sh*

tmux after create_session.

tmux window of 2 panes
%0 sh
%1 sh
[checks] 0:sh*

tmux after split_window.

tmux window of 2 panes
%0 sh
%1 sh
[checks] 0:sh*

tmux after list_windows: unchanged, the call only reads.

tmux window of 2 panes
%0 sh
$ pytest -q
$  (
pytest -q
..                               [100%]
2 passed in 0.01s
$
%1 sh
[checks] 0:sh*

tmux after run_command.

tmux window of 2 panes
%0 sh
$ pytest -q
$  (
pytest -q
..                               [100%]
2 passed in 0.01s
$
%1 sh
$ cat checks.log
$  (
cat checks.log
2026-01-01 checks started
2026-01-01 checks finished
$
[checks] 0:sh*

tmux after run_command.

No sessions

tmux after kill_session.

You

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.

create_session Execute {"session_name":"checks"}
Result
{
"session_id": "$0",
"session_name": "checks",
"window_count": 1,
"session_attached": "0",
"session_created": "1795059312",
"active_pane_id": "%0"
}

AgentSplit the pane the create result returned (%0) in two.

split_window Execute {"pane_id":"%0","direction":"right"}
Result
{
"pane_id": "%1",
"pane_index": "1",
"pane_width": "39",
"pane_height": "24",
"pane_left": 41,
"pane_top": 0,
"pane_right": 79,
"pane_bottom": 23,
"pane_at_left": false,
"pane_at_right": true,
"pane_at_top": true,
"pane_at_bottom": true,
"…": "9 more"
}

AgentRead the window's layout.

list_windows Inspect {"session_name":"checks"}
Result
{
"result": [
{
"window_id": "@0",
"window_name": "sh",
"window_index": "0",
"session_id": "$0",
"session_name": "checks",
"pane_count": 2,
"window_layout": "8205,80x24,0,0{40x24,0,0,0,39x24,41,0,1}",
"window_active": "1",
"window_width": "80",
"window_height": "24",
"active_pane_id": "%0"
}
]
}

AgentRun the tests in the pane the create result returned (%0).

run_command Execute {"pane_id":"%0","command":"pytest -q"}
Result
{
"pane_id": "%0",
"exit_status": 0,
"timed_out": false,
"elapsed_seconds": 0.8076037850041757,
"output": [
"$ (",
"pytest -q",
".. [100%]",
"2 passed in 0.01s",
"… 1 more"
],
"output_truncated": false,
"output_truncated_lines": 0,
"effective_timeout": 30
}

AgentShow the log in the new pane the split returned (%1).

run_command Execute {"pane_id":"%1","command":"cat checks.log"}
Result
{
"pane_id": "%1",
"exit_status": 0,
"timed_out": false,
"elapsed_seconds": 0.029483657999662682,
"output": [
"$ (",
"cat checks.log",
"2026-01-01 checks started",
"2026-01-01 checks finished",
"… 1 more"
],
"output_truncated": false,
"output_truncated_lines": 0,
"effective_timeout": 30
}

AgentRemove the session once the result is read.

kill_session Teardown {"session_name":"checks"}
Result
{
"result": "Session killed: checks"
}
Agent

pytest printed 2 passed and checks.log ends with checks finished. I removed the checks session.

1/6

Install

Choose your client and configuration scope, then run the command or paste the configuration.

Terminal
Terminal
Terminal
Terminal
Terminal
Terminal
Terminal
Terminal
Terminal
Terminal
Terminal
Terminal
Terminal
Terminal
Terminal
Terminal
Terminal
Terminal
Terminal
Terminal
Terminal
Terminal
Terminal
Terminal
Terminal
Terminal
Terminal
claude_desktop_config.json
claude_desktop_config.json
claude_desktop_config.json
claude_desktop_config.json
claude_desktop_config.json
claude_desktop_config.json
claude_desktop_config.json
claude_desktop_config.json
claude_desktop_config.json
Terminal
Terminal
Terminal
.codex/config.toml
.codex/config.toml
.codex/config.toml
Terminal
Terminal
Terminal
.codex/config.toml
.codex/config.toml
.codex/config.toml
Terminal
Terminal
Terminal
.codex/config.toml
.codex/config.toml
.codex/config.toml
Terminal
Terminal
Terminal
Terminal
Terminal
Terminal
Terminal
Terminal
Terminal
Terminal
Terminal
Terminal
Terminal
Terminal
Terminal
Terminal
Terminal
Terminal
.cursor/mcp.json
.cursor/mcp.json
.cursor/mcp.json
~/.cursor/mcp.json
~/.cursor/mcp.json
~/.cursor/mcp.json
.cursor/mcp.json
.cursor/mcp.json
.cursor/mcp.json
~/.cursor/mcp.json
~/.cursor/mcp.json
~/.cursor/mcp.json
.cursor/mcp.json
.cursor/mcp.json
.cursor/mcp.json
~/.cursor/mcp.json
~/.cursor/mcp.json
~/.cursor/mcp.json
Terminal
Terminal
Terminal
Terminal
Terminal
Terminal
Terminal
Terminal
Terminal
Terminal
Terminal
Terminal
Terminal
Terminal
Terminal
Terminal
Terminal
Terminal
~/.gemini/config/mcp_config.json
~/.gemini/config/mcp_config.json
~/.gemini/config/mcp_config.json
~/.gemini/config/mcp_config.json
~/.gemini/config/mcp_config.json
~/.gemini/config/mcp_config.json
~/.gemini/config/mcp_config.json
~/.gemini/config/mcp_config.json
~/.gemini/config/mcp_config.json
Terminal
Terminal
Terminal
Terminal
Terminal
Terminal
Terminal
Terminal
Terminal
libtmux-mcp 0.1.0a22 pre-alpha PyPI
$ claude mcp add tmux -- uvx libtmux-mcp
Cooldown ; libtmux-mcp itself stays current.
$ claude mcp add tmux \
    -- uvx \
        --exclude-newer P7D \
        --exclude-newer-package libtmux-mcp=2099-01-01 \
        libtmux-mcp
Cooldown Bypasses a cooldown set in your uvx configuration, for this install only.
$ claude mcp add tmux -- uvx --no-config libtmux-mcp
$ claude mcp add tmux --scope user -- uvx libtmux-mcp
Cooldown ; libtmux-mcp itself stays current.
$ claude mcp add tmux \
    --scope user \
    -- uvx \
        --exclude-newer P7D \
        --exclude-newer-package libtmux-mcp=2099-01-01 \
        libtmux-mcp
Cooldown Bypasses a cooldown set in your uvx configuration, for this install only.
$ claude mcp add tmux --scope user -- uvx --no-config libtmux-mcp
$ claude mcp add tmux --scope project -- uvx libtmux-mcp
Cooldown ; libtmux-mcp itself stays current.
$ claude mcp add tmux \
    --scope project \
    -- uvx \
        --exclude-newer P7D \
        --exclude-newer-package libtmux-mcp=2099-01-01 \
        libtmux-mcp
Cooldown Bypasses a cooldown set in your uvx configuration, for this install only.
$ claude mcp add tmux --scope project -- uvx --no-config libtmux-mcp
$ claude mcp add tmux -- pipx run libtmux-mcp
Cooldown pipx has no per-package cooldown override, so this snippet runs without cooldown enforcement.
$ claude mcp add tmux -- pipx run libtmux-mcp
Cooldown pipx has no per-package cooldown override, so this snippet runs without cooldown enforcement.
$ claude mcp add tmux -- pipx run libtmux-mcp
$ claude mcp add tmux --scope user -- pipx run libtmux-mcp
Cooldown pipx has no per-package cooldown override, so this snippet runs without cooldown enforcement.
$ claude mcp add tmux --scope user -- pipx run libtmux-mcp
Cooldown pipx has no per-package cooldown override, so this snippet runs without cooldown enforcement.
$ claude mcp add tmux --scope user -- pipx run libtmux-mcp
$ claude mcp add tmux --scope project -- pipx run libtmux-mcp
Cooldown pipx has no per-package cooldown override, so this snippet runs without cooldown enforcement.
$ claude mcp add tmux --scope project -- pipx run libtmux-mcp
Cooldown pipx has no per-package cooldown override, so this snippet runs without cooldown enforcement.
$ claude mcp add tmux --scope project -- pipx run libtmux-mcp
First
$ pip install --user --upgrade libtmux libtmux-mcp
$ claude mcp add tmux -- libtmux-mcp
First
$ pip install --user --upgrade libtmux libtmux-mcp
Cooldown pip has no per-package cooldown override, so this snippet runs without cooldown enforcement.
$ claude mcp add tmux -- libtmux-mcp
First
$ pip install --user --upgrade libtmux libtmux-mcp
Cooldown pip has no per-package cooldown override, so this snippet runs without cooldown enforcement.
$ claude mcp add tmux -- libtmux-mcp
First
$ pip install --user --upgrade libtmux libtmux-mcp
$ claude mcp add tmux --scope user -- libtmux-mcp
First
$ pip install --user --upgrade libtmux libtmux-mcp
Cooldown pip has no per-package cooldown override, so this snippet runs without cooldown enforcement.
$ claude mcp add tmux --scope user -- libtmux-mcp
First
$ pip install --user --upgrade libtmux libtmux-mcp
Cooldown pip has no per-package cooldown override, so this snippet runs without cooldown enforcement.
$ claude mcp add tmux --scope user -- libtmux-mcp
First
$ pip install --user --upgrade libtmux libtmux-mcp
$ claude mcp add tmux --scope project -- libtmux-mcp
First
$ pip install --user --upgrade libtmux libtmux-mcp
Cooldown pip has no per-package cooldown override, so this snippet runs without cooldown enforcement.
$ claude mcp add tmux --scope project -- libtmux-mcp
First
$ pip install --user --upgrade libtmux libtmux-mcp
Cooldown pip has no per-package cooldown override, so this snippet runs without cooldown enforcement.
$ claude mcp add tmux --scope project -- libtmux-mcp
{
    "mcpServers": {
        "tmux": {
            "command": "uvx",
            "args": ["libtmux-mcp"]
        }
    }
}
Cooldown ; libtmux-mcp itself stays current.
{
    "mcpServers": {
        "tmux": {
            "command": "uvx",
            "args": ["--exclude-newer", "P7D", "--exclude-newer-package", "libtmux-mcp=2099-01-01", "libtmux-mcp"]
        }
    }
}
Cooldown Bypasses a cooldown set in your uvx configuration, for this install only.
{
    "mcpServers": {
        "tmux": {
            "command": "uvx",
            "args": ["libtmux-mcp"],
            "env": { "UV_NO_CONFIG": "1" }
        }
    }
}
{
    "mcpServers": {
        "tmux": {
            "command": "pipx",
            "args": ["run", "libtmux-mcp"]
        }
    }
}
Cooldown pipx has no per-package cooldown override, so this snippet runs without cooldown enforcement.
{
    "mcpServers": {
        "tmux": {
            "command": "pipx",
            "args": ["run", "libtmux-mcp"]
        }
    }
}
Cooldown pipx has no per-package cooldown override, so this snippet runs without cooldown enforcement.
{
    "mcpServers": {
        "tmux": {
            "command": "pipx",
            "args": ["run", "libtmux-mcp"]
        }
    }
}
First
$ pip install --user --upgrade libtmux libtmux-mcp
{
    "mcpServers": {
        "tmux": {
            "command": "libtmux-mcp"
        }
    }
}
First
$ pip install --user --upgrade libtmux libtmux-mcp
Cooldown pip has no per-package cooldown override, so this snippet runs without cooldown enforcement.
{
    "mcpServers": {
        "tmux": {
            "command": "libtmux-mcp"
        }
    }
}
First
$ pip install --user --upgrade libtmux libtmux-mcp
Cooldown pip has no per-package cooldown override, so this snippet runs without cooldown enforcement.
{
    "mcpServers": {
        "tmux": {
            "command": "libtmux-mcp"
        }
    }
}
$ codex mcp add tmux -- uvx libtmux-mcp
Cooldown ; libtmux-mcp itself stays current.
$ codex mcp add tmux \
    -- uvx \
        --exclude-newer P7D \
        --exclude-newer-package libtmux-mcp=2099-01-01 \
        libtmux-mcp
Cooldown Bypasses a cooldown set in your uvx configuration, for this install only.
$ codex mcp add tmux -- uvx --no-config libtmux-mcp
[mcp_servers.tmux]
command = "uvx"
args = ["libtmux-mcp"]
Cooldown ; libtmux-mcp itself stays current.
[mcp_servers.tmux]
command = "uvx"
args = ["--exclude-newer", "P7D", "--exclude-newer-package", "libtmux-mcp=2099-01-01", "libtmux-mcp"]
Cooldown Bypasses a cooldown set in your uvx configuration, for this install only.
[mcp_servers.tmux]
command = "uvx"
args = ["libtmux-mcp"]
env = { UV_NO_CONFIG = "1" }
$ codex mcp add tmux -- pipx run libtmux-mcp
Cooldown pipx has no per-package cooldown override, so this snippet runs without cooldown enforcement.
$ codex mcp add tmux -- pipx run libtmux-mcp
Cooldown pipx has no per-package cooldown override, so this snippet runs without cooldown enforcement.
$ codex mcp add tmux -- pipx run libtmux-mcp
[mcp_servers.tmux]
command = "pipx"
args = ["run", "libtmux-mcp"]
Cooldown pipx has no per-package cooldown override, so this snippet runs without cooldown enforcement.
[mcp_servers.tmux]
command = "pipx"
args = ["run", "libtmux-mcp"]
Cooldown pipx has no per-package cooldown override, so this snippet runs without cooldown enforcement.
[mcp_servers.tmux]
command = "pipx"
args = ["run", "libtmux-mcp"]
First
$ pip install --user --upgrade libtmux libtmux-mcp
$ codex mcp add tmux -- libtmux-mcp
First
$ pip install --user --upgrade libtmux libtmux-mcp
Cooldown pip has no per-package cooldown override, so this snippet runs without cooldown enforcement.
$ codex mcp add tmux -- libtmux-mcp
First
$ pip install --user --upgrade libtmux libtmux-mcp
Cooldown pip has no per-package cooldown override, so this snippet runs without cooldown enforcement.
$ codex mcp add tmux -- libtmux-mcp
First
$ pip install --user --upgrade libtmux libtmux-mcp
[mcp_servers.tmux]
command = "libtmux-mcp"
First
$ pip install --user --upgrade libtmux libtmux-mcp
Cooldown pip has no per-package cooldown override, so this snippet runs without cooldown enforcement.
[mcp_servers.tmux]
command = "libtmux-mcp"
First
$ pip install --user --upgrade libtmux libtmux-mcp
Cooldown pip has no per-package cooldown override, so this snippet runs without cooldown enforcement.
[mcp_servers.tmux]
command = "libtmux-mcp"
$ gemini mcp add --scope user tmux uvx -- libtmux-mcp
Cooldown ; libtmux-mcp itself stays current.
$ gemini mcp add \
    --scope user \
    tmux uvx \
    -- --exclude-newer P7D \
        --exclude-newer-package libtmux-mcp=2099-01-01 \
        libtmux-mcp
Cooldown Bypasses a cooldown set in your uvx configuration, for this install only.
$ gemini mcp add --scope user tmux uvx -- --no-config libtmux-mcp
$ gemini mcp add --scope project tmux uvx -- libtmux-mcp
Cooldown ; libtmux-mcp itself stays current.
$ gemini mcp add \
    --scope project \
    tmux uvx \
    -- --exclude-newer P7D \
        --exclude-newer-package libtmux-mcp=2099-01-01 \
        libtmux-mcp
Cooldown Bypasses a cooldown set in your uvx configuration, for this install only.
$ gemini mcp add --scope project tmux uvx -- --no-config libtmux-mcp
$ gemini mcp add --scope user tmux pipx -- run libtmux-mcp
Cooldown pipx has no per-package cooldown override, so this snippet runs without cooldown enforcement.
$ gemini mcp add --scope user tmux pipx -- run libtmux-mcp
Cooldown pipx has no per-package cooldown override, so this snippet runs without cooldown enforcement.
$ gemini mcp add --scope user tmux pipx -- run libtmux-mcp
$ gemini mcp add --scope project tmux pipx -- run libtmux-mcp
Cooldown pipx has no per-package cooldown override, so this snippet runs without cooldown enforcement.
$ gemini mcp add --scope project tmux pipx -- run libtmux-mcp
Cooldown pipx has no per-package cooldown override, so this snippet runs without cooldown enforcement.
$ gemini mcp add --scope project tmux pipx -- run libtmux-mcp
First
$ pip install --user --upgrade libtmux libtmux-mcp
$ gemini mcp add --scope user tmux libtmux-mcp
First
$ pip install --user --upgrade libtmux libtmux-mcp
Cooldown pip has no per-package cooldown override, so this snippet runs without cooldown enforcement.
$ gemini mcp add --scope user tmux libtmux-mcp
First
$ pip install --user --upgrade libtmux libtmux-mcp
Cooldown pip has no per-package cooldown override, so this snippet runs without cooldown enforcement.
$ gemini mcp add --scope user tmux libtmux-mcp
First
$ pip install --user --upgrade libtmux libtmux-mcp
$ gemini mcp add --scope project tmux libtmux-mcp
First
$ pip install --user --upgrade libtmux libtmux-mcp
Cooldown pip has no per-package cooldown override, so this snippet runs without cooldown enforcement.
$ gemini mcp add --scope project tmux libtmux-mcp
First
$ pip install --user --upgrade libtmux libtmux-mcp
Cooldown pip has no per-package cooldown override, so this snippet runs without cooldown enforcement.
$ gemini mcp add --scope project tmux libtmux-mcp
{
    "mcpServers": {
        "tmux": {
            "command": "uvx",
            "args": ["libtmux-mcp"]
        }
    }
}
Cooldown ; libtmux-mcp itself stays current.
{
    "mcpServers": {
        "tmux": {
            "command": "uvx",
            "args": ["--exclude-newer", "P7D", "--exclude-newer-package", "libtmux-mcp=2099-01-01", "libtmux-mcp"]
        }
    }
}
Cooldown Bypasses a cooldown set in your uvx configuration, for this install only.
{
    "mcpServers": {
        "tmux": {
            "command": "uvx",
            "args": ["libtmux-mcp"],
            "env": { "UV_NO_CONFIG": "1" }
        }
    }
}
{
    "mcpServers": {
        "tmux": {
            "command": "uvx",
            "args": ["libtmux-mcp"]
        }
    }
}
Cooldown ; libtmux-mcp itself stays current.
{
    "mcpServers": {
        "tmux": {
            "command": "uvx",
            "args": ["--exclude-newer", "P7D", "--exclude-newer-package", "libtmux-mcp=2099-01-01", "libtmux-mcp"]
        }
    }
}
Cooldown Bypasses a cooldown set in your uvx configuration, for this install only.
{
    "mcpServers": {
        "tmux": {
            "command": "uvx",
            "args": ["libtmux-mcp"],
            "env": { "UV_NO_CONFIG": "1" }
        }
    }
}
{
    "mcpServers": {
        "tmux": {
            "command": "pipx",
            "args": ["run", "libtmux-mcp"]
        }
    }
}
Cooldown pipx has no per-package cooldown override, so this snippet runs without cooldown enforcement.
{
    "mcpServers": {
        "tmux": {
            "command": "pipx",
            "args": ["run", "libtmux-mcp"]
        }
    }
}
Cooldown pipx has no per-package cooldown override, so this snippet runs without cooldown enforcement.
{
    "mcpServers": {
        "tmux": {
            "command": "pipx",
            "args": ["run", "libtmux-mcp"]
        }
    }
}
{
    "mcpServers": {
        "tmux": {
            "command": "pipx",
            "args": ["run", "libtmux-mcp"]
        }
    }
}
Cooldown pipx has no per-package cooldown override, so this snippet runs without cooldown enforcement.
{
    "mcpServers": {
        "tmux": {
            "command": "pipx",
            "args": ["run", "libtmux-mcp"]
        }
    }
}
Cooldown pipx has no per-package cooldown override, so this snippet runs without cooldown enforcement.
{
    "mcpServers": {
        "tmux": {
            "command": "pipx",
            "args": ["run", "libtmux-mcp"]
        }
    }
}
First
$ pip install --user --upgrade libtmux libtmux-mcp
{
    "mcpServers": {
        "tmux": {
            "command": "libtmux-mcp"
        }
    }
}
First
$ pip install --user --upgrade libtmux libtmux-mcp
Cooldown pip has no per-package cooldown override, so this snippet runs without cooldown enforcement.
{
    "mcpServers": {
        "tmux": {
            "command": "libtmux-mcp"
        }
    }
}
First
$ pip install --user --upgrade libtmux libtmux-mcp
Cooldown pip has no per-package cooldown override, so this snippet runs without cooldown enforcement.
{
    "mcpServers": {
        "tmux": {
            "command": "libtmux-mcp"
        }
    }
}
First
$ pip install --user --upgrade libtmux libtmux-mcp
{
    "mcpServers": {
        "tmux": {
            "command": "libtmux-mcp"
        }
    }
}
First
$ pip install --user --upgrade libtmux libtmux-mcp
Cooldown pip has no per-package cooldown override, so this snippet runs without cooldown enforcement.
{
    "mcpServers": {
        "tmux": {
            "command": "libtmux-mcp"
        }
    }
}
First
$ pip install --user --upgrade libtmux libtmux-mcp
Cooldown pip has no per-package cooldown override, so this snippet runs without cooldown enforcement.
{
    "mcpServers": {
        "tmux": {
            "command": "libtmux-mcp"
        }
    }
}
$ grok mcp add --scope user tmux -- uvx libtmux-mcp
Cooldown ; libtmux-mcp itself stays current.
$ grok mcp add \
    --scope user \
    tmux \
    -- uvx \
        --exclude-newer P7D \
        --exclude-newer-package libtmux-mcp=2099-01-01 \
        libtmux-mcp
Cooldown Bypasses a cooldown set in your uvx configuration, for this install only.
$ grok mcp add --scope user tmux -- uvx --no-config libtmux-mcp
$ grok mcp add --scope project tmux -- uvx libtmux-mcp
Cooldown ; libtmux-mcp itself stays current.
$ grok mcp add \
    --scope project \
    tmux \
    -- uvx \
        --exclude-newer P7D \
        --exclude-newer-package libtmux-mcp=2099-01-01 \
        libtmux-mcp
Cooldown Bypasses a cooldown set in your uvx configuration, for this install only.
$ grok mcp add --scope project tmux -- uvx --no-config libtmux-mcp
$ grok mcp add --scope user tmux -- pipx run libtmux-mcp
Cooldown pipx has no per-package cooldown override, so this snippet runs without cooldown enforcement.
$ grok mcp add --scope user tmux -- pipx run libtmux-mcp
Cooldown pipx has no per-package cooldown override, so this snippet runs without cooldown enforcement.
$ grok mcp add --scope user tmux -- pipx run libtmux-mcp
$ grok mcp add --scope project tmux -- pipx run libtmux-mcp
Cooldown pipx has no per-package cooldown override, so this snippet runs without cooldown enforcement.
$ grok mcp add --scope project tmux -- pipx run libtmux-mcp
Cooldown pipx has no per-package cooldown override, so this snippet runs without cooldown enforcement.
$ grok mcp add --scope project tmux -- pipx run libtmux-mcp
First
$ pip install --user --upgrade libtmux libtmux-mcp
$ grok mcp add --scope user tmux -- libtmux-mcp
First
$ pip install --user --upgrade libtmux libtmux-mcp
Cooldown pip has no per-package cooldown override, so this snippet runs without cooldown enforcement.
$ grok mcp add --scope user tmux -- libtmux-mcp
First
$ pip install --user --upgrade libtmux libtmux-mcp
Cooldown pip has no per-package cooldown override, so this snippet runs without cooldown enforcement.
$ grok mcp add --scope user tmux -- libtmux-mcp
First
$ pip install --user --upgrade libtmux libtmux-mcp
$ grok mcp add --scope project tmux -- libtmux-mcp
First
$ pip install --user --upgrade libtmux libtmux-mcp
Cooldown pip has no per-package cooldown override, so this snippet runs without cooldown enforcement.
$ grok mcp add --scope project tmux -- libtmux-mcp
First
$ pip install --user --upgrade libtmux libtmux-mcp
Cooldown pip has no per-package cooldown override, so this snippet runs without cooldown enforcement.
$ grok mcp add --scope project tmux -- libtmux-mcp
{
    "mcpServers": {
        "tmux": {
            "command": "uvx",
            "args": ["libtmux-mcp"]
        }
    }
}
Cooldown ; libtmux-mcp itself stays current.
{
    "mcpServers": {
        "tmux": {
            "command": "uvx",
            "args": ["--exclude-newer", "P7D", "--exclude-newer-package", "libtmux-mcp=2099-01-01", "libtmux-mcp"]
        }
    }
}
Cooldown Bypasses a cooldown set in your uvx configuration, for this install only.
{
    "mcpServers": {
        "tmux": {
            "command": "uvx",
            "args": ["libtmux-mcp"],
            "env": { "UV_NO_CONFIG": "1" }
        }
    }
}
{
    "mcpServers": {
        "tmux": {
            "command": "pipx",
            "args": ["run", "libtmux-mcp"]
        }
    }
}
Cooldown pipx has no per-package cooldown override, so this snippet runs without cooldown enforcement.
{
    "mcpServers": {
        "tmux": {
            "command": "pipx",
            "args": ["run", "libtmux-mcp"]
        }
    }
}
Cooldown pipx has no per-package cooldown override, so this snippet runs without cooldown enforcement.
{
    "mcpServers": {
        "tmux": {
            "command": "pipx",
            "args": ["run", "libtmux-mcp"]
        }
    }
}
First
$ pip install --user --upgrade libtmux libtmux-mcp
{
    "mcpServers": {
        "tmux": {
            "command": "libtmux-mcp"
        }
    }
}
First
$ pip install --user --upgrade libtmux libtmux-mcp
Cooldown pip has no per-package cooldown override, so this snippet runs without cooldown enforcement.
{
    "mcpServers": {
        "tmux": {
            "command": "libtmux-mcp"
        }
    }
}
First
$ pip install --user --upgrade libtmux libtmux-mcp
Cooldown pip has no per-package cooldown override, so this snippet runs without cooldown enforcement.
{
    "mcpServers": {
        "tmux": {
            "command": "libtmux-mcp"
        }
    }
}
$ opencode mcp add tmux -- uvx libtmux-mcp
Cooldown ; libtmux-mcp itself stays current.
$ opencode mcp add tmux \
    -- uvx \
        --exclude-newer P7D \
        --exclude-newer-package libtmux-mcp=2099-01-01 \
        libtmux-mcp
Cooldown Bypasses a cooldown set in your uvx configuration, for this install only.
$ opencode mcp add tmux -- uvx --no-config libtmux-mcp
$ opencode mcp add tmux -- pipx run libtmux-mcp
Cooldown pipx has no per-package cooldown override, so this snippet runs without cooldown enforcement.
$ opencode mcp add tmux -- pipx run libtmux-mcp
Cooldown pipx has no per-package cooldown override, so this snippet runs without cooldown enforcement.
$ opencode mcp add tmux -- pipx run libtmux-mcp
First
$ pip install --user --upgrade libtmux libtmux-mcp
$ opencode mcp add tmux -- libtmux-mcp
First
$ pip install --user --upgrade libtmux libtmux-mcp
Cooldown pip has no per-package cooldown override, so this snippet runs without cooldown enforcement.
$ opencode mcp add tmux -- libtmux-mcp
First
$ pip install --user --upgrade libtmux libtmux-mcp
Cooldown pip has no per-package cooldown override, so this snippet runs without cooldown enforcement.
$ opencode mcp add tmux -- libtmux-mcp

Writes ~/.claude.json (this project).

With uvx installed.

Writes ~/.claude.json (this project).

With uvx installed.

Writes ~/.claude.json (this project).

With uvx installed.

Writes ~/.claude.json (all projects).

With uvx installed.

Writes ~/.claude.json (all projects).

With uvx installed.

Writes ~/.claude.json (all projects).

With uvx installed.

Writes .mcp.json (in repo, version-controlled).

With uvx installed.

Writes .mcp.json (in repo, version-controlled).

With uvx installed.

Writes .mcp.json (in repo, version-controlled).

With uvx installed.

Writes ~/.claude.json (this project).

With pipx installed.

Writes ~/.claude.json (this project).

With pipx installed.

Writes ~/.claude.json (this project).

With pipx installed.

Writes ~/.claude.json (all projects).

With pipx installed.

Writes ~/.claude.json (all projects).

With pipx installed.

Writes ~/.claude.json (all projects).

With pipx installed.

Writes .mcp.json (in repo, version-controlled).

With pipx installed.

Writes .mcp.json (in repo, version-controlled).

With pipx installed.

Writes .mcp.json (in repo, version-controlled).

With pipx installed.

Writes ~/.claude.json (this project).

Writes ~/.claude.json (this project).

Writes ~/.claude.json (this project).

Writes ~/.claude.json (all projects).

Writes ~/.claude.json (all projects).

Writes ~/.claude.json (all projects).

Writes .mcp.json (in repo, version-controlled).

Writes .mcp.json (in repo, version-controlled).

Writes .mcp.json (in repo, version-controlled).

With uvx installed.

With uvx installed.

With uvx installed.

With pipx installed.

With pipx installed.

With pipx installed.

Writes ~/.codex/config.toml.

With uvx installed.

Writes ~/.codex/config.toml.

With uvx installed.

Writes ~/.codex/config.toml.

With uvx installed.

Codex's CLI doesn't support project scope yet — paste this into .codex/config.toml at the repo root.

With uvx installed.

Codex's CLI doesn't support project scope yet — paste this into .codex/config.toml at the repo root.

With uvx installed.

Codex's CLI doesn't support project scope yet — paste this into .codex/config.toml at the repo root.

With uvx installed.

Writes ~/.codex/config.toml.

With pipx installed.

Writes ~/.codex/config.toml.

With pipx installed.

Writes ~/.codex/config.toml.

With pipx installed.

Codex's CLI doesn't support project scope yet — paste this into .codex/config.toml at the repo root.

With pipx installed.

Codex's CLI doesn't support project scope yet — paste this into .codex/config.toml at the repo root.

With pipx installed.

Codex's CLI doesn't support project scope yet — paste this into .codex/config.toml at the repo root.

With pipx installed.

Writes ~/.codex/config.toml.

Writes ~/.codex/config.toml.

Writes ~/.codex/config.toml.

Codex's CLI doesn't support project scope yet — paste this into .codex/config.toml at the repo root.

Codex's CLI doesn't support project scope yet — paste this into .codex/config.toml at the repo root.

Codex's CLI doesn't support project scope yet — paste this into .codex/config.toml at the repo root.

Writes ~/.gemini/settings.json.

With uvx installed.

Writes ~/.gemini/settings.json.

With uvx installed.

Writes ~/.gemini/settings.json.

With uvx installed.

Writes .gemini/settings.json (in repo).

With uvx installed.

Writes .gemini/settings.json (in repo).

With uvx installed.

Writes .gemini/settings.json (in repo).

With uvx installed.

Writes ~/.gemini/settings.json.

With pipx installed.

Writes ~/.gemini/settings.json.

With pipx installed.

Writes ~/.gemini/settings.json.

With pipx installed.

Writes .gemini/settings.json (in repo).

With pipx installed.

Writes .gemini/settings.json (in repo).

With pipx installed.

Writes .gemini/settings.json (in repo).

With pipx installed.

Writes ~/.gemini/settings.json.

Writes ~/.gemini/settings.json.

Writes ~/.gemini/settings.json.

Writes .gemini/settings.json (in repo).

Writes .gemini/settings.json (in repo).

Writes .gemini/settings.json (in repo).

With uvx installed.

With uvx installed.

With uvx installed.

With uvx installed.

With uvx installed.

With uvx installed.

With pipx installed.

With pipx installed.

With pipx installed.

With pipx installed.

With pipx installed.

With pipx installed.

Writes ~/.grok/config.toml.

With uvx installed.

Writes ~/.grok/config.toml.

With uvx installed.

Writes ~/.grok/config.toml.

With uvx installed.

Writes ./.grok/config.toml (in repo).

With uvx installed.

Writes ./.grok/config.toml (in repo).

With uvx installed.

Writes ./.grok/config.toml (in repo).

With uvx installed.

Writes ~/.grok/config.toml.

With pipx installed.

Writes ~/.grok/config.toml.

With pipx installed.

Writes ~/.grok/config.toml.

With pipx installed.

Writes ./.grok/config.toml (in repo).

With pipx installed.

Writes ./.grok/config.toml (in repo).

With pipx installed.

Writes ./.grok/config.toml (in repo).

With pipx installed.

Writes ~/.grok/config.toml.

Writes ~/.grok/config.toml.

Writes ~/.grok/config.toml.

Writes ./.grok/config.toml (in repo).

Writes ./.grok/config.toml (in repo).

Writes ./.grok/config.toml (in repo).

With uvx installed.

With uvx installed.

With uvx installed.

With pipx installed.

With pipx installed.

With pipx installed.

Writes ~/.config/opencode/opencode.jsonc.

With uvx installed.

Writes ~/.config/opencode/opencode.jsonc.

With uvx installed.

Writes ~/.config/opencode/opencode.jsonc.

With uvx installed.

Writes ~/.config/opencode/opencode.jsonc.

With pipx installed.

Writes ~/.config/opencode/opencode.jsonc.

With pipx installed.

Writes ~/.config/opencode/opencode.jsonc.

With pipx installed.

Writes ~/.config/opencode/opencode.jsonc.

Writes ~/.config/opencode/opencode.jsonc.

Writes ~/.config/opencode/opencode.jsonc.

libtmux-mcp lets an MCP client inspect tmux, create sessions and panes, run commands, and wait for their results. The distribution and executable are libtmux-mcp; Python imports use libtmux_mcp.

The server runs over standard input and output. It requires Python 3.10 or newer and tmux 3.2a or newer; see tmux support. Its default toolsets are inspect, manage, and execute; deletion tools require an explicit selection.

Start here

  • Install points an MCP client at this server.
  • Tools lists the MCP operations, arguments, and results.
  • Guides connect a client and select a tmux socket.
  • Topics explain toolsets, trust, waiting, and caller context.
  • Examples call a tool, then explore server internals.
  • Language API documents embedding and implementation types.

For declarative session configuration, use the Workspace Manager, provided by the separate tmuxp project. The MCP server does not provide a tmuxp file loader.

The upstream Python documentation covers client integrations and the complete tool reference. These pages follow the Python implementation.

Tools by tier

The Python 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_batch Inspect Call several inspect tools serially and return per-tool results.
  • capture_pane Inspect Capture the visible contents of a tmux pane (terminal scrollback).
  • capture_since Inspect Capture new tmux terminal scrollback since the previous cursor.
  • display_message Inspect Read tmux variables against a target and return the substituted text.
  • find_pane_by_position Inspect Find the pane occupying a corner of a tmux window.
  • get_pane_info Inspect Get detailed information about a tmux pane.
  • get_server_info Inspect Get information about the tmux server.
  • get_session_info Inspect Return metadata for a single tmux session (ID, name, window count, activity).
  • get_window_info Inspect Return metadata for a single tmux window (ID, name, layout, dimensions).
  • list_panes Inspect List tmux panes (terminal multiplexer splits) in a window, session, or server.
  • list_servers Inspect Discover live tmux servers under the current user's $TMUX_TMPDIR.
  • list_sessions Inspect List tmux sessions (terminal workspaces) on a tmux server.
  • list_windows Inspect List tmux windows (terminal tabs) in a session, or across the server.
  • search_panes Inspect Search visible terminal text across all tmux panes.
  • show_buffer Inspect Read back the contents of an MCP-owned buffer.
  • show_environment Inspect Show tmux environment variables.
  • show_hook Inspect Look up a specific tmux hook by name.
  • show_hooks Inspect List configured tmux hooks at the given scope.
  • show_option Inspect Show a tmux option value.
  • snapshot_pane Inspect Snapshot a tmux pane: visible terminal output, cursor, mode, scroll.
  • wait_for_text Inspect Wait for NEW output in a tmux pane, then return.

Manage

Change tmux structure or presentation.

Execute

Start or drive pane processes, or store state that can control later execution.

  • create_session Execute Create a new tmux session.
  • create_window Execute Create a new window in a tmux session.
  • paste_buffer Execute Paste an MCP-owned buffer into a pane.
  • paste_text Execute Paste multi-line text into a pane using tmux paste buffers.
  • pipe_pane Execute Log a pane's live output to a file (or stop an active log).
  • respawn_pane Execute Restart a pane's process in place, preserving pane_id and layout.
  • run_command Execute Run a shell command in a pane, wait for completion, and capture output.
  • send_keys Execute Send keys (commands or text) to a tmux pane.
  • send_keys_batch Execute Send an ordered batch of raw key/text operations to tmux panes.
  • set_environment Execute Set a tmux environment variable.
  • set_option Execute Set a tmux option value.
  • split_window Execute Split a tmux window to create a new pane.

Teardown

Delete tmux objects or retained scrollback. Not reversible.

Browse every tool, with its arguments, result and protocol data.

Esc
Search in

Type to search.

Reference previewOpen reference