Skip to main content

Crate tmux_mcp

Crate tmux_mcp 

Source
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.
BranchPane
One pane inside a described window.
BranchWindow
One window inside a described session.
Builder
Assembles a TmuxTools with the parts the environment usually supplies.
CallerIdentity
The tmux pane hosting this process, as its environment describes it.
CapabilityReport
The frozen, effective MCP surface reported at tmux://capabilities.
Capture
What a pane is showing.
CapturePaneArgs
Arguments for reading a pane.
CaptureSinceArgs
Arguments for reading what a pane wrote since last time.
ChannelArgs
Arguments naming a wait-for channel.
ChannelSignal
A channel that was signalled.
ChannelWait
How a wait on a channel finished.
CreateSessionArgs
Arguments for creating a session.
Cursor
A place in one pane’s output.
Environment
A tmux environment, server-wide or for one session.
EnvironmentEntry
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.
MatchView
One line of one pane that matched a search.
Matches
Where a pattern was found.
OptionArgs
Arguments for reading a tmux option.
OptionValue
The value of one tmux option.
PaneArgs
Arguments naming one pane.
PaneChanged
A pane that was cleared, respawned, or retitled.
PaneView
One pane, as the protocol sees it.
Panes
Every pane asked for.
PasteTextArgs
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.
ResizePaneArgs
Arguments for resizing a pane.
RunCommandArgs
Arguments for running a command and waiting for it.
RunView
What a command did.
SearchPanesArgs
Arguments for searching what panes are showing.
SelectLayoutArgs
Arguments for arranging a window’s panes.
SelectPaneArgs
Arguments for moving focus between panes.
SelectWindowArgs
Arguments for moving focus between windows.
Selection
The startup-frozen request for one MCP tool surface.
SendKeysArgs
Arguments for sending input to a pane.
Sent
Keys that were sent.
SessionArgs
Arguments naming one session.
SessionView
One session, as the protocol sees it.
Sessions
Every session on the server.
ShowEnvironmentArgs
Arguments for reading a tmux environment.
ShowHooksArgs
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.
SnapshotArgs
Arguments for reading a pane’s whole state.
SurfaceError
A startup configuration or manifest error.
TmuxTools
A tmux server presented as MCP tools.
ToolError
A tool-execution failure, reported as isError tool content.
Tree
The whole hierarchy, in one answer.
WaitForTextArgs
Arguments for waiting until a pane says something.
WaitView
What a pane said while it was watched for a pattern.
WindowArgs
Arguments naming one window.
WindowView
One window, as the protocol sees it.
Windows
Every window asked for.

Enums§

EnvironmentState
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.
SocketProvenance
What startup can honestly claim about the selected tmux daemon.
Toolset
One mechanical group in the advertised MCP tool inventory.
WaitOutcome
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_ENV before serving MCP.
parse_environment_values
Parse the operator’s allowed environment names.