MCPpre-alphaTools

Choose documentation 3

stable

Current version

stable
English

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

tool MCPstable

send_keys

Send keys (commands or text) to a tmux pane.

Use this for raw interactive input: TUI keys, control sequences, partial shell input, or persistent shell state. Use send_keys_batch when you need several ordered raw-input operations.

For authored shell commands that need completion, exit status, or captured output, use run_command instead. For custom completion outside that shape, compose tmux wait-for -S <channel> into the shell command and call wait_for_channel. For repeated observation after input, prefer capture_since; reserve wait_for_text for output the agent does not author.

Do NOT call capture_pane immediately — both the read and the pattern-match paths race the pane’s PTY draw.

MCP request method
tools/call Send send_keys as the tool name, with the arguments below.

Arguments#

No other arguments are accepted.

Result#

Returns object

Annotations#

destructiveHint
true
idempotentHint
false
openWorldHint
true
readOnlyHint
false

Protocol data#

Use the complete advertised contract for validation and client integration.

Input schema
{
"additionalProperties": false,
"properties": {
"enter": {
"default": true,
"description": "Whether to press Enter after sending keys. Default True.",
"type": "boolean"
},
"keys": {
"description": "The keys or text to send.",
"type": "string"
},
"literal": {
"default": false,
"description": "Whether to send keys literally (no tmux interpretation). Default False.",
"type": "boolean"
},
"pane_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Pane ID (e.g. '%1')."
},
"session_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Session ID (e.g. '$1') for pane resolution."
},
"session_name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Session name for pane resolution."
},
"socket_name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "tmux socket name."
},
"suppress_history": {
"default": false,
"description": "Suppress shell history by prepending a space; only effective where\nthe shell ignores space-prefixed commands. Default False.",
"type": "boolean"
},
"window_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Window ID for pane resolution."
}
},
"required": [
"keys"
],
"type": "object"
}
Output schema
{
"properties": {
"result": {
"type": "string"
}
},
"required": [
"result"
],
"type": "object",
"x-fastmcp-wrap-result": true
}
Esc

Type to search.

Reference preview Open reference