Prerelease This site documents an alpha of libtmux. Its structure, URLs and APIs are subject to change.

mcp.src.TmuxTools

Rust
  • Python Unavailable
  • Ruby Unavailable
  • Lua Unavailable
  • TypeScript Unavailable
  • Rust
  • Go Unavailable
  • Java Unavailable
  • .NET Unavailable
  • C++ Unavailable
  • Swift Unavailable

API reference · Markdown

class mcp.src.TmuxTools
classoverload [source]
classoverload [source]
class mcp.src.TmuxTools

A tmux server presented as MCP tools.

Members

new

new ( server : Server ) → Self
method [source]
method [source]
new

Expose one tmux server, locating this process within it.

builder

builder ( server : Server ) → Builder
method [source]
method [source]
builder

Expose one tmux server, saying explicitly where this process is and how much of the surface it may use.

The environment is process-wide, so a test that needs a caller or a selection cannot set one without disturbing every other test. This is how it says so instead.

Discussed in Rust MCP API

offered

offered ( self ) → Vec<rmcp::model::Tool>
method [source]
method [source]
offered

The tools this server offers after startup selection.

Discussed in Rust MCP API

caller_pane

caller_pane ( self ) → Option<&str>
method [source]
method [source]
caller_pane

The pane this process runs in, when tmux named a complete identity.

Reported without checking it against the server, because this is for saying what the environment claimed rather than for deciding anything.

caller_is_malformed

caller_is_malformed ( self ) → bool
method [source]
method [source]
caller_is_malformed

Whether the inherited caller context is set but malformed, which makes pane-input and teardown tools refuse every call.

get_session_info

get_session_info ( self , Parameters(crate::SessionArgs { session }) : Parameters<crate::SessionArgs> ) → Result<Json<SessionView>, ToolError>
method [source]
method [source]
get_session_info

get_window_info

get_window_info ( self , Parameters(crate::WindowArgs { window }) : Parameters<crate::WindowArgs> ) → Result<Json<WindowView>, ToolError>
method [source]
method [source]
get_window_info

get_pane_info

get_pane_info ( self , Parameters(crate::PaneArgs { pane }) : Parameters<crate::PaneArgs> ) → Result<Json<PaneView>, ToolError>
method [source]
method [source]
get_pane_info

find_pane_by_position

find_pane_by_position ( self , Parameters(PositionArgs { window, corner }) : Parameters<PositionArgs> ) → Result<Json<PaneView>, ToolError>
method [source]
method [source]
find_pane_by_position

get_tmux_variables

get_tmux_variables ( self , Parameters(VariablesArgs { names, pane }) : Parameters<VariablesArgs> ) → Result<Json<VariablesValue>, ToolError>
method [source]
method [source]
get_tmux_variables

rename_session

rename_session ( self , Parameters(RenameSessionArgs { session, name }) : Parameters<RenameSessionArgs> ) → Result<Json<SessionView>, ToolError>
method [source]
method [source]
rename_session

rename_window

rename_window ( self , Parameters(RenameWindowArgs { window, name }) : Parameters<RenameWindowArgs> ) → Result<Json<WindowView>, ToolError>
method [source]
method [source]
rename_window

resize_window

resize_window ( self , Parameters(WindowSizeArgs { window, width, height, }) : Parameters<WindowSizeArgs> ) → Result<Json<WindowView>, ToolError>
method [source]
method [source]
resize_window

move_window

move_window ( self , Parameters(MoveWindowArgs { window, destination_session, destination_index, }) : Parameters<MoveWindowArgs> ) → Result<Json<WindowView>, ToolError>
method [source]
method [source]
move_window

swap_pane

swap_pane ( self , Parameters(SwapPaneArgs { source_pane, target_pane, }) : Parameters<SwapPaneArgs> ) → Result<Json<PaneView>, ToolError>
method [source]
method [source]
swap_pane

set_pane_title

set_pane_title ( self , Parameters(PaneTitleArgs { pane, title }) : Parameters<PaneTitleArgs> ) → Result<Json<PaneView>, ToolError>
method [source]
method [source]
set_pane_title

set_mouse_enabled

set_mouse_enabled ( self , Parameters(SessionFlagArgs { session, enabled }) : Parameters<SessionFlagArgs> ) → Result<Json<SettingChanged>, ToolError>
method [source]
method [source]
set_mouse_enabled

set_history_limit

set_history_limit ( self , Parameters(HistoryLimitArgs { session, limit }) : Parameters<HistoryLimitArgs> ) → Result<Json<SettingChanged>, ToolError>
method [source]
method [source]
set_history_limit

create_window

create_window ( self , Parameters(CreateWindowArgs { session, name, start_directory, }) : Parameters<CreateWindowArgs> ) → Result<Json<WindowView>, ToolError>
method [source]
method [source]
create_window

split_window

split_window ( self , Parameters(SplitWindowArgs { pane, direction, percent, start_directory, }) : Parameters<SplitWindowArgs> ) → Result<Json<PaneView>, ToolError>
method [source]
method [source]
split_window

respawn_pane_configured

respawn_pane_configured ( self , Parameters(RespawnArgs { pane, kill_first }) : Parameters<RespawnArgs> ) → Result<Json<PaneView>, ToolError>
method [source]
method [source]
respawn_pane_configured

set_synchronize_panes

set_synchronize_panes ( self , Parameters(WindowFlagArgs { window, enabled }) : Parameters<WindowFlagArgs> ) → Result<Json<SettingChanged>, ToolError>
method [source]
method [source]
set_synchronize_panes

send_keys_batch

send_keys_batch ( self , Parameters(SendBatchArgs { operations, on_error, }) : Parameters<SendBatchArgs> ) → Result<Json<BatchResult>, ToolError>
method [source]
method [source]
send_keys_batch

call_read_tools_batch

call_read_tools_batch ( self , Parameters(ReadBatchArgs { operations, on_error, }) : Parameters<ReadBatchArgs> , context : RequestContext<rmcp::RoleServer> ) → Result<Json<BatchResult>, ToolError>
method [source]
method [source]
call_read_tools_batch

kill_window

kill_window ( self , Parameters(WindowArgs { window }) : Parameters<WindowArgs> ) → Result<Json<Killed>, ToolError>
method [source]
method [source]
kill_window

Kill one window.

kill_pane

kill_pane ( self , Parameters(PaneArgs { pane }) : Parameters<PaneArgs> ) → Result<Json<Killed>, ToolError>
method [source]
method [source]
kill_pane

Kill one pane.

create_session

create_session ( self , Parameters(CreateSessionArgs { name, start_directory, }) : Parameters<CreateSessionArgs> ) → Result<Json<SessionView>, ToolError>
method [source]
method [source]
create_session

Create a detached session.

kill_session

kill_session ( self , Parameters(SessionArgs { session }) : Parameters<SessionArgs> ) → Result<Json<Killed>, ToolError>
method [source]
method [source]
kill_session

Kill a session and everything in it.

resize_pane

resize_pane ( self , Parameters(ResizePaneArgs { pane, direction, cells, }) : Parameters<ResizePaneArgs> ) → Result<Json<Size>, ToolError>
method [source]
method [source]
resize_pane

Move one edge of a pane.

send_keys

send_keys ( self , Parameters(args) : Parameters<SendKeysArgs> ) → Result<Json<Sent>, ToolError>
method [source]
method [source]
send_keys

Type text into a pane, or press keys in it.

select_pane

select_pane ( self , Parameters(SelectPaneArgs { pane, direction }) : Parameters<SelectPaneArgs> ) → Result<Json<PaneView>, ToolError>
method [source]
method [source]
select_pane

Move focus to a pane, or to the one beside it.

select_window

select_window ( self , Parameters(SelectWindowArgs { window, direction }) : Parameters<SelectWindowArgs> ) → Result<Json<Windows>, ToolError>
method [source]
method [source]
select_window

Move focus to a window, or to the one beside it.

select_layout

select_layout ( self , Parameters(SelectLayoutArgs { window, layout }) : Parameters<SelectLayoutArgs> ) → Result<Json<Layout>, ToolError>
method [source]
method [source]
select_layout

Arrange a window's panes.

clear_pane

clear_pane ( self , Parameters(PaneArgs { pane }) : Parameters<PaneArgs> ) → Result<Json<PaneChanged>, ToolError>
method [source]
method [source]
clear_pane

Empty a pane's scrollback.

paste_text

paste_text ( self , Parameters(PasteTextArgs { pane, text, enter }) : Parameters<PasteTextArgs> ) → Result<Json<Pasted>, ToolError>
method [source]
method [source]
paste_text

Deliver text to a pane without typing it.

signal_channel

signal_channel ( self , Parameters(ChannelArgs { channel, .. }) : Parameters<ChannelArgs> ) → Result<Json<ChannelSignal>, ToolError>
method [source]
method [source]
signal_channel

Signal a wait-for channel.

list_sessions

list_sessions ( self ) → Result<Json<Sessions>, ToolError>
method [source]
method [source]
list_sessions

List every session on the server.

Discussed in Rust MCP examples

list_windows

list_windows ( self ) → Result<Json<Windows>, ToolError>
method [source]
method [source]
list_windows

List every window on the server, one row per session link.

list_panes

list_panes ( self ) → Result<Json<Panes>, ToolError>
method [source]
method [source]
list_panes

List every pane on the server.

describe

describe ( self ) → Result<Json<Tree>, ToolError>
method [source]
method [source]
describe

Report the whole hierarchy in one call.

capture_pane

capture_pane ( self , Parameters(CapturePaneArgs { pane, history, last_command, start, end, }) : Parameters<CapturePaneArgs> ) → Result<Json<Capture>, ToolError>
method [source]
method [source]
capture_pane

Read one pane's contents.

snapshot_pane

snapshot_pane ( self , Parameters(SnapshotArgs { pane, max_lines, history, }) : Parameters<SnapshotArgs> ) → Result<Json<Snapshot>, ToolError>
method [source]
method [source]
snapshot_pane

Report pane state and bounded content in one answer.

search_panes

search_panes ( self , Parameters(SearchPanesArgs { pattern, regex, match_case, history, session, window, }) : Parameters<SearchPanesArgs> ) → Result<Json<Matches>, ToolError>
method [source]
method [source]
search_panes

Find which panes are showing something.

show_option

show_option ( self , Parameters(OptionArgs { name, scope, target, .. }) : Parameters<OptionArgs> ) → Result<Json<OptionValue>, ToolError>
method [source]
method [source]
show_option

Read a tmux option.

show_environment

show_environment ( self , Parameters(ShowEnvironmentArgs { session }) : Parameters<ShowEnvironmentArgs> ) → Result<Json<Environment>, ToolError>
method [source]
method [source]
show_environment

Read the names in a tmux environment, and the values the operator allowed.

show_hooks

show_hooks ( self , Parameters(ShowHooksArgs { session }) : Parameters<ShowHooksArgs> ) → Result<Json<Hooks>, ToolError>
method [source]
method [source]
show_hooks

Read the hooks tmux runs on its own events.

run_command

run_command ( self , Parameters(RunCommandArgs { pane, command, seconds, suppress_history, }) : Parameters<RunCommandArgs> , cancelled : tokio_util::sync::CancellationToken , reporter : Reporter ) → Result<Json<RunView>, ToolError>
method [source]
method [source]
run_command

Run a command in a pane and report how it went.

wait_for_text

wait_for_text ( self , Parameters(WaitForTextArgs { pane, patterns, stop, regex, match_case, seconds, }) : Parameters<WaitForTextArgs> , cancelled : tokio_util::sync::CancellationToken , reporter : Reporter ) → Result<Json<WaitView>, ToolError>
method [source]
method [source]
wait_for_text

Wait until a pane writes something a caller is looking for.

Discussed in Rust MCP topics

capture_since

capture_since ( self , Parameters(CaptureSinceArgs { pane, cursor }) : Parameters<CaptureSinceArgs> ) → Result<Json<Since>, ToolError>
method [source]
method [source]
capture_since

Report what a pane has written since the last look.

Discussed in Rust MCP topics

wait_for_channel

wait_for_channel ( self , Parameters(ChannelArgs { channel, seconds }) : Parameters<ChannelArgs> ) → Result<Json<ChannelWait>, ToolError>
method [source]
method [source]
wait_for_channel

Wait for a wait-for channel to be signalled.

Esc

Type to search.