Expand description
A Model Context Protocol server exposing tmux through libtmux.
The server freezes one 45-tool surface at startup from the unordered
inspect, manage, execute, and teardown toolsets. Every native route
carries its process reach, tmux effects, output classes, interpreter sinks,
and whole-call annotations in one typed manifest. The effective manifest is
available as tmux://capabilities.
The dependency runs one way. libtmux knows nothing about MCP.
§Startup boundary
One process selects one socket. The binary uses the dedicated
libtmux-mcp socket and minimal configuration by default; explicit socket
or configuration settings carry conservative provenance. Teardown is in
the implicit default only for a newly dedicated minimal daemon. The
LIBTMUX_TOOLSETS, LIBTMUX_TOOLS, and LIBTMUX_EXCLUDE_TOOLS settings
are parsed before tmux access, and exclusions win.
§Trust boundary
Pane input and pane commands run with the tmux user’s permissions. Pane
output may be sensitive or untrusted. tmux environment values are withheld
unless Builder::environment_values allows the name; hooks may contain
executable configuration. Configured-process
routes accept neither command nor environment payloads. There is no public
host-command route.
§Knowing where you are
An inherited TMUX and TMUX_PANE identify the caller only after socket
provenance matches. Pane listings report self, other, or unknown, and
pane-input and teardown routes fail closed when their reach may contain the
caller.
Modules§
- cli
- Reading the command line the binary was started with.
- resources
- The frozen capability report exposed as one static MCP resource.
Macros§
- capability_
meta - Attach one typed capability row to an SDK-native tool route.
Structs§
- Branch
- One session with everything under it.
- Branch
Pane - One pane inside a described window.
- Branch
Window - One window inside a described session.
- Builder
- Assembles a
TmuxToolswith the parts the environment usually supplies. - Caller
Identity - The tmux pane hosting this process, as its environment describes it.
- Capability
Report - The frozen, effective MCP surface reported at
tmux://capabilities. - Capture
- What a pane is showing.
- Capture
Pane Args - Arguments for reading a pane.
- Capture
Since Args - Arguments for reading what a pane wrote since last time.
- Channel
Args - Arguments naming a
wait-forchannel. - Channel
Signal - A channel that was signalled.
- Channel
Wait - How a wait on a channel finished.
- Create
Session Args - Arguments for creating a session.
- Cursor
- A place in one pane’s output.
- Environment
- A tmux environment, server-wide or for one session.
- Environment
Entry - One tmux environment entry.
- Hook
- One tmux hook.
- Hooks
- The hooks set at one scope.
- Killed
- An object that was destroyed.
- Layout
- A window whose layout was set.
- Match
View - One line of one pane that matched a search.
- Matches
- Where a pattern was found.
- Option
Args - Arguments for reading a tmux option.
- Option
Value - The value of one tmux option.
- Pane
Args - Arguments naming one pane.
- Pane
Changed - A pane that was cleared, respawned, or retitled.
- Pane
View - One pane, as the protocol sees it.
- Panes
- Every pane asked for.
- Paste
Text Args - Arguments for putting text into a pane without typing it.
- Pasted
- Text that was pasted into a pane.
- Reporter
- Whoever asked to be told how a long call is getting on.
- Resize
Pane Args - Arguments for resizing a pane.
- RunCommand
Args - Arguments for running a command and waiting for it.
- RunView
- What a command did.
- Search
Panes Args - Arguments for searching what panes are showing.
- Select
Layout Args - Arguments for arranging a window’s panes.
- Select
Pane Args - Arguments for moving focus between panes.
- Select
Window Args - Arguments for moving focus between windows.
- Selection
- The startup-frozen request for one MCP tool surface.
- Send
Keys Args - Arguments for sending input to a pane.
- Sent
- Keys that were sent.
- Session
Args - Arguments naming one session.
- Session
View - One session, as the protocol sees it.
- Sessions
- Every session on the server.
- Show
Environment Args - Arguments for reading a tmux environment.
- Show
Hooks Args - Arguments for reading the hooks set at a scope.
- Since
- What a pane wrote since a cursor.
- Size
- A pane’s size after being resized.
- Snapshot
- A pane’s contents and the state a capture leaves out.
- Snapshot
Args - Arguments for reading a pane’s whole state.
- Surface
Error - A startup configuration or manifest error.
- Tmux
Tools - A tmux server presented as MCP tools.
- Tool
Error - A tool-execution failure, reported as
isErrortool content. - Tree
- The whole hierarchy, in one answer.
- Wait
ForText Args - Arguments for waiting until a pane says something.
- Wait
View - What a pane said while it was watched for a pattern.
- Window
Args - Arguments naming one window.
- Window
View - One window, as the protocol sees it.
- Windows
- Every window asked for.
Enums§
- Environment
State - What tmux holds under one environment name.
- Marks
- Whether tmux knew where the last command’s output began.
- Relation
- How a pane relates to the process answering the request.
- RunOutcome
- How a run finished.
- Socket
Provenance - What startup can honestly claim about the selected tmux daemon.
- Toolset
- One mechanical group in the advertised MCP tool inventory.
- Wait
Outcome - How a wait for text finished.
Constants§
- ENVIRONMENT_
VALUES_ ENV - The tmux environment variables whose values tools may return.
- EXCLUDE_
TOOLS_ ENV - Individual tools removed after every inclusion path.
- RETIRED_
RUST_ SAFETY_ ENV - The older Rust-specific safety setting, rejected rather than ignored.
- RETIRED_
SAFETY_ ENV - The retired ordered-safety setting, rejected rather than ignored.
- TOOLSETS_
ENV - The unordered toolsets enabled for this process.
- TOOLS_
ENV - Individual tools added after toolset expansion.
Functions§
- environment_
values_ from_ env - Read
ENVIRONMENT_VALUES_ENVbefore serving MCP. - parse_
environment_ values - Parse the operator’s allowed environment names.