libtmux MCPサーバー
コミット 2026年11月12日AIエージェントがコマンドの実行、ターミナル出力の読み取り、ターミナル環境のオーケストレーションを行うことで、tmuxのセッション、ウィンドウ、ペインを管理できるようにします。
別名 tmux-python/libtmux-mcp
- スター
- 14
- ツール
- —
- ダウンロード数(30日間)
- —
- 最新バージョン
- —
- 最終コミット
- 2026年11月12日
- ライセンス
- MIT
libtmux MCPとは
AIエージェントがコマンドの実行、ターミナル出力の読み取り、ターミナル環境のオーケストレーションを行うことで、tmuxのセッション、ウィンドウ、ペインを管理できるようにします。
プロジェクトのREADMEから生成された概要
libtmux MCP server について
libtmux-mcpは、AIエージェント内からターミナル環境や長時間実行されるプロセスを管理することを可能にします。このMCP serverは、Model Context Protocolクライアントとtmuxの間のブリッジとして機能し、エージェントによるセッションの作成、ウィンドウの管理、個別のペインの制御を実現します。Claude Desktop、Claude Code、Codex CLI、またはGemini CLIなどのツールを使用している開発者が、AIアシスタントにターミナル環境への直接的な操作権限を与えることを目的として設計されています。
ユーザーは、uvxを使用するか、クライアントの設定に追加することで、ローカルにサーバーをセットアップできます。このサーバーには、高度なターミナルオーケストレーションのための専用ツールが含まれています。例えば、終了ステータスと共にシェルコマンドを実行するrun_command、定常的なポーリングなしに出力を監視するwait_for_text、新しいターミナルの行のみを読み取るcapture_sinceなどがあります。また、split_window、resize_pane、テキストベースのユーザーインターフェースと対話するためのsend_keys_batchといったツールを通じて、ペインの管理も提供します。
この実装は、効率性と安全性に重点を置いています。エージェントのコマンドをシェルの履歴に残さないための履歴抑制機能を使用しているほか、エージェントが誤って自身のホストセッションを終了させないための保護機能も備わっています。開発者は、LIBTMUX_TOOLSETS環境変数を使用することで、inspect、manage、execute、teardownといった特定のツールグループを含めたり除外したりして、エージェントの機能をさらに細かく調整できます。
できること
- 1テスト実行の自動化エージェントに新しいtmuxセッションを開始させ、結果を監視しながら特定のテストスイートを実行させます。
プロジェクトの README から作成されています。すべてのユースケースは、その引用と照らし合わせて確認されています。
自動チェック
実行日 2026年11月14日完全なレポート →まだ検証されていません。サーバーには80点のスコア、重大な問題がないこと、および検証に必要な十分なデータが必要です。 チェックの仕組み · 点数を上げるための改善点
- ソースリポジトリがリンクされており、アクセス可能tmux-python/libtmux-mcp is public and reachablegithub.com/tmux-python/libtmux-mcp ↗合格
- パッケージがこのリポジトリをソースとして指定未チェック
- ビルドの来歴 (Sigstore 証明)未チェック
- オープンソースライセンス (OSI)MITspdx.org/licenses/MIT.html ↗合格
- 過去1年以内にコミットまたはリリースありLast commit or release 2026-11-12github.com/tmux-python/libtmux-mcp ↗合格
- OpenSSF Scorecard未チェック
- パッケージ名が有名なパッケージに酷似していない未チェック
- パッケージおよびその依存関係に重大な勧告なし未チェック
- モデルへの隠れた指示がない0 tool descriptions and the README read; no override phrases, credential paths or hidden characters合格
- 破壊的なツールがラベル付けされている未チェック
- リモートエンドポイントが MCP ハンドシェイクに応答未チェック
README
GitHubで見るlibtmux-mcp
A Model Context Protocol server for tmux, built on libtmux.
[!WARNING] Alpha. Releases carry an
-alphaprerelease tag. The API is not settled, and any release may change or remove exported identifiers without a deprecation period. Pin an exact version. Not recommended for production.
Give your AI agent hands inside the terminal — create sessions, run commands, read output, orchestrate panes.
Tools
| Module | Tools |
|---|---|
| Server | list_servers, list_sessions, create_session, kill_server, get_server_info |
| Batch | call_read_tools_batch |
| Session | list_windows, get_session_info, create_window, rename_session, select_window, kill_session |
| Window | list_panes, get_window_info, split_window, rename_window, select_layout, resize_window, move_window, kill_window |
| Pane | run_command, send_keys, send_keys_batch, paste_text, capture_pane, capture_since, snapshot_pane, search_panes, find_pane_by_position, get_pane_info, wait_for_text, wait_for_channel, signal_channel, display_message, select_pane, swap_pane, resize_pane, set_pane_title, clear_pane, pipe_pane, enter_copy_mode, exit_copy_mode, respawn_pane, kill_pane |
| Options | show_option, set_option |
| Environment | show_environment, set_environment |
| Buffers | load_buffer, paste_buffer, show_buffer, delete_buffer |
| Hooks | show_hooks, show_hook |
Quickstart
Requirements: Python 3.11+, tmux >= 3.2a on $PATH.
The distribution is libtmux-mcp, the import is libtmux_mcp, and the
installed executable is libtmux-mcp.
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/ -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.
When the server earns its keep
For a single tmux send-keys, the server doesn't. It earns its keep
the moment the agent has to wait, inspect, or avoid damaging the
terminal it is using — pytest finishing, a dev server printing its
port, a deploy log settling. The difference then is not more access
to tmux, but a better place to put the control loop.
The server-side moves are:
Running. run_command
sends an authored shell command, waits for deterministic completion,
and returns exit status plus tail-preserved output as one typed value.
The command and its completion signal reach the shell as one
space-prefixed event, so best-effort
history suppression
keeps agent-generated input out of shell history by default. The
alternative — hand-rolled send-keys plus wait-for plus a pane
capture — leaves every typed command, signal included, in shell
history.
Driving. send_keys_batch
sends several ordered raw-input operations for TUIs and persistent
shell interaction. It is deliberately not a workflow DSL; command
completion stays in run_command, and repeated observation stays in
capture_since.
Waiting. wait_for_text
blocks inside the server until a condition fires for output the agent
does not author. The alternative is the model polling capture-pane
in a loop, paying both context tokens and round-trip latency for every
turn.
Reading. snapshot_pane
returns content, cursor, copy-mode state, and scroll offset as one
typed value. The alternative is several tmux invocations stitched
together with regex.
Observing. capture_since
returns a cursor with the current pane content, then returns only
newly written or rewritten rows on follow-up calls. The alternative is
re-sending the same scrollback to the model on every check.
Guarding. The server detects the agent's own pane across sockets
and declines to end its own — kill_session
on itself fails loudly instead of silently terminating the host
environment the agent is running in. LIBTMUX_TOOLSETS
(inspect, manage, execute, teardown) drops whole toolsets from the
client's tool list before any prompt is built. The sets are unordered, so
inspect,teardown is a legal surface. Dropping one is inventory and MCP
tool-call configuration, not containment: an enabled execute tool can type
the equivalent of anything it hides.
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 --all-extras --dev
Run the server locally:
$ uv run libtmux-mcp
Run tests:
$ uv run pytest
See CONTRIBUTING.md for the gates, and WRITING.md for how this project writes prose, docstrings, and MCP tool descriptions.
Related projects
- libtmux — Python API for tmux
- tmuxp — tmux session manager
- The Tao of tmux — the book
Attribution
Please use the following BibTeX template to cite libtmux-mcp in scientific discourse:
@misc{libtmux-mcp,
author = {Tony Narlock},
year = {2026},
note = {https://libtmux-mcp.git-pull.com},
title = {libtmux-mcp: MCP server for tmux}
}
License
MIT
libtmux MCPのよくある質問
このサーバーは本番環境での利用が可能ですか?
いいえ、このサーバーは現在Alpha版です。そのため、APIは未確定であり、リリース時に予告なく識別子が変更または削除される可能性があります。
エージェントはシェル履歴を汚さずにコマンドを実行できますか?
はい、run_commandツールはデフォルトで履歴抑制機能を使用しているため、エージェントが生成した入力がシェルの履歴に残らないようになっています。