Skip to main content
Glama
MCP SSH Manager

MCP SSH Manager

by bvisible

ssh_execute

Runs shell commands over SSH on configured servers, returning stdout, stderr, and exit code; use background mode for long-running jobs.

Instructions

Runs a shell command over SSH on a named configured server and returns stdout, stderr, and exit code. Mutates remote state depending on the command; not read-only. Expands command aliases before running. Uses the cwd parameter or, if omitted, the server configured default directory; adapts syntax for Linux versus Windows PowerShell targets. Timeout defaults to 120000 ms and is capped at 300000 ms. Under readonly mode destructive commands like rm or dd are refused; under restricted mode the command must match allow patterns. Output is truncated when very large. For a job that outlives the timeout (a training run, a long build) set background to true instead of using nohup yourself: it starts the command detached and returns at once with its pid and the log file it writes to; read that file with ssh_tail (follow: false) and check or stop the job with ssh_process_manager.

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": {
      "server": "<server>",
      "command": "<command>"
    },
    "name": "ssh_execute"
  }
}

Input Schema

NameRequiredDescriptionDefault
cwdNoWorking directory (optional, uses default if configured)
serverYesServer name from configuration
commandYesCommand to execute
timeoutNoCommand timeout in milliseconds (default: 120000, max: 300000)
backgroundNoStart the command detached and return at once with { pid, logFile } instead of waiting for it; the timeout does not apply. For long jobs; not available on Windows targets.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv4.2.0
    • addedInput schema / properties / background
      Added value: +{
      +  "description": "Start the command detached and return at once with { pid, logFile } instead of waiting for it; the timeout does not apply. For long jobs; not available on Windows targets.",
      +  "type": "boolean"
      +}
  2. Changed1 schema field changedv3.8.5
    • removedInput schema / additionalProperties
      Removed value: -false
  3. Changed1 schema field changedv3.1.3
    • changedInput schema / properties / timeout / description
      Previous value: -"Command timeout in milliseconds (default: 30000)"New value: +"Command timeout in milliseconds (default: 120000, max: 300000)"
  4. Changed1 schema field changedv1.0.0
    • addedInput schema / properties / timeout
      Added value: +{
      +  "description": "Command timeout in milliseconds (default: 30000)",
      +  "type": "number"
      +}
  5. First observed

TDQS

A4.8/5.0
Behavior5/5

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

With no annotations supplied, the description carries the full burden and does so: it declares the tool mutates remote state and is not read-only, discloses alias expansion, cwd fallback, Linux vs Windows syntax adaptation, timeout default/cap, output truncation, and the two permission modes that gate execution.

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 purpose and safety posture, then constraints, then the long-job workflow. Dense but every clause carries distinct operational information; the background sentence is long but earns its length by replacing a common misuse (nohup).

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?

No output schema exists, yet the description states the return shape for both sync (stdout, stderr, exit code) and background (pid, logFile) modes, plus truncation and refusal conditions. Nothing an agent needs to invoke it correctly is missing.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3. The description still adds value by explaining the interaction between background and timeout ('the timeout does not apply') and by describing the downstream workflow for the returned pid and log file, which the schema only names.

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?

Opens with a specific verb+resource ('Runs a shell command over SSH on a named configured server') and immediately names the return payload (stdout, stderr, exit code), which cleanly separates it from siblings like ssh_execute_sudo or ssh_execute_group.

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 explicit routing: for long jobs set background instead of nohup, read the log with ssh_tail (follow: false), and check/stop with ssh_process_manager. It also states the conditions under which commands are refused (readonly mode, restricted-mode allow patterns), so an agent knows when this call will fail rather than succeed.

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