MCPconceptHome

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

Concept example A working example of the core library. It can change without notice. What concept means

Edit this page on GitHub

tmux MCP, built in TypeScript

tmux terminal control for AI agents, built on libtmux for TypeScript and MCP TypeScript SDK. 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
..                               [100%]
2 passed in 0.01s
%1 sh
[checks] 0:sh*

tmux after run_shell_command.

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

tmux after run_shell_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 {"name":"checks"}
Result
{
"paneId": "%0",
"session": {
"attachedClients": 0,
"humanAttachedClients": 0,
"id": "$0",
"metadataComplete": true,
"name": "checks",
"omittedMetadataBytes": 0,
"windows": 1
},
"windowId": "@0"
}

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

split_window Execute {"paneId":"%0","direction":"right"}
Result
{
"pane": {
"active": false,
"command": "sh",
"cwd": "/home/user/project",
"dead": false,
"height": 24,
"id": "%1",
"index": 1,
"isAttended": false,
"isCallerPane": false,
"metadataComplete": true,
"omittedMetadataBytes": 0,
"title": "host",
"…": "6 more"
}
}

AgentRead the window's layout.

list_windows Inspect {"session":"checks"}
Result
{
"complete": true,
"omittedEntries": 0,
"windows": [
{
"id": "@0",
"layout": "8205,80x24,0,0{40x24,0,0,0,39x24,41,0,1}",
"metadataComplete": true,
"name": "sh",
"omittedMetadataBytes": 0,
"panes": 2,
"zoomed": false,
"omittedPlacements": 0,
"placements": [
{
"active": true,
"index": 0,
"sessionId": "$0",
"sessionName": "checks"
}
],
"placementsComplete": true
}
]
}

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

run_shell_command Execute {"paneId":"%0","command":"pytest -q"}
Result
{
"effectiveTimeoutMs": 30000,
"exitStatus": 0,
"foreignOutputSuspected": false,
"droppedLines": 0,
"missedBytes": 0,
"omittedBytes": 0,
"outcome": "completed",
"output": ".. [100%]\n2 passed in 0.01s",
"outputComplete": true,
"paneId": "%0",
"returnedBytes": 57,
"stillRunning": false
}

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

run_shell_command Execute {"paneId":"%1","command":"cat checks.log"}
Result
{
"effectiveTimeoutMs": 30000,
"exitStatus": 0,
"foreignOutputSuspected": false,
"droppedLines": 0,
"missedBytes": 0,
"omittedBytes": 0,
"outcome": "completed",
"output": "2026-01-01 checks started\n2026-01-01 checks finished",
"outputComplete": true,
"paneId": "%1",
"returnedBytes": 52,
"stillRunning": false
}

AgentRemove the session once the result is read.

kill_session Teardown {"session":"checks"}
Result
{
"killed": "$0"
}
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
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
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
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
Terminal
Terminal
Terminal
Terminal
Terminal
Terminal
@libtmux/mcp concept npm
$ claude mcp add tmux -- npx -y @libtmux/mcp
Cooldown npx ignores --min-release-age-exclude, so a cooldown here would also hold back the release it runs; this runs without one.
$ claude mcp add tmux -- npx -y @libtmux/mcp
Cooldown Bypasses a cooldown set in your npx configuration, for this install only.
$ claude mcp add tmux -- npx -y --min-release-age=0 @libtmux/mcp
$ claude mcp add tmux --scope user -- npx -y @libtmux/mcp
Cooldown npx ignores --min-release-age-exclude, so a cooldown here would also hold back the release it runs; this runs without one.
$ claude mcp add tmux --scope user -- npx -y @libtmux/mcp
Cooldown Bypasses a cooldown set in your npx configuration, for this install only.
$ claude mcp add tmux --scope user -- npx -y --min-release-age=0 @libtmux/mcp
$ claude mcp add tmux --scope project -- npx -y @libtmux/mcp
Cooldown npx ignores --min-release-age-exclude, so a cooldown here would also hold back the release it runs; this runs without one.
$ claude mcp add tmux --scope project -- npx -y @libtmux/mcp
Cooldown Bypasses a cooldown set in your npx configuration, for this install only.
$ claude mcp add tmux --scope project -- npx -y --min-release-age=0 @libtmux/mcp
First
$ npm install --global @libtmux/mcp
$ claude mcp add tmux -- libtmux-mcp
First
$ npm install --global \
    --min-release-age=7 \
    --min-release-age-exclude=@libtmux/mcp \
    --min-release-age-exclude=libtmux \
    @libtmux/mcp
Cooldown ; @libtmux/mcp and libtmux stay current.
$ claude mcp add tmux -- libtmux-mcp
First
$ npm install --global --min-release-age=0 @libtmux/mcp
Cooldown Bypasses a cooldown set in your Global install configuration, for this install only.
$ claude mcp add tmux -- libtmux-mcp
First
$ npm install --global @libtmux/mcp
$ claude mcp add tmux --scope user -- libtmux-mcp
First
$ npm install --global \
    --min-release-age=7 \
    --min-release-age-exclude=@libtmux/mcp \
    --min-release-age-exclude=libtmux \
    @libtmux/mcp
Cooldown ; @libtmux/mcp and libtmux stay current.
$ claude mcp add tmux --scope user -- libtmux-mcp
First
$ npm install --global --min-release-age=0 @libtmux/mcp
Cooldown Bypasses a cooldown set in your Global install configuration, for this install only.
$ claude mcp add tmux --scope user -- libtmux-mcp
First
$ npm install --global @libtmux/mcp
$ claude mcp add tmux --scope project -- libtmux-mcp
First
$ npm install --global \
    --min-release-age=7 \
    --min-release-age-exclude=@libtmux/mcp \
    --min-release-age-exclude=libtmux \
    @libtmux/mcp
Cooldown ; @libtmux/mcp and libtmux stay current.
$ claude mcp add tmux --scope project -- libtmux-mcp
First
$ npm install --global --min-release-age=0 @libtmux/mcp
Cooldown Bypasses a cooldown set in your Global install configuration, for this install only.
$ claude mcp add tmux --scope project -- libtmux-mcp
{
    "mcpServers": {
        "tmux": {
            "command": "npx",
            "args": ["-y", "@libtmux/mcp"]
        }
    }
}
Cooldown npx ignores --min-release-age-exclude, so a cooldown here would also hold back the release it runs; this runs without one.
{
    "mcpServers": {
        "tmux": {
            "command": "npx",
            "args": ["-y", "@libtmux/mcp"]
        }
    }
}
Cooldown Bypasses a cooldown set in your npx configuration, for this install only.
{
    "mcpServers": {
        "tmux": {
            "command": "npx",
            "args": ["-y", "--min-release-age=0", "@libtmux/mcp"]
        }
    }
}
First
$ npm install --global @libtmux/mcp
{
    "mcpServers": {
        "tmux": {
            "command": "libtmux-mcp"
        }
    }
}
First
$ npm install --global \
    --min-release-age=7 \
    --min-release-age-exclude=@libtmux/mcp \
    --min-release-age-exclude=libtmux \
    @libtmux/mcp
Cooldown ; @libtmux/mcp and libtmux stay current.
{
    "mcpServers": {
        "tmux": {
            "command": "libtmux-mcp"
        }
    }
}
First
$ npm install --global --min-release-age=0 @libtmux/mcp
Cooldown Bypasses a cooldown set in your Global install configuration, for this install only.
{
    "mcpServers": {
        "tmux": {
            "command": "libtmux-mcp"
        }
    }
}
$ codex mcp add tmux -- npx -y @libtmux/mcp
Cooldown npx ignores --min-release-age-exclude, so a cooldown here would also hold back the release it runs; this runs without one.
$ codex mcp add tmux -- npx -y @libtmux/mcp
Cooldown Bypasses a cooldown set in your npx configuration, for this install only.
$ codex mcp add tmux -- npx -y --min-release-age=0 @libtmux/mcp
[mcp_servers.tmux]
command = "npx"
args = ["-y", "@libtmux/mcp"]
Cooldown npx ignores --min-release-age-exclude, so a cooldown here would also hold back the release it runs; this runs without one.
[mcp_servers.tmux]
command = "npx"
args = ["-y", "@libtmux/mcp"]
Cooldown Bypasses a cooldown set in your npx configuration, for this install only.
[mcp_servers.tmux]
command = "npx"
args = ["-y", "--min-release-age=0", "@libtmux/mcp"]
First
$ npm install --global @libtmux/mcp
$ codex mcp add tmux -- libtmux-mcp
First
$ npm install --global \
    --min-release-age=7 \
    --min-release-age-exclude=@libtmux/mcp \
    --min-release-age-exclude=libtmux \
    @libtmux/mcp
Cooldown ; @libtmux/mcp and libtmux stay current.
$ codex mcp add tmux -- libtmux-mcp
First
$ npm install --global --min-release-age=0 @libtmux/mcp
Cooldown Bypasses a cooldown set in your Global install configuration, for this install only.
$ codex mcp add tmux -- libtmux-mcp
First
$ npm install --global @libtmux/mcp
[mcp_servers.tmux]
command = "libtmux-mcp"
First
$ npm install --global \
    --min-release-age=7 \
    --min-release-age-exclude=@libtmux/mcp \
    --min-release-age-exclude=libtmux \
    @libtmux/mcp
Cooldown ; @libtmux/mcp and libtmux stay current.
[mcp_servers.tmux]
command = "libtmux-mcp"
First
$ npm install --global --min-release-age=0 @libtmux/mcp
Cooldown Bypasses a cooldown set in your Global install configuration, for this install only.
[mcp_servers.tmux]
command = "libtmux-mcp"
$ gemini mcp add --scope user tmux npx -- -y @libtmux/mcp
Cooldown npx ignores --min-release-age-exclude, so a cooldown here would also hold back the release it runs; this runs without one.
$ gemini mcp add --scope user tmux npx -- -y @libtmux/mcp
Cooldown Bypasses a cooldown set in your npx configuration, for this install only.
$ gemini mcp add --scope user tmux npx -- -y --min-release-age=0 @libtmux/mcp
$ gemini mcp add --scope project tmux npx -- -y @libtmux/mcp
Cooldown npx ignores --min-release-age-exclude, so a cooldown here would also hold back the release it runs; this runs without one.
$ gemini mcp add --scope project tmux npx -- -y @libtmux/mcp
Cooldown Bypasses a cooldown set in your npx configuration, for this install only.
$ gemini mcp add --scope project tmux npx -- -y --min-release-age=0 @libtmux/mcp
First
$ npm install --global @libtmux/mcp
$ gemini mcp add --scope user tmux libtmux-mcp
First
$ npm install --global \
    --min-release-age=7 \
    --min-release-age-exclude=@libtmux/mcp \
    --min-release-age-exclude=libtmux \
    @libtmux/mcp
Cooldown ; @libtmux/mcp and libtmux stay current.
$ gemini mcp add --scope user tmux libtmux-mcp
First
$ npm install --global --min-release-age=0 @libtmux/mcp
Cooldown Bypasses a cooldown set in your Global install configuration, for this install only.
$ gemini mcp add --scope user tmux libtmux-mcp
First
$ npm install --global @libtmux/mcp
$ gemini mcp add --scope project tmux libtmux-mcp
First
$ npm install --global \
    --min-release-age=7 \
    --min-release-age-exclude=@libtmux/mcp \
    --min-release-age-exclude=libtmux \
    @libtmux/mcp
Cooldown ; @libtmux/mcp and libtmux stay current.
$ gemini mcp add --scope project tmux libtmux-mcp
First
$ npm install --global --min-release-age=0 @libtmux/mcp
Cooldown Bypasses a cooldown set in your Global install configuration, for this install only.
$ gemini mcp add --scope project tmux libtmux-mcp
{
    "mcpServers": {
        "tmux": {
            "command": "npx",
            "args": ["-y", "@libtmux/mcp"]
        }
    }
}
Cooldown npx ignores --min-release-age-exclude, so a cooldown here would also hold back the release it runs; this runs without one.
{
    "mcpServers": {
        "tmux": {
            "command": "npx",
            "args": ["-y", "@libtmux/mcp"]
        }
    }
}
Cooldown Bypasses a cooldown set in your npx configuration, for this install only.
{
    "mcpServers": {
        "tmux": {
            "command": "npx",
            "args": ["-y", "--min-release-age=0", "@libtmux/mcp"]
        }
    }
}
{
    "mcpServers": {
        "tmux": {
            "command": "npx",
            "args": ["-y", "@libtmux/mcp"]
        }
    }
}
Cooldown npx ignores --min-release-age-exclude, so a cooldown here would also hold back the release it runs; this runs without one.
{
    "mcpServers": {
        "tmux": {
            "command": "npx",
            "args": ["-y", "@libtmux/mcp"]
        }
    }
}
Cooldown Bypasses a cooldown set in your npx configuration, for this install only.
{
    "mcpServers": {
        "tmux": {
            "command": "npx",
            "args": ["-y", "--min-release-age=0", "@libtmux/mcp"]
        }
    }
}
First
$ npm install --global @libtmux/mcp
{
    "mcpServers": {
        "tmux": {
            "command": "libtmux-mcp"
        }
    }
}
First
$ npm install --global \
    --min-release-age=7 \
    --min-release-age-exclude=@libtmux/mcp \
    --min-release-age-exclude=libtmux \
    @libtmux/mcp
Cooldown ; @libtmux/mcp and libtmux stay current.
{
    "mcpServers": {
        "tmux": {
            "command": "libtmux-mcp"
        }
    }
}
First
$ npm install --global --min-release-age=0 @libtmux/mcp
Cooldown Bypasses a cooldown set in your Global install configuration, for this install only.
{
    "mcpServers": {
        "tmux": {
            "command": "libtmux-mcp"
        }
    }
}
First
$ npm install --global @libtmux/mcp
{
    "mcpServers": {
        "tmux": {
            "command": "libtmux-mcp"
        }
    }
}
First
$ npm install --global \
    --min-release-age=7 \
    --min-release-age-exclude=@libtmux/mcp \
    --min-release-age-exclude=libtmux \
    @libtmux/mcp
Cooldown ; @libtmux/mcp and libtmux stay current.
{
    "mcpServers": {
        "tmux": {
            "command": "libtmux-mcp"
        }
    }
}
First
$ npm install --global --min-release-age=0 @libtmux/mcp
Cooldown Bypasses a cooldown set in your Global install configuration, for this install only.
{
    "mcpServers": {
        "tmux": {
            "command": "libtmux-mcp"
        }
    }
}
$ grok mcp add --scope user tmux -- npx -y @libtmux/mcp
Cooldown npx ignores --min-release-age-exclude, so a cooldown here would also hold back the release it runs; this runs without one.
$ grok mcp add --scope user tmux -- npx -y @libtmux/mcp
Cooldown Bypasses a cooldown set in your npx configuration, for this install only.
$ grok mcp add --scope user tmux -- npx -y --min-release-age=0 @libtmux/mcp
$ grok mcp add --scope project tmux -- npx -y @libtmux/mcp
Cooldown npx ignores --min-release-age-exclude, so a cooldown here would also hold back the release it runs; this runs without one.
$ grok mcp add --scope project tmux -- npx -y @libtmux/mcp
Cooldown Bypasses a cooldown set in your npx configuration, for this install only.
$ grok mcp add --scope project tmux -- npx -y --min-release-age=0 @libtmux/mcp
First
$ npm install --global @libtmux/mcp
$ grok mcp add --scope user tmux -- libtmux-mcp
First
$ npm install --global \
    --min-release-age=7 \
    --min-release-age-exclude=@libtmux/mcp \
    --min-release-age-exclude=libtmux \
    @libtmux/mcp
Cooldown ; @libtmux/mcp and libtmux stay current.
$ grok mcp add --scope user tmux -- libtmux-mcp
First
$ npm install --global --min-release-age=0 @libtmux/mcp
Cooldown Bypasses a cooldown set in your Global install configuration, for this install only.
$ grok mcp add --scope user tmux -- libtmux-mcp
First
$ npm install --global @libtmux/mcp
$ grok mcp add --scope project tmux -- libtmux-mcp
First
$ npm install --global \
    --min-release-age=7 \
    --min-release-age-exclude=@libtmux/mcp \
    --min-release-age-exclude=libtmux \
    @libtmux/mcp
Cooldown ; @libtmux/mcp and libtmux stay current.
$ grok mcp add --scope project tmux -- libtmux-mcp
First
$ npm install --global --min-release-age=0 @libtmux/mcp
Cooldown Bypasses a cooldown set in your Global install configuration, for this install only.
$ grok mcp add --scope project tmux -- libtmux-mcp
{
    "mcpServers": {
        "tmux": {
            "command": "npx",
            "args": ["-y", "@libtmux/mcp"]
        }
    }
}
Cooldown npx ignores --min-release-age-exclude, so a cooldown here would also hold back the release it runs; this runs without one.
{
    "mcpServers": {
        "tmux": {
            "command": "npx",
            "args": ["-y", "@libtmux/mcp"]
        }
    }
}
Cooldown Bypasses a cooldown set in your npx configuration, for this install only.
{
    "mcpServers": {
        "tmux": {
            "command": "npx",
            "args": ["-y", "--min-release-age=0", "@libtmux/mcp"]
        }
    }
}
First
$ npm install --global @libtmux/mcp
{
    "mcpServers": {
        "tmux": {
            "command": "libtmux-mcp"
        }
    }
}
First
$ npm install --global \
    --min-release-age=7 \
    --min-release-age-exclude=@libtmux/mcp \
    --min-release-age-exclude=libtmux \
    @libtmux/mcp
Cooldown ; @libtmux/mcp and libtmux stay current.
{
    "mcpServers": {
        "tmux": {
            "command": "libtmux-mcp"
        }
    }
}
First
$ npm install --global --min-release-age=0 @libtmux/mcp
Cooldown Bypasses a cooldown set in your Global install configuration, for this install only.
{
    "mcpServers": {
        "tmux": {
            "command": "libtmux-mcp"
        }
    }
}
$ opencode mcp add tmux -- npx -y @libtmux/mcp
Cooldown npx ignores --min-release-age-exclude, so a cooldown here would also hold back the release it runs; this runs without one.
$ opencode mcp add tmux -- npx -y @libtmux/mcp
Cooldown Bypasses a cooldown set in your npx configuration, for this install only.
$ opencode mcp add tmux -- npx -y --min-release-age=0 @libtmux/mcp
First
$ npm install --global @libtmux/mcp
$ opencode mcp add tmux -- libtmux-mcp
First
$ npm install --global \
    --min-release-age=7 \
    --min-release-age-exclude=@libtmux/mcp \
    --min-release-age-exclude=libtmux \
    @libtmux/mcp
Cooldown ; @libtmux/mcp and libtmux stay current.
$ opencode mcp add tmux -- libtmux-mcp
First
$ npm install --global --min-release-age=0 @libtmux/mcp
Cooldown Bypasses a cooldown set in your Global install configuration, for this install only.
$ opencode mcp add tmux -- libtmux-mcp

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).

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

The package installs a libtmux-mcp binary. Requires Node 22 or newer, or Bun 1.3.14 or newer.

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

The package installs a libtmux-mcp binary. Requires Node 22 or newer, or Bun 1.3.14 or newer.

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

The package installs a libtmux-mcp binary. Requires Node 22 or newer, or Bun 1.3.14 or newer.

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

The package installs a libtmux-mcp binary. Requires Node 22 or newer, or Bun 1.3.14 or newer.

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

The package installs a libtmux-mcp binary. Requires Node 22 or newer, or Bun 1.3.14 or newer.

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

The package installs a libtmux-mcp binary. Requires Node 22 or newer, or Bun 1.3.14 or newer.

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

The package installs a libtmux-mcp binary. Requires Node 22 or newer, or Bun 1.3.14 or newer.

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

The package installs a libtmux-mcp binary. Requires Node 22 or newer, or Bun 1.3.14 or newer.

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

The package installs a libtmux-mcp binary. Requires Node 22 or newer, or Bun 1.3.14 or newer.

The package installs a libtmux-mcp binary. Requires Node 22 or newer, or Bun 1.3.14 or newer.

The package installs a libtmux-mcp binary. Requires Node 22 or newer, or Bun 1.3.14 or newer.

The package installs a libtmux-mcp binary. Requires Node 22 or newer, or Bun 1.3.14 or newer.

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 ~/.codex/config.toml.

The package installs a libtmux-mcp binary. Requires Node 22 or newer, or Bun 1.3.14 or newer.

Writes ~/.codex/config.toml.

The package installs a libtmux-mcp binary. Requires Node 22 or newer, or Bun 1.3.14 or newer.

Writes ~/.codex/config.toml.

The package installs a libtmux-mcp binary. Requires Node 22 or newer, or Bun 1.3.14 or newer.

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

The package installs a libtmux-mcp binary. Requires Node 22 or newer, or Bun 1.3.14 or newer.

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

The package installs a libtmux-mcp binary. Requires Node 22 or newer, or Bun 1.3.14 or newer.

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

The package installs a libtmux-mcp binary. Requires Node 22 or newer, or Bun 1.3.14 or newer.

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).

Writes ~/.gemini/settings.json.

The package installs a libtmux-mcp binary. Requires Node 22 or newer, or Bun 1.3.14 or newer.

Writes ~/.gemini/settings.json.

The package installs a libtmux-mcp binary. Requires Node 22 or newer, or Bun 1.3.14 or newer.

Writes ~/.gemini/settings.json.

The package installs a libtmux-mcp binary. Requires Node 22 or newer, or Bun 1.3.14 or newer.

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

The package installs a libtmux-mcp binary. Requires Node 22 or newer, or Bun 1.3.14 or newer.

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

The package installs a libtmux-mcp binary. Requires Node 22 or newer, or Bun 1.3.14 or newer.

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

The package installs a libtmux-mcp binary. Requires Node 22 or newer, or Bun 1.3.14 or newer.

The package installs a libtmux-mcp binary. Requires Node 22 or newer, or Bun 1.3.14 or newer.

The package installs a libtmux-mcp binary. Requires Node 22 or newer, or Bun 1.3.14 or newer.

The package installs a libtmux-mcp binary. Requires Node 22 or newer, or Bun 1.3.14 or newer.

The package installs a libtmux-mcp binary. Requires Node 22 or newer, or Bun 1.3.14 or newer.

The package installs a libtmux-mcp binary. Requires Node 22 or newer, or Bun 1.3.14 or newer.

The package installs a libtmux-mcp binary. Requires Node 22 or newer, or Bun 1.3.14 or newer.

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).

Writes ~/.grok/config.toml.

The package installs a libtmux-mcp binary. Requires Node 22 or newer, or Bun 1.3.14 or newer.

Writes ~/.grok/config.toml.

The package installs a libtmux-mcp binary. Requires Node 22 or newer, or Bun 1.3.14 or newer.

Writes ~/.grok/config.toml.

The package installs a libtmux-mcp binary. Requires Node 22 or newer, or Bun 1.3.14 or newer.

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

The package installs a libtmux-mcp binary. Requires Node 22 or newer, or Bun 1.3.14 or newer.

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

The package installs a libtmux-mcp binary. Requires Node 22 or newer, or Bun 1.3.14 or newer.

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

The package installs a libtmux-mcp binary. Requires Node 22 or newer, or Bun 1.3.14 or newer.

The package installs a libtmux-mcp binary. Requires Node 22 or newer, or Bun 1.3.14 or newer.

The package installs a libtmux-mcp binary. Requires Node 22 or newer, or Bun 1.3.14 or newer.

The package installs a libtmux-mcp binary. Requires Node 22 or newer, or Bun 1.3.14 or newer.

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

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

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

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

The package installs a libtmux-mcp binary. Requires Node 22 or newer, or Bun 1.3.14 or newer.

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

The package installs a libtmux-mcp binary. Requires Node 22 or newer, or Bun 1.3.14 or newer.

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

The package installs a libtmux-mcp binary. Requires Node 22 or newer, or Bun 1.3.14 or newer.

@libtmux/mcp exposes tmux through an MCP stdio server and an embeddable TypeScript factory. Clients can inspect topology, capture output, run framed shell commands, and create or arrange panes.

The package requires Node 22 or newer, or Bun 1.3.14 or newer, plus tmux 3.3a or newer. Real tmux operation is supported on Linux; the package’s macOS artifact checks do not establish runtime support.

Start here

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

The server exposes a static tmux://capabilities resource. It does not register workflow prompts or dynamic hierarchy resources.

Use Workspace Manager to load and apply declarative configurations in application code. MCP clients create topology through individual tools; there is no workspace-file tool.

Package and runtime contract.

Tools by tier

The TypeScript 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 Invoke a serial batch of at most 16 inspect tools.
  • capture_pane Inspect The text a pane is showing, or its scrollback.
  • capture_since Inspect What a pane has printed since you last looked.
  • find_pane_by_position Inspect Find the visible pane at a window corner.
  • get_pane_info Inspect One pane's metadata: what it runs, where, how big, and whether it is yours or watched.
  • get_server_info Inspect The tmux server this process drives: its socket, version, daemon pid, and totals, and the oldest tmux release this server drives.
  • get_session_info Inspect Return metadata for one session without listing every session.
  • get_tmux_variables Inspect Resolve validated tmux variable names without accepting raw format syntax.
  • get_window_info Inspect Return metadata and placements for one window.
  • list_panes Inspect Panes on this server, with the command each is running and its directory.
  • list_sessions Inspect Every session on this server with its id, name, window count, and whether anyone is attached.
  • list_windows Inspect Windows on this server, optionally restricted to one session by id or name.
  • read_program Inspect Read what a started program printed after cursor, waiting up to timeoutMs for new output or its end, and report whether it has ended and how.
  • search_panes Inspect Find which panes are showing something.
  • show_environment Inspect Read the tmux environment.
  • show_hooks Inspect Read the hooks a server or session runs.
  • show_option Inspect Read one named tmux option at server, session, window, or pane scope.
  • snapshot_pane Inspect Return bounded terminal content and pane metadata in one MCP response.
  • wait_for_exit Inspect Wait until the program in a pane exits and return its exit status or signal.
  • wait_for_text Inspect Wait until a pane prints something, streaming tmux's notifications rather than polling.

Manage

Change tmux structure or presentation.

  • move_window Manage Move a window to another index, or into another session.
  • rename_session Manage Rename a session.
  • rename_window Manage Rename a window.
  • resize_pane Manage Resize a pane, either to a size or by an amount in a direction.
  • resize_window Manage Set a window's size in cells.
  • select_layout Manage Rearrange a window's panes using a named layout, a unique abbreviation for the running daemon, or a checksummed saved layout from a window whose metadataComplete is true.
  • select_pane Manage Make a pane the active one in its window.
  • select_window Manage Make a window the current one in its session.
  • set_history_limit Manage Set the default retained scrollback line limit through a bounded integer.
  • set_mouse_enabled Manage Set the global tmux mouse option through a closed boolean schema.
  • set_pane_title Manage Give a pane a title.
  • signal_channel Manage Signal a tmux wait-for channel.
  • swap_pane Manage Exchange two panes' positions.
  • wait_for_channel Manage Wait until a tmux wait-for channel is signalled.

Execute

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

  • create_session Execute Create a detached session and return it with its first window and pane, so you can start working without listing anything first.
  • create_window Execute Add a window to a session and return it with its pane.
  • paste_text Execute Put text into a pane without tmux interpreting any of it as key names.
  • respawn_pane Execute Restart a pane's command in place, keeping the pane and its id.
  • run_program Execute Run a program in a new pane of its own with your user's permissions.
  • run_shell_command Execute Run a shell command in a pane with your user's permissions.
  • send_keys Execute Send keystrokes to a pane.
  • send_keys_batch Execute Send an ordered batch of pane-input operations, resolving and checking each row's configured cohort immediately before input.
  • set_synchronize_panes Execute Set the window default for synchronized pane input.
  • split_window Execute Split a pane and return the new one.
  • start_program Execute Run a program in a new pane of its own with your user's permissions.
  • stop_program Execute End a started program and remove its pane now: SIGTERM, then SIGKILL two seconds later.

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