Skip to main content
Glama
mcp-ssh-persistent

mcp-ssh-persistent

by vivusk

ssh_stream_write

Writes data verbatim to a persistent stream shell, then waits for command completion, an input prompt, or timeout so you can drive interactive SSH sessions and detect when follow-up input is needed.

Instructions

Write data verbatim to a stream shell (include a real newline to press Enter) and wait until the command finishes (shell prompt), an input prompt appears, or wait_ms elapses. Footer: [state: prompt | awaiting_input(sudo|password|confirm) | timeout]; timeout means the command may still run (use ssh_stream_read). Unread output from before the write is reported, not silently dropped.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "stream_id": "<stream_id>",
      "data": "<data>"
    },
    "name": "ssh_stream_write"
  }
}

Input Schema

NameRequiredDescriptionDefault
dataYesData to write, sent as-is; end with a newline character to press Enter
wait_msNoMax wait for completion in ms (default 5000; 0 = do not wait)
stream_idYesStream ID (selects the server shell)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.2.0

TDQS

A4.1/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so well: it discloses blocking/wait semantics, the three possible terminal states, the awaiting_input subtypes (sudo|password|confirm), the meaning of a timeout, and that unread pre-write output is reported rather than dropped. The footer format is described even though no output schema exists.

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?

Front-loaded with the action and its blocking behavior, then the footer semantics. The parentheticals are dense but each conveys distinct operational information; nothing is filler.

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

Completeness4/5

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

For a three-parameter tool with no annotations and no output schema, the description covers wait behavior, return states, timeout consequences, and output-loss risk. Minor gaps remain around error cases and permission/auth requirements beyond the prompt states.

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

Parameters3/5

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

Schema coverage is 100%, so data, wait_ms, and stream_id are already documented; the description mostly restates them (verbatim write, newline to press Enter). It adds no format or edge-case detail beyond the schema, so baseline 3 applies.

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?

States a specific verb and resource ('Write data verbatim to a stream shell') plus the exact blocking condition (prompt, input prompt, or wait_ms). It also names the counterpart tool ssh_stream_read for the timeout case, so an agent can separate streaming writes from streaming reads without opening a schema.

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

Usage Guidelines3/5

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

Gives concrete guidance for one branch: on a timeout footer the command may still be running, so use ssh_stream_read. It does not say when to prefer this over ssh_exec or ssh_write_remote_file, so the selection guidance is only partial.

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