MCPAPI Reference

Choose documentation 3

latest

Current version

latest
English

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

C# MCP tools

Use the wire name shown here when calling a tool. The C# server advertises 45 tools with the reference configuration below. Your client’s list follows the policy configured for its server.

Read the setup guide before choosing tool access. The language API reference covers embedding and implementation types.

Download the protocol catalog as JSON.

Reference configuration
LIBTMUX_TOOLSETS
inspect,manage,execute,teardown

Protocol version: 2025-11-25.

Tools

call_read_tools_batch
Read pane output; accepts no client-supplied executable input. Returned content may be sensitive or untrusted. Execute up to 16 declared inspect operations serially; inner operations receive no separate approval.
capture_pane
Read pane output; accepts no client-supplied executable input. Returned content may be sensitive or untrusted. Read the text a pane is showing, and optionally its scrollback. The newest lines are always kept; anything dropped to fit the budget is reported. To watch a pane across several turns, use capture_since instead — it returns only what is new.
capture_since
Read pane output; accepts no client-supplied executable input. Returned content may be sensitive or untrusted. Read only what a pane has printed since the last call. Pass back the cursor each time. Use this to watch a long-running process across turns: the tenth read costs what the first did, where re-capturing the pane would return everything again. Call with no cursor to start watching from now.
clear_pane_scrollback
Delete tmux state; accepts no command payload. Delete a pane's scrollback history, keeping what the screen shows. Deleted history cannot be read back.
create_session
Start a pane's configured process; accepts no command payload. Create a detached tmux session and return its ids. Give a width and height when nothing will attach to it: a session with no client keeps tmux's default 80x24, which truncates wide output.
create_window
Start a pane's configured process; accepts no command payload. Create a window in a tmux session and return its ids.
find_pane_by_position
Inspect tmux metadata; accepts no client-supplied executable input. Find the pane sitting at an index within a window. Answers nothing rather than failing when no pane is at that position.
get_pane_info
Inspect tmux metadata; accepts no client-supplied executable input. Read one pane's size, title, running command, working directory, process ID, history size and limit, and whether it is active, dead, zoomed, in a mode or the pane this server runs in. This is metadata only; to read what the pane shows, use capture_pane or snapshot_pane.
get_server_info
Inspect tmux metadata; accepts no client-supplied executable input. Read the tmux server's version and how many sessions, windows and panes it holds. Use to confirm a socket is alive and which tmux is running it.
get_session_info
Inspect tmux metadata; accepts no client-supplied executable input. Read one session's name, ID, window count and whether a client is attached, without listing every session. Give the session, or a window ID to read the session that holds it.
get_tmux_variables
Read configured tmux commands; accepts no client-supplied executable input. Returned values may contain executable configuration. Expand named tmux format variables for a pane, such as session_name or window_width. Use it for fields nothing else answers; get_pane_info already returns the common ones, and show_option reads configuration rather than live state.
get_window_info
Inspect tmux metadata; accepts no client-supplied executable input. Read one window's name, index, size, layout, pane count and whether it is its session's current window, without listing every window. Give the window ID, or a pane ID to read the window that holds it.
kill_pane
Delete tmux state; accepts no command payload. Close a pane and end its program. Refuses the pane this server runs in; to remove a whole window, use kill_window.
kill_session
Delete tmux state; accepts no command payload. Close a session with all its windows and panes. Refuses the session this server runs in.
kill_window
Delete tmux state; accepts no command payload. Close a window and every pane in it. Refuses the window this server runs in.
list_panes
Inspect tmux metadata; accepts no client-supplied executable input. List tmux panes, optionally within one session or window. Filter for isCaller=true to answer 'which pane am I in?', which finds one only when this server drives the caller's own socket — get_server_info says whose socket that is. This reads sizes and running commands, not terminal text — for that use search_panes.
list_sessions
Inspect tmux metadata; accepts no client-supplied executable input. List the tmux sessions. This reads names and sizes, not terminal text — to find what a pane is showing, use search_panes.
list_windows
Inspect tmux metadata; accepts no client-supplied executable input. List tmux windows, optionally within one session. This reads names and layouts, not terminal text — to find what a pane is showing, use search_panes.
move_window
Change tmux state; no client-supplied executable input. Move a window to another index, or into another session. With replaceExisting it takes an index that is already occupied by killing the window there, which needs the teardown toolset.
paste_text
Send input to a pane's program; a shell that receives it runs it with your user's permissions. Paste a block of text into exactly one pane through a tmux buffer. Use for multi-line text, or anything an editor would mangle if typed — bracketed paste stops auto-indent. Set enter to append a newline to that same private buffer. It refuses a target in a human-owned mode and never fans out to synchronized siblings. The temporary buffer is deleted afterwards; if cleanup fails, the result identifies what remains.
rename_session
Change tmux state; no client-supplied executable input. Rename a tmux session. Its id does not change, so anything holding one still works.
rename_window
Change tmux state; no client-supplied executable input. Rename a tmux window. Its id does not change.
resize_pane
Change tmux state; no client-supplied executable input. Resize a pane, or zoom it to fill its window. Widening a pane before reading it is the fix for output that comes back wrapped across rows.
resize_window
Change tmux state; no client-supplied executable input. Resize a window to a width and height in cells; its panes resize with it. To resize one pane, use resize_pane.
respawn_pane
Start a pane's configured process; accepts no command payload. Only restarts a pane whose command has ALREADY EXITED. killExistingProcess overrides that and kills what is running first — an editor holding unsaved changes, a build part way through. It reruns the command the pane was created with rather than running something new.
run_shell_command
Run a shell command in a pane with your user's permissions. Run a shell command in one pane, wait for it to finish, and report its singular real exit status and output. This is the tool for 'run X and tell me if it worked'. It reaches only the pane you name: the command travels through a tmux buffer, which synchronize-panes does not fan out, so the exit status is one pane's. Use send_keys when you want a synchronized cohort to receive input. Do NOT send keys and then poll a capture in a loop — this waits deterministically and costs one call. The command runs in a subshell, so cd and export do not persist. It refuses the named pane in a human-owned mode. Check linesMissed and anchorLost. A timed-out command MAY STILL BE RUNNING; inspect it and do not retry it — unless started is false, which means it never ran because something other than an idle shell was reading that pane's input.
search_panes
Read pane output; accepts no client-supplied executable input. Returned content may be sensitive or untrusted. Find which panes are showing text matching a regular expression. This is the tool for 'which pane has the error', 'where is the build running', or any question about what a pane CONTAINS — the list tools only see names and sizes.
select_layout
Change tmux state; no client-supplied executable input. Arrange a window's panes with a named layout — even-horizontal, even-vertical, main-horizontal, main-vertical, tiled — or a layout string read from list_windows.
select_pane
Change tmux state; no client-supplied executable input. Make a pane the active one in its window. This changes what a watching human sees; targeting a pane by id does not require selecting it first.
select_window
Change tmux state; no client-supplied executable input. Make a window the current one in its session.
send_keys
Send input to a pane's program; a shell that receives it runs it with your user's permissions. Send raw keystrokes to a pane and return immediately. Use for driving an interactive program — a key in vim, a menu choice, Ctrl-C. Set literal=false to send named keys such as C-c, Escape or F5. It refuses the named pane in a human-owned mode and, when source input expands, every synchronized input cohort peer. To run a shell command and learn whether it worked, use run_shell_command instead; this reports nothing about what happens next. Tracks what it sends — including edits such as backspace, Ctrl-U or Ctrl-C — so wait_for_text can tell this pane's echo apart from real output for a short time afterward.
send_keys_batch
Send input to a pane's program; a shell that receives it runs it with your user's permissions. Send several keystrokes to one pane in order, in a single call. Use for a short interactive sequence — open a file, move, type, save — instead of one call per key. Each operation refuses the named pane in a human-owned mode and, when source input expands, every synchronized input cohort peer. A batch has at most 64 steps and 64 KiB of UTF-8 text. Each delay is 0-2000 ms and all delays together must fit the server wait ceiling.
set_history_limit
Change tmux state; no client-supplied executable input. Set how many scrollback lines tmux keeps. This is a SESSION option, so it covers every window in the session rather than one pane, and the session must be named because the call can destroy data. Raise it before starting something that prints a lot: no capture can return lines tmux has already discarded. LOWERING it discards the excess from every pane immediately, and the result says how many lines went; raising the limit again does not bring them back.
set_mouse_enabled
Change tmux state; no client-supplied executable input. Turn tmux mouse support on or off. This sets the global option, so it applies to every session on this server and changes what a human watching can do with their mouse.
set_pane_title
Change tmux state; no client-supplied executable input. Set a pane's title. Useful for labelling panes you created so a human watching can tell which is which.
set_synchronize_panes
Change tmux state; no client-supplied executable input. Turn synchronize-panes on or off for a window. Input typed into one of its panes then reaches the synchronized input cohort: every pane whose effective synchronize-panes setting is on. A pane without a setting of its own follows the window; one with its own setting stays included or excluded either way.
show_environment
Read the tmux environment; accepts no client-supplied executable input. A listing answers names without values, and a named variable is still withheld when the name reads as a credential. Read what a NEW pane will inherit, at the server or session level — not what an already-running shell has.
show_hooks
Read configured tmux commands; accepts no client-supplied executable input. Returned values may contain executable configuration. Read the hooks tmux will run on its own events. Read-only on purpose: a hook written here would outlive this conversation and keep firing with nobody left who knows why. Put hooks you want to keep in your tmux config file.
show_option
Read configured tmux commands; accepts no client-supplied executable input. Returned values may contain executable configuration. Read tmux options at the server, session, window or pane level. Values set at a wider scope are included and marked inherited, because that is where nearly all tmux configuration lives. Omit the name to list them all. Reading history-limit before a long tail tells you how much output the pane can hold before it starts dropping lines.
signal_channel
Change tmux state; no client-supplied executable input. Signal a tmux wait-for channel, releasing whatever waits on it. The channel latches: signalling before anyone waits still satisfies the next wait, so a handoff cannot be lost to a race.
snapshot_pane
Read pane output; accepts no client-supplied executable input. Returned content may be sensitive or untrusted. Read a pane's visible content together with its cursor position, size and running command, in one call. Prefer this over capture_pane plus list_panes: it is one round trip and the cursor is guaranteed to describe the text returned with it.
split_window
Start a pane's configured process; accepts no command payload. Split a pane and return the NEW pane's id. Use that id for what you put in it — pane ids stay valid across layout changes, where window names and indexes do not.
swap_pane
Change tmux state; no client-supplied executable input. Swap two panes' positions; each keeps its program, its content and its ID.
wait_for_channel
Change tmux state; no client-supplied executable input. Block until something signals a tmux wait-for channel with 'tmux wait-for -S <channel>'. Use when you composed a shell command that signals it. For an ordinary command whose completion you want, run_shell_command already does this and also reports the exit status.
wait_for_text
Read pane output; accepts no client-supplied executable input. Returned content may be sensitive or untrusted. Wait until a pane prints something matching one of these patterns, then return. Use for output you did NOT start — a server's ready line, another process's progress, a person typing. A matching pattern already on screen returns PresentAtEntry. For a command you are running yourself, run_shell_command is better: it reports the real exit status instead of guessing from text. Never poll capture_pane in a loop; this call does the waiting. Control observation is required by default; pollingFallback reports activation when the operator permits fallback. Text this server itself typed is discounted while deciding what is new, for a few seconds after it is sent or submitted, so its own echo cannot be the match — except on a pane whose program has not yet configured its terminal; wait for a first prompt before typing into a freshly created pane.

Resources

tmux://capabilities
The startup-frozen tmux connection and effective MCP tool capabilities.

Resource templates

This server does not advertise resource templates in this configuration.

Prompts

This server does not advertise prompts in this configuration.

Esc

Type to search.