Skip to main content
Glama
pmboxbiz

mcp-ssh-live

by pmboxbiz

ssh_exec

Run shell commands on remote servers and capture full output. Supports timeout and background tasks that survive disconnects.

Instructions

Run a shell command on the remote host and return its full stdout/stderr/exit status. Blocks until the command finishes or the wall-clock timeout expires (SIGTERM then SIGKILL).

WHEN TO USE ssh_exec:

  • Short commands that finish in under ~60s.

  • Fire-and-forget background tasks that must SURVIVE a disconnect (use nohup or screen so the process keeps running even if the MCP server restarts or Zed closes).

SURVIVING DISCONNECT — nohup pattern: ssh_exec('nohup python -u train.py > /tmp/train.log 2>&1 &')

process keeps running after disconnect; check later with:

ssh_exec('tail -n 50 /tmp/train.log') ssh_exec('ps aux | grep train.py')

SURVIVING DISCONNECT — screen pattern: ssh_exec('screen -dmS myjob bash -c "python train.py > /tmp/out.log 2>&1"')

reattach later: screen -r myjob

WARNING: ssh_spawn ties the remote process to the MCP channel — it dies on disconnect. Use ssh_exec+nohup/screen for tasks that must outlive the current session.

For real-time streaming output of a command you will watch to completion without disconnecting, use ssh_spawn + ssh_tail instead.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
commandYesThe shell fragment to run on the remote. Passed to ``bash -c`` after a PID-capture prelude; your own shell metacharacters (``|``, ``&&``, ``$VAR``, etc.) work normally.
hostNoAlias of the configured host, or its raw address. If omitted, the server's ``default_host`` is used. When only a single host is configured, this argument is optional.
timeout_msNoWall-clock budget. On overrun the remote process receives SIGTERM, then (after 5 s grace) SIGKILL. Set to 0 or a negative number to disable.
cwdNoRemote working directory (``cd`` before running).
envNoAdditional environment variables for the remote process. Names must match ``[A-Za-z_][A-Za-z0-9_]*``.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

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

With no annotations, the description carries the full burden. It discloses blocking behavior, timeout handling with SIGTERM/SIGKILL, and disconnect survival patterns. However, it could more explicitly state that without nohup/screen, the process is killed on disconnect (though implied). Overall, adds significant value beyond the schema.

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?

The description is well-structured with bold headings, but slightly lengthy. It is front-loaded with purpose, then usage, then patterns. Every sentence adds value, but could be trimmed slightly. Still, it is concise enough and well-organized.

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?

Given the output schema exists (not shown), the description need not cover return values. It covers purpose, parameter details, behavior, and usage patterns comprehensively. With 5 parameters, it provides sufficient context for correct invocation, including patterns for common use cases like surviving disconnect.

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 description coverage is 100%, so baseline is 3. The description adds context for the 'command' parameter (bash -c) and 'timeout_ms' (signal details), enhancing understanding beyond the schema. The 'host' and 'env' descriptions are adequate. This extra context justifies a 4.

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?

The description clearly states the tool's purpose: 'Run a shell command on the remote host and return its full stdout/stderr/exit status.' It distinguishes itself from siblings like ssh_spawn and ssh_tail by specifying when to use each, which is explicit and helpful.

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?

The 'WHEN TO USE ssh_exec' section provides explicit guidance: short commands under 60s and fire-and-forget tasks that must survive disconnect. It contrasts with ssh_spawn for streaming and warns about disconnect behavior, including concrete nohup/screen patterns. This directly helps the agent choose correctly.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/pmboxbiz/mcp-ssh-live'

If you have feedback or need assistance with the MCP directory API, please join our Discord server