io.github.libtmux.mcp.Main
-
Runs the tmux MCP server over stdin and stdout.
Description#
An MCP client launches this as a subprocess and speaks JSON-RPC over its standard streams, so nothing may write to stdout but the protocol. Diagnostics go to stderr, which the client is free to log or discard.
Which tmux server to expose is chosen the same way the library chooses it: a socket path, a socket name, or tmux's own default.
LIBTMUX_SOCKET_PATHandLIBTMUX_SOCKETstand in for the flags when none is given, and with neither set tmux picks the server itself, which is the one inTMUXwhen the launcher runs inside a pane.The unordered toolset and named-tool environment variables resolve one immutable surface before tmux is opened. A tool outside it is neither listed nor callable.
A tmux older than 3.3a, or one that reports no release, is refused at startup: one line on stderr naming the version required and what to do, and a non-zero exit, with no stack trace.
Examples#
libtmux-mcp --socket /run/user/1000/tmux/defaultlibtmux-mcp --socket-name work --tmux /usr/local/bin/tmux