Skip to main content
Glama
SSH MCP Server

SSH MCP Server

by YawLabs

ssh_stat

Read-only

Retrieve remote file or directory metadata over SFTP, including size, permissions, ownership, timestamps, and path type, without parsing ls -la output. Reports symlink targets and dangling links.

Instructions

Get metadata for a file or directory on a remote host via SFTP. Returns size, permissions (octal), uid/gid, mtime/atime, and the path type. Symlinks are reported as symlink -> <target kind>: the type describes the link itself while size/mode/mtime describe its TARGET. A symlink whose target cannot be resolved (dangling, or a loop) is reported as symlink -> (dangling) rather than erroring, and its size/mode/owner/times are then the link's own; a target that exists but cannot be read (permission denied) is an error. Use this instead of parsing ls -la output. If the connection pool is full (SSH_MCP_MAX_POOL_SIZE, default 100), waits up to 30s for a free slot before starting.

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": {
      "host": "<host>",
      "path": "<path>"
    },
    "name": "ssh_stat"
  }
}

Input Schema

NameRequiredDescriptionDefault
hostYesSSH hostname or IP address
pathYesAbsolute path to the remote file or directory. Must start with /.
portNoSSH port (default: 22)
passwordNoSSH password. STRONGLY prefer key-based auth (privateKeyPath or ssh-agent). Passwords pass through MCP protocol frames as plaintext and may be logged by the transport or host process.
usernameNoSSH username (default: current user)
privateKeyPathNoPath to SSH private key

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.17.0
    • changedInput schema / properties / path / description
      Previous value: -"Absolute path to the remote file or directory"New value: +"Absolute path to the remote file or directory. Must start with /."
  2. Addedv0.11.0

TDQS

A4.4/5.0
Behavior5/5

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

Beyond the readOnlyHint/openWorldHint annotations, it discloses real behavioral traits: exact returned fields, special symlink semantics (type describes the link, size/mode/times describe the target), dangling-symlink handling that returns rather than errors, permission-denied being an error, and pool-exhaustion backpressure (waits up to 30s with SSH_MCP_MAX_POOL_SIZE default 100). None of this is inferable from annotations or 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?

It is front-loaded with the read semantics first, then edge cases, then operational constraints, and every sentence carries distinct information. The symlink sentences are dense and could be tightened, but none are redundant.

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?

With no output schema, the description compensates by naming the returned attributes and spelling out the trickiest return shapes (symlink target kinds, dangling markers) plus failure and throttling behavior. An agent has everything needed to call and interpret this tool.

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 host, path, port, username, password, and privateKeyPath are already fully documented, and the description introduces no parameter-specific syntax or defaults. Baseline 3 applies when the schema carries the parameter burden.

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 opens with a specific verb and resource ('Get metadata for a file or directory on a remote host via SFTP') and enumerates the returned fields, so an agent can tell it apart from listing tools like ssh_ls or content tools like ssh_read_file without opening any 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?

It gives an explicit selection cue: use this instead of parsing `ls -la` output. It stops short of naming a sibling tool to prefer for other cases (e.g., directory listing via ssh_ls) or any exclusion, so it is clear context rather than a full when/when-not map.

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