tmux-mcp
Model Context Protocol (MCP) server for tmux, written in Python and distributed via
uvx.
Exposes 37 granular tools covering sessions, windows, panes, layouts, status inspection, and secure command execution using event-driven pipe-pane + wait-for primitives.
Key Features & Security Design
- No Shell Injection Vulnerabilities: All tmux interactions execute strictly via argv parameter arrays without
shell=True. - Event-Driven Execution Engine: Uses
pipe-panestreams andtmux wait-forevents instead of polling or scrollback regex. Captures exact return codes and complete output streams (>50,000 lines tested without truncation). - Interactive App Guard: Automatically blocks non-shell panes (e.g.
vim,htop,python) from accidental command injection, prompting the caller to use keypress tools (send_keys) instead. - Strict Protocol & Output Purity: Zero stray stdout prints to prevent corrupting the MCP stdio JSON-RPC transport stream (logging strictly routed to
sys.stderr). - Portable Flat Tool Schemas: Compatible with all MCP clients (Claude Code, Claude Desktop, OpenCode, Cursor, Windsurf, Zed, Continue, VS Code) by enforcing flat JSON schemas without unsupported
$ref/$defs/anyOfconstructs.
Quick Start
Run instantly without installing Python dependencies using uvx:
# Run with standard profile (default 22 tools)
uvx tmux-mcp-server
# Run with full profile (all 37 tools including destructive actions)
uvx tmux-mcp-server --tools=full
# Run in read-only mode (13 read tools)
uvx tmux-mcp-server --read-only
Tool Profiles
| Profile | Tools Count | Description |
|---|---|---|
standard (default) |
22 | All read, interact, split, resize, layout, and command execution tools (excludes destructive kill-* tools). |
full |
37 | Complete set of 37 tools, including destructive operations (kill_session, kill_window, kill_pane). |
read |
13 | Read-only inspection tools. Safe for unrestricted agent usage. |
| Custom | N | Comma-separated list of tool names (e.g. --tools=list_sessions,read_pane,run_command). |
Client Configuration Examples
Watch the package name. This project is
tmux-mcp-server. Do not configure"args": ["tmux-mcp"]—tmux-mcpis an unrelated, already-published PyPI package, anduvxwould silently download and run that one instead.Working on the code? Point the client at your checkout so edits take effect immediately:
"args": ["run", "--directory", "/absolute/path/to/tmux-mcp-server", "tmux-mcp-server"]with
"command": "uv". Note thatuvx --from <path>caches the built wheel per version, so local edits are not picked up until you bumpversioninpyproject.toml—uv run --directoryhas no such caching.
1. Claude Code
Add to ~/.claude.json or .claude.json:
{
"mcpServers": {
"tmux": {
"command": "uvx",
"args": ["tmux-mcp-server"]
}
}
}
2. Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"tmux": {
"command": "uvx",
"args": ["tmux-mcp-server"]
}
}
}
3. OpenCode
Add to ~/.config/opencode/opencode.json (or project .opencode/mcp.json):
{
"mcpServers": {
"tmux": {
"command": "uvx",
"args": ["tmux-mcp-server"]
}
}
}
4. Cursor
Add to Settings -> Features -> MCP:
- Name:
tmux - Type:
command - Command:
uvx tmux-mcp-server
5. Windsurf
Add to ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"tmux": {
"command": "uvx",
"args": ["tmux-mcp-server"]
}
}
}
6. Zed
Add to ~/.config/zed/settings.json:
{
"context_servers": {
"tmux": {
"command": {
"path": "uvx",
"args": ["tmux-mcp-server"]
}
}
}
}
7. Continue
Add to ~/.continue/config.json:
{
"mcpServers": [
{
"name": "tmux",
"command": "uvx",
"args": ["tmux-mcp-server"]
}
]
}
8. VS Code (Roo Code / Cline)
Add to .vscode/mcp.json:
{
"mcpServers": {
"tmux": {
"command": "uvx",
"args": ["tmux-mcp-server"]
}
}
}
9. Generic Stdio Client
Any MCP-compliant client can launch via stdio:
{
"command": "uvx",
"args": ["tmux-mcp-server"]
}
Tool Reference (37 Tools)
Sessions (6)
list_sessionsget_sessioncreate_sessionrename_sessionswitch_clientkill_session⚠️
Windows (6)
list_windowscreate_windowrename_windowselect_windowmove_windowkill_window⚠️
Panes — Read & Interact (7)
list_panesget_pane_inforead_panesearch_panesend_keyssend_special_keyclear_pane
Panes — Layout & Sizing (9)
split_paneselect_paneresize_panezoom_paneswap_panesmove_panebreak_paneset_layoutkill_pane⚠️
Command Execution (5)
run_commandget_command_resultwait_commandlist_commandscancel_command
Server & Inspection (4)
server_infolist_clientsdisplay_messageshow_options
Development & Testing
Run all unit and integration tests (using an isolated test socket -L tmux-mcp-test):
uv run pytest
License
MIT
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tmux_mcp_server-1.0.0.tar.gz.
File metadata
- Download URL: tmux_mcp_server-1.0.0.tar.gz
- Upload date:
- Size: 21.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
399679d3cb176dc55907a5c3726997c56c6fe877d3975d860117446a9dae0518
|
|
| MD5 |
407b4bcdb0b2b1ba3b238882d7f215ea
|
|
| BLAKE2b-256 |
46b4077afc0278fb2195a3a2a4fa5f3c9d6ae37ff0602dc00416ffdf49ddc5ad
|
File details
Details for the file tmux_mcp_server-1.0.0-py3-none-any.whl.
File metadata
- Download URL: tmux_mcp_server-1.0.0-py3-none-any.whl
- Upload date:
- Size: 31.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ff491c1db468b56040f9655f603e08dd8485d27ccd073eef2c2d6f99c1076d44
|
|
| MD5 |
f7370d39618faa5af3a73a4c08fca47c
|
|
| BLAKE2b-256 |
ddb240fc71152b3f0c0f863d88fe34f599e1b2d2d9a2fa98c8d9d917d9de432e
|