A Model Context Protocol server for tmux, built on libtmux.
Warning
Pre-alpha. APIs may change. Contributions and feedback welcome.
Give your AI agent hands inside the terminal — create sessions, run commands, read output, orchestrate panes.
| Module | Tools |
|---|---|
| Server | list_sessions, create_session, kill_server, get_server_info |
| Session | list_windows, create_window, rename_session, kill_session |
| Window | list_panes, split_window, rename_window, kill_window, select_layout, resize_window |
| Pane | send_keys, capture_pane, resize_pane, kill_pane, set_pane_title, get_pane_info, clear_pane, search_panes, wait_for_text |
| Options | show_option, set_option |
| Environment | show_environment, set_environment |
Requirements: Python 3.10+, tmux on $PATH.
Install and run:
uvx libtmux-mcpclaude mcp add tmux -- uvx libtmux-mcpcodex mcp add tmux -- uvx libtmux-mcpgemini mcp add tmux uvx -- libtmux-mcpAdd to claude_desktop_config.json:
{
"mcpServers": {
"tmux": {
"command": "uvx",
"args": ["libtmux-mcp"]
}
}
}More clients and JSON config: client setup docs
You: Create a session called "api" and run
pytest tests/api/ -xin it.Agent: Created session
apiwith windowtests. Running pytest now. Here's the output — 14 passed, 2 failed. The failures are intest_auth.py::test_token_refreshandtest_auth.py::test_expired_session. Want me to open those files?
The agent manages tmux directly. No copy-pasting terminal output. No switching windows to check on long-running processes.
Full docs, guides, and tool reference: libtmux-mcp.git-pull.com
Clone and install:
git clone https://github.com/tmux-python/libtmux-mcp.gitcd libtmux-mcpuv sync --devRun the server locally:
uv run libtmux-mcpRun tests:
uv run pytest- libtmux — Python API for tmux
- tmuxp — tmux session manager
- The Tao of tmux — the book
MIT