Skip to main content
Glama
ssh-sftp-mcp

ssh-sftp-mcp

by endjoker

Start a long-running command

ssh_exec_start
Destructive

Starts a long-running non-interactive SSH command as a background task and returns a task ID immediately, enabling output polling or cancellation without blocking the client.

Instructions

Starts a long-running non-interactive remote command and returns a taskId immediately; poll output increments with ssh_task_poll and stop it with ssh_task_cancel. Task state and output buffers live only in this server process; after a restart or disconnect the remote state cannot be confirmed (marked unknown_after_disconnect), and commands are never replayed automatically. Cancel only closes the SSH channel owned by this server; it does not guarantee that the remote process or its children have terminated.

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_start"
  }
}

Input Schema

NameRequiredDescriptionDefault
commandYes
timeoutMsNo
connectionIdYes

Output Schema

NameRequiredDescriptionDefault
stateYes
taskIdYes
startedAtYes
connectionIdYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior5/5

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

Goes well beyond the annotations by disclosing that task state and output buffers are process-local, that remote state becomes unknowable after restart/disconnect (marked unknown_after_disconnect), and that commands are never replayed. The cancel caveat — only the server-owned SSH channel closes, not remote children — is exactly the kind of consequence an agent cannot infer from destructiveHint=true.

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?

Dense but front-loaded: purpose and the polling/cancel path come first, then durability caveats, then the cancel limitation. Every sentence carries distinct information, though the final cancel sentence elaborates on a sibling tool's semantics rather than this one's invocation.

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?

An output schema exists, so return values need no explanation, and the lifecycle/failure semantics are unusually complete for a destructive, open-world operation. The remaining hole is input-side: nothing tells the agent what to pass for connectionId or how to size timeoutMs for a long-running task.

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

Parameters2/5

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

Schema description coverage is 0% across three parameters, so the description carries the full burden and largely fails it: connectionId, command, and timeoutMs are never mentioned. It is unclear whether timeoutMs bounds the start call or the remote command's lifetime, and the maxLength=100000 on command goes unexplained.

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?

States a specific verb and resource ('Starts a long-running non-interactive remote command') and immediately names the lifecycle handles (taskId, ssh_task_poll, ssh_task_cancel). The 'long-running non-interactive' framing lets an agent distinguish this from the plain ssh_exec sibling without opening either schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly routes the agent to ssh_task_poll for output increments and ssh_task_cancel for stopping, and warns about what cancel does not do. It lacks an explicit exclusion clause such as 'use ssh_exec instead for short/blocking commands', so the when-not-to-use case is left implicit.

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