Skip to main content
Glama
pmboxbiz

mcp-ssh-live

by pmboxbiz

ssh_send_stdin

Send text or control characters to stdin of a spawned SSH job, with options to append newline or close stdin. Use for password prompts, REPL commands, or signaling processes.

Instructions

Write bytes to the stdin of a running job (one spawned by ssh_spawn). Used for password prompts (sudo -S -p ''), REPL input (python, node), and any interactive CLI that expects keystrokes.

By default a trailing '\n' is appended so the remote program sees a complete line (this is what 'sudo -S' and most line-based REPLs need). Set newline=False to send raw bytes without the terminator — useful for control characters (e.g. data='\x03' to send ^C to a pty-mode job, or data='\x04' for ^D / EOF).

Set close_stdin=True to close the remote's stdin AFTER the write, which signals EOF to programs like 'cat', 'wc', 'sort'. Leaving it open (default) lets you make more writes to the same job.

IMPORTANT: for password input, pair this with ssh_spawn(pty=True) AND the command 'sudo -S -p ""'. Without pty=True, sudo refuses to read the password from a pipe on most distros. Without the -p "" flag, sudo writes its prompt to stdout, which mixes into ssh_tail output.

Payload size is capped at 64 KiB per call. For larger input use ssh_upload to place a file on disk, then have the command read from it.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
job_idYesThe id returned by ``ssh_spawn``.
dataYesThe text to send, UTF-8 encoded on the wire. Can be empty; an empty ``data`` with ``newline=True`` sends just a single ``\n`` (useful for "press Enter" prompts). Control characters are passed verbatim, so ``"\x03"`` sends ^C to a pty-mode job's line discipline.
newlineNoWhen True (default), append a ``\n`` to ``data`` unless it already ends with one. When False, send exactly the bytes in ``data`` — useful for control characters (``\x03`` for ^C, ``\x04`` for ^D) and for multi-write sequences that assemble a line progressively.
close_stdinNoWhen True, close the remote's stdin channel AFTER the write completes. Signals EOF to the remote program. When False (default), stdin stays open and you can make subsequent ssh_send_stdin calls.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Discloses all key behaviors: trailing newline default, raw bytes with newline=False, EOF via close_stdin, 64 KiB payload cap. No annotations exist, so description fully covers behavioral disclosure.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Well-structured with paragraphs and bullets, but slightly long (multiple use-case examples). However, front-loaded with purpose and each sentence adds value, so not overly verbose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Covers prerequisites, alternatives, constraints, and behavior exhaustively. Output schema exists, so return values need not be detailed. No gaps given tool's complexity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, but description adds significant context: explains newline=False for control characters, close_stdin for EOF, and data for empty sends. Goes well beyond schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool 'write[s] bytes to the stdin of a running job' and lists specific use cases (password prompts, REPL input, interactive CLI), distinguishing it from sibling tools like ssh_exec or ssh_upload.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly tells when to use (e.g., for interactive input) and when not to (for large input, use ssh_upload). Provides crucial pairing instructions for password input (pty=True) and flags for sudo.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/pmboxbiz/mcp-ssh-live'

If you have feedback or need assistance with the MCP directory API, please join our Discord server