Skip to main content
Glama
ssh-remote-mcp
by wcbup

Execute Remote Command

ssh_exec
Destructive

Run a command synchronously on a remote Unix or Windows host over SSH with an explicit working directory, timeout, and output cap. Aborts cleanly if the directory is missing and kills the process tree on timeout or cancellation.

Instructions

Execute a command synchronously on a remote Unix (bash/zsh/sh) or Windows (pwsh/powershell) host. Requires an explicit cwd (absolute path or '~'); aborts cleanly if cwd does not exist. Kills the remote process tree on timeout or cancellation.

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

Input Schema

NameRequiredDescriptionDefault
cwdYesRequired remote working directory: explicit absolute path (e.g. /srv/app or C:\Services\app) or '~' for system-wide commands. Command aborts if cwd does not exist.
shellNoOptional shell override for this single command
targetYesSSH target as configured host alias, host, user@host, user@host:port, or [ipv6]:port. Never include remote paths in target.
commandYesCommand to run in the remote shell
timeout_secondsNoTimeout in seconds (default: 60, max: 600)
max_output_bytesNoMax stdout/stderr bytes captured per stream (default: 262144)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already flag destructive/openWorld/not-idempotent, and the description adds real behavior beyond them: execution is blocking, a missing cwd aborts before any remote work, and timeouts or cancellation kill the remote process tree. It does not cover auth/session prerequisites or what happens when output exceeds max_output_bytes.

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 front-loaded sentences, each carrying distinct information: what runs where, the cwd precondition, and the kill-on-timeout semantics. No filler or repetition.

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 6-parameter destructive tool with no output schema, the description covers execution mode, shell families, cwd semantics, and cancellation behavior, while annotations carry the safety profile. It stops short of stating session prerequisites or return/truncation behavior, which is the main remaining gap.

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 every parameter including cwd's '~' convention and timeout bounds is already documented in the schema. The description only restates the cwd requirement and adds no new syntax or format meaning, so the baseline of 3 applies.

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

Purpose4/5

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

States a specific verb and resource ('Execute a command synchronously') plus the platforms/shells supported, which implicitly separates it from the background-execution siblings. It never names a sibling (e.g., ssh_bg_start for long-running work), so the differentiation is inferred rather than explicit.

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?

Provides a hard precondition ('Requires an explicit cwd; aborts cleanly if cwd does not exist') and the word 'synchronously' hints at short-lived commands, but there is no explicit when-to-use vs. ssh_bg_start/ssh_bg_status guidance and no mention of whether ssh_connect must run first.

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