Skip to main content
Glama
ssh-sftp-mcp

ssh-sftp-mcp

by endjoker

Run a short remote command

ssh_exec
Destructive

Run non-interactive commands on a remote SSH host and return stdout, stderr, and the exit code, with explicit timeout and truncation reporting.

Instructions

Runs a non-interactive command on the remote host (no PTY, no stdin) and returns stdout/stderr/exit code. The command has the full shell privileges of that SSH account and may cause any remote side effect; the server does not block commands by keyword. Output is byte-capped; timeouts and truncation are reported explicitly. Use ssh_exec_start for long-running work.

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": {
      "connectionId": "<connectionId>",
      "command": "<command>"
    },
    "name": "ssh_exec"
  }
}

Input Schema

NameRequiredDescriptionDefault
commandYesCommand text passed verbatim to the remote shell
timeoutMsNo
connectionIdYes
outputFormatNotext puts content in text, structured puts it in structuredContent, both keeps the legacy shapetext

Output Schema

NameRequiredDescriptionDefault
signalYes
stderrNo
stdoutNo
exitCodeYes
timedOutYes
truncatedYes
durationMsYes
stderrBytesYes
stdoutBytesYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior5/5

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

Annotations already declare destructiveHint/openWorldHint/readOnlyHint=false, and the description still adds real context: no PTY and no stdin means interactive prompts will hang or fail, the command inherits full shell privileges of the account, no keyword filtering is applied, and output is byte-capped with timeouts and truncation reported explicitly. That is exactly the risk and failure-mode information an agent needs before calling a destructive shell tool.

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

Conciseness5/5

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

Three tight sentences, front-loaded with what runs and what comes back, then risk, then the alternative tool. No filler and no restatement of the title.

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?

With an output schema present, the description need not explain return values, yet it still summarizes them usefully. The remaining gap is the undocumented connectionId/timeoutMs parameters and the absence of a pointer to ssh_connect for obtaining a connection, which matters for a destructive remote-execution tool.

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 50%: command and outputFormat are documented in the schema, while connectionId and timeoutMs are not. The description mentions that timeouts are reported but never explains timeoutMs semantics or where connectionId comes from, so it adds only marginal meaning beyond the schema. Baseline 3 is appropriate.

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 ("Runs a non-interactive command on the remote host") and immediately qualifies execution mode (no PTY, no stdin) plus return payload (stdout/stderr/exit code). It also names the sibling it is not for long work, so an agent can separate ssh_exec from ssh_exec_start 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 Guidelines4/5

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

"Use ssh_exec_start for long-running work" is an explicit routing rule to the right alternative. It does not cover other prerequisites, such as acquiring a connectionId via ssh_connect/ssh_connection_list or what to do when output is truncated beyond re-running.

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