Skip to main content
Glama
pmboxbiz

mcp-ssh-live

by pmboxbiz

ssh_spawn

Run shell commands on a remote host in the background, get an instant job ID, and stream output line-by-line via ssh_tail. Ideal for builds, deploys, and log tails requiring real-time monitoring.

Instructions

Start a shell command on the remote host IN THE BACKGROUND and return a short job_id immediately (<100 ms). Use ssh_tail to stream output line-by-line while the job runs.

WHEN TO USE ssh_spawn:

  • You need real-time output in chat (builds, deploys, log tails).

  • The command takes more than ~60s but you WILL stay connected.

WARNING — PROCESS DIES ON DISCONNECT: ssh_spawn ties the remote process to the MCP server's SSH channel. If the MCP server restarts, Zed closes, or the connection drops — the remote process receives SIGHUP and dies. Do NOT use ssh_spawn for tasks that must survive a disconnect (multi-hour training runs, overnight parsers, etc.).

FOR TASKS THAT MUST SURVIVE DISCONNECT — use ssh_exec with nohup or screen instead: ssh_exec('nohup python -u train.py > /tmp/train.log 2>&1 &') ssh_exec('screen -dmS myjob bash -c "python train.py"') Then check progress with: ssh_exec('tail -n 50 /tmp/train.log') ssh_exec('screen -r myjob')

BUFFERING GOTCHA: many programs block-buffer stdout when stdin is not a TTY, so you see nothing until exit. Fix: pass pty=True, or use 'python -u' / PYTHONUNBUFFERED=1 / 'stdbuf -oL'. pty=True merges stderr into stdout.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
commandYesThe shell fragment to run on the remote. Passed to an outer ``bash -c`` with a PID-capture prelude, then ``exec``'d into an inner ``bash -c "<command>"`` so your shell metacharacters (``|``, ``&&``, ``$VAR``, redirects) work normally.
hostNoAlias of the configured host, or its raw address. If omitted, the server's default host is used.
cwdNoRemote working directory (``cd`` before running).
envNoAdditional environment variables for the remote process. Names must match ``[A-Za-z_][A-Za-z0-9_]*`` (safe env name regex, enforced by the wrapper builder).
ptyNoAllocate a remote pseudo-TTY. Needed for interactive programs (``sudo -S``, REPLs, ``passwd``) and for line-buffered output from programs that only flush to a TTY. Note: with pty=True the remote kernel merges stderr into stdout, and CRLF line endings may appear in the buffer (we strip the \r).
labelNoOptional human-readable tag for ``ssh_list_jobs``. Useful when the LLM spawns several jobs on the same host and needs a memorable handle ("nightly-parser", "log-follow", …).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

With no annotations provided, the description carries the full burden. It transparently warns that the remote process dies on disconnect (SIGHUP), explains the buffering gotcha and its fix (pty=True, python -u), and clarifies pty behavior (stderr merge, CRLF stripping). All behavioral traits are disclosed.

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 headers and bullet points, front-loading the core purpose. It is comprehensive but slightly lengthy; however, every section adds value (usage, warning, alternatives, buffering tip). Minor conciseness improvements could be made, but overall it's effective.

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?

The description covers all necessary aspects: core functionality, when to use vs avoid, lifecycle behavior, parameter context via schema, and output via schema. It is fully complete for an agent to correctly select and invoke this tool, given the sibling set and complexity.

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% with detailed descriptions per parameter. The tool description adds context beyond the schema, notably the buffering gotcha and when to use pty. It does not restate all param details but provides practical guidance that enhances understanding.

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 starts a remote shell command in the background and returns a job ID immediately. It distinguishes from siblings like ssh_exec and emphasizes background execution with low latency, making the purpose unmistakable.

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 description explicitly outlines when to use ssh_spawn (real-time output for long-running commands) and provides a warning against use for disconnect-survival tasks, with concrete alternatives using ssh_exec with nohup or screen. This is exemplary usage guidance.

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