Skip to main content
Glama
SSH MCP Server

SSH MCP Server

by icdmkg2

ssh_exec

Execute shell commands on a connected SSH host and return stdout, stderr, exit code, and duration for remote command execution and diagnostics.

Instructions

Execute a shell command on a connected SSH host and return stdout, stderr, exit code, and duration.

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
envNoExtra environment variables for the command
ptyNoAllocate a pseudo-TTY (merges stdout/stderr, useful for sudo)
commandYesShell command to execute
timeoutNoCommand timeout in ms (default 30000)
connectionIdYesConnection ID from ssh_connect

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations, the description carries the full disclosure burden, and it does state the return shape (stdout, stderr, exit code, duration). It does not disclose that arbitrary commands run with the connection's privileges, whether execution is blocking, or what happens on timeout/disconnect — material omissions for a potentially destructive operation.

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?

A single front-loaded sentence that states the action, the target, and the return value with zero redundant wording.

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?

No output schema exists, and the description compensates by enumerating the four return fields. For a 5-parameter tool with fully documented schema, the remaining gap is behavioral (privilege level, blocking/timeout semantics) rather than structural.

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 connectionId, command, env, pty, and timeout are already documented in the schema. The description adds no parameter-level meaning beyond that, 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?

The description gives a specific verb and resource ("Execute a shell command on a connected SSH host") plus the return payload, which clearly separates it from the sftp_* file tools and from ssh_connect. It stops short of naming a sibling explicitly, but the operation is unambiguous.

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?

"On a connected SSH host" implies the prerequisite that ssh_connect must run first, which is useful usage context. However, there is no explicit guidance on when to prefer sftp_* tools for file operations or what to do when the connection is not established.

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