Skip to main content

MCP server for tmux, powered by libtmux

Project description

libtmux-mcp

A Model Context Protocol server for tmux, built on libtmux.

Python Version PyPI Version License

[!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.

Tools

Module Tools
Server list_sessions, create_session, kill_server, get_server_info
Session list_windows, create_window, rename_session, select_window, kill_session
Window list_panes, split_window, rename_window, select_layout, resize_window, move_window, kill_window
Pane send_keys, paste_text, capture_pane, snapshot_pane, search_panes, get_pane_info, wait_for_text, wait_for_content_change, display_message, select_pane, swap_pane, resize_pane, set_pane_title, clear_pane, pipe_pane, enter_copy_mode, exit_copy_mode, kill_pane
Options show_option, set_option
Environment show_environment, set_environment

Quickstart

Requirements: Python 3.10+, tmux on $PATH.

Install and run:

uvx libtmux-mcp

Claude Code

claude mcp add tmux -- uvx libtmux-mcp

Codex CLI

codex mcp add tmux -- uvx libtmux-mcp

Gemini CLI

gemini mcp add tmux uvx -- libtmux-mcp

Claude Desktop

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "tmux": {
      "command": "uvx",
      "args": ["libtmux-mcp"]
    }
  }
}

More clients and JSON config: client setup docs

What it feels like

You: Create a session called "api" and run pytest tests/api/ -x in it.

Agent: Created session api with window tests. Running pytest now. Here's the output — 14 passed, 2 failed. The failures are in test_auth.py::test_token_refresh and test_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.

Documentation

Full docs, guides, and tool reference: libtmux-mcp.git-pull.com

Development

Clone and install:

git clone https://github.com/tmux-python/libtmux-mcp.git
cd libtmux-mcp
uv sync --dev

Run the server locally:

uv run libtmux-mcp

Run tests:

uv run pytest

Related projects

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

libtmux_mcp-0.1.0a3.tar.gz (475.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

libtmux_mcp-0.1.0a3-py3-none-any.whl (77.9 kB view details)

Uploaded Python 3

File details

Details for the file libtmux_mcp-0.1.0a3.tar.gz.

File metadata

  • Download URL: libtmux_mcp-0.1.0a3.tar.gz
  • Upload date:
  • Size: 475.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for libtmux_mcp-0.1.0a3.tar.gz
Algorithm Hash digest
SHA256 c98ff0d548b529f047f35269c3eb26cc216a862864c1be47cbc9e4a8d4b3f18b
MD5 6f8eaa8c5555e6452216f9f519b7de38
BLAKE2b-256 f647721eabcdb3dd9555b46268bfce6c3538f9a96881558465c5787159710e22

See more details on using hashes here.

Provenance

The following attestation bundles were made for libtmux_mcp-0.1.0a3.tar.gz:

Publisher: tests.yml on tmux-python/libtmux-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file libtmux_mcp-0.1.0a3-py3-none-any.whl.

File metadata

  • Download URL: libtmux_mcp-0.1.0a3-py3-none-any.whl
  • Upload date:
  • Size: 77.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for libtmux_mcp-0.1.0a3-py3-none-any.whl
Algorithm Hash digest
SHA256 994ca8348a2d6f9dccfbf5a85d2ba65837a1c78a32c9420f4de04b186c7a27da
MD5 692fae9ecb94dd7073f6ce94d693581e
BLAKE2b-256 2a4714021a9fc481718cc923be828883a77a573a1d5a26c21fec98b9bf8d523b

See more details on using hashes here.

Provenance

The following attestation bundles were made for libtmux_mcp-0.1.0a3-py3-none-any.whl:

Publisher: tests.yml on tmux-python/libtmux-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page