Skip to main content
Glama
jahrulnr

mcp-ssh-agentic

by jahrulnr

ssh_exec

Execute shell commands on a remote host via SSH, with options for stdin, working directory, environment, timeouts, and background jobs.

Instructions

Execute an intentional shell command on the remote host. Supports stdin, cwd, env, custom output limit, and acceptable exit codes. Set background=true to run a command detached and get a job_id; stdin is not allowed for background jobs. Use ssh_exec_result to poll/wait and ssh_exec_kill to stop or clean up.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cwdNoWorking directory on the remote host.
envNoExtra environment variables for the command.
stdinNoText to write to the command's stdin. Not allowed when background=true.
targetYesSSH target in the form user@host[:port]. Uses the local SSH config and keys.
commandYes
ok_codesNoExit codes to treat as success in addition to 0.
backgroundNoRun the command detached and return a job_id instead of waiting for completion.
timeout_msNoTimeout for non-background executions.
max_output_bytesNoMaximum stdout/stderr bytes to capture for non-background executions.
Behavior3/5

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

No annotations are provided, so the description carries full burden for behavior disclosure. It conveys key behaviors reasonably: background mode returns job_id, stdin is disallowed for background jobs, and timeout/output-limit are configurable. However, it doesn't disclose side-effect risks of arbitrary shell execution (e.g., no confirmation/warning about destructive commands), what happens on non-ok exit codes, or behavior on timeout beyond there being a limit. For a mutating/powerful exec tool with zero annotations, some behavioral disclosure is present but gaps remain.

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?

Three sentences, all information-dense with zero filler. The description prioritizes the core purpose first, then capability list, then the background-job workflow and sibling handoff. Slightly more than the minimum needed, but each clause adds distinct value. No waste or redundancy.

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?

For a complex 9-parameter tool with nested objects (env) but no output schema, the description covers the operational workflow well. It explains the two execution modes (foreground vs background), the stdin-background incompatibility, and directs users to ssh_exec_result/ssh_exec_kill for follow-up. The high schema coverage (89%) handles parameter details, and the description fills the cross-tool workflow gap thoroughly. It doesn't describe return values, but none are promised in an output schema, and background job_id is mentioned.

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 high (89%), so baseline is 3. The description adds meaningful semantic context beyond the schema: 'stdin is not allowed for background jobs' ties two parameters together, 'Set background=true to run a command detached and get a job_id' explains the background param's behavior, and 'acceptable exit codes' frames ok_codes semantically. The description meaningfully complements the 89% covered schema.

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?

Description uses a specific verb ('Execute an intentional shell command') with a clear resource ('remote host') and enumerates the capabilities it supports. It clearly distinguishes itself from siblings like ssh_read_file, ssh_write_file, ssh_interactive_exec, and ssh_apply_patch by being the general 'execute a shell command' tool. The mention that it's for 'intentional' commands hints at purpose and distinguishes from exploratory/ping tools.

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 references sibling tools for related workflows: 'Use ssh_exec_result to poll/wait and ssh_exec_kill to stop or clean up.' It also explains when background=true is appropriate versus standard execution and notes the stdin restriction for background jobs. The sibling context includes ssh_interactive_exec, and the description frames ssh_exec as the non-interactive general command runner.

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/jahrulnr/mcp-ssh-agentic'

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