iflow-mcp_yiwenlu66-piloty

v0.3.0
iflow-mcp_yiwenlu66-piloty Checked 1 day ago Published 9 months ago

PiloTY: AI pilot for PTY operations via MCP - enables AI agents to control interactive terminals like a human.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

create_session

Create a PTY session with an explicit working directory. MCP does not provide a standard field for the client's current working directory. The caller must provide `cwd` explicitly.

ParameterTypeDescription
cwd *string
session_id *string
prompt_regex
tag

run

Execute a command in a stateful PTY session. Requires an existing session created via `create_session(session_id, cwd)`. Quiescence: reads until the PTY is silent for PILOTY_QUIESCENCE_MS (default 1000ms), or until `timeout` seconds elapse. Common SSH pattern: - create_session(session_id, cwd) - run(session_id, "ssh host", timeout=...) - expect_prompt(session_id, timeout=...) # wait for remote shell prompt

ParameterTypeDescription
command *string
session_id *string
strip_ansiboolean
timeoutnumber

send_input

Send raw input to a stateful terminal session (no newline added). Requires an existing session created via `create_session(session_id, cwd)`.

ParameterTypeDescription
session_id *string
text *string
strip_ansiboolean
timeoutnumber

send_password

Send a password plus newline. Requires an existing session created via `create_session(session_id, cwd)`. Security model: - Forces terminal echo off for this send operation (`echo=False`). - Disables transcript logging for this send operation (`log=False`). - Returns `output` as the literal string "[password sent]".

ParameterTypeDescription
password *string
session_id *string
timeoutnumber

send_control

Send a control character to the terminal. Requires an existing session created via `create_session(session_id, cwd)`. Keys: - `c` sends Ctrl+C, commonly used to interrupt. - `d` sends Ctrl+D (EOF in many programs). - `z` sends Ctrl+Z (job control suspend). - `l` sends Ctrl+L (clear screen in many shells). - `[` or `escape` sends ESC. Returns the same shape as `run()`.

ParameterTypeDescription
key *string
session_id *string
strip_ansiboolean
timeoutnumber

poll_output

Wait for new output without sending input. Requires an existing session created via `create_session(session_id, cwd)`. Quiescence: returns immediately once any output is observed and the PTY is silent for PILOTY_QUIESCENCE_MS (default 1000ms). Returns empty output only when `timeout` elapses without any output. If you need to wait for a shell prompt (e.g., after SSH), use expect_prompt().

ParameterTypeDescription
session_id *string
strip_ansiboolean
timeoutnumber

get_screen

Get the current VT100-rendered terminal screen snapshot. Requires an existing session created via `create_session(session_id, cwd)`.

ParameterTypeDescription
session_id *string

get_scrollback

Get rendered terminal scrollback. Requires an existing session created via `create_session(session_id, cwd)`.

ParameterTypeDescription
session_id *string
linesinteger

clear_scrollback

Clear rendered scrollback history while preserving current screen. Requires an existing session created via `create_session(session_id, cwd)`.

ParameterTypeDescription
session_id *string

expect

Wait for regex match in terminal output/scrollback. Requires an existing session created via `create_session(session_id, cwd)`.

ParameterTypeDescription
pattern *string
session_id *string
strip_ansiboolean
timeoutnumber

expect_prompt

Wait until a shell prompt is detected (READY). Requires an existing session created via `create_session(session_id, cwd)`. Intended for SSH workflows where login banners and prompts may arrive after the initial `run()` returns. This avoids requiring agents to supply a fragile regex like r"[$#] ?$". Typical usage: - create_session(session_id, cwd) - run(session_id, "ssh host", timeout=2) - expect_prompt(session_id, timeout=30) - run(session_id, "cd /var/log", timeout=5) Notes: - This polls output internally; you do not need to call poll_output() i…

ParameterTypeDescription
session_id *string
timeoutnumber

get_metadata

Get metadata for an existing PTY session. Requires an existing session created via `create_session(session_id, cwd)`.

ParameterTypeDescription
session_id *string

list_sessions

configure_session

ParameterTypeDescription
session_id *string
prompt_regex
tag

send_signal

Send an OS signal to the foreground process in a session. Requires an existing session created via `create_session(session_id, cwd)`.

ParameterTypeDescription
session_id *string
signal *string
strip_ansiboolean

transcript

Get the transcript file path for this session.

ParameterTypeDescription
session_id *string

terminate

Terminate a PTY session. Future calls using the same `session_id` are rejected.

ParameterTypeDescription
session_id *string