Skip to main content
Glama
mcp-ssh-persistent

mcp-ssh-persistent

by vivusk

ssh_sudo_auth

Answer a pending sudo password prompt in an SSH stream using the password stored in the OS credential store; only sudo prompts are accepted and no secret is passed manually.

Instructions

Answer a pending sudo password prompt in a stream with the password stored in the OS credential store (Windows Credential Manager / macOS Keychain / Linux Secret Service); never pass it yourself. Only acts when the stream shows exactly "[sudo] password for :" or the sudo-rs prompt "[sudo: authenticate] Password:" (state awaiting_input(sudo)); other prompts (ssh, su, mysql, Password:) are refused and nothing is sent. Call it right after a command you typed that starts with sudo. Waits like ssh_stream_write.

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>"
    },
    "name": "ssh_sudo_auth"
  }
}

Input Schema

NameRequiredDescriptionDefault
wait_msNoMax wait for completion after sending in ms (default 5000)
stream_idYesStream ID showing awaiting_input(sudo)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.2.0

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations, the description carries the whole burden and does it well: it discloses that the secret comes from the OS credential store rather than the caller, that matching is exact-string against two known prompt formats, that non-matching prompts cause nothing to be sent, and that the call blocks comparably to ssh_stream_write. It stops short of describing what a success or failure response looks like, or what happens on an incorrect stored password, which keeps it below a 5.

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 core action, then the gating conditions, then the timing hint; no sentence is filler. It is dense with nested parentheticals and quoted prompt strings, which slightly hurts scannability, but the information density justifies the length.

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 two-parameter, no-output-schema tool that writes a secret into a live stream, the definition covers the risky parts: secret sourcing, exact prompt gating, refusal behavior, and blocking semantics. The notable gap is outcome reporting — whether a wrong password or a stale stream produces an error, and how the agent should proceed after a refusal.

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 description coverage is 100%, so both stream_id and wait_ms are already documented in the schema, and the baseline of 3 applies. The description adds only a loose hint that the call waits like ssh_stream_write, which implies the wait_ms behavior but does not define it beyond the schema's 'Max wait for completion after sending'.

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: answer a pending sudo password prompt in a stream using the OS credential store. It also explicitly separates itself from password-supplying tools by saying 'never pass it yourself,' so an agent can distinguish it from ssh_stream_write without opening either schema.

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?

Gives an explicit trigger ('Call it right after a command you typed that starts with sudo'), an explicit precondition (stream in state awaiting_input(sudo) with one of two exact prompt strings), and explicit exclusions (ssh, su, mysql, Password: prompts are refused and nothing is sent). This is the full when/when-not/alternative picture.

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