Skip to main content
Glama
SSH MCP Server

SSH MCP Server

by YawLabs

ssh_read_file

Read-only

Read a file from a remote host via SFTP, with byte offset and length paging for large files or proxy-capped results.

Instructions

Read a file from a remote host via SFTP. A whole-file read is limited to 10 MB. For a large file -- or behind a proxy that caps results, such as Yaw MCP at about 100 KB -- read it in pages with offset and length (bytes): a paged read returns a status block first ([bytes A-B of SIZE] and the next offset) and then the text. If the connection pool is full (SSH_MCP_MAX_POOL_SIZE, default 100), waits up to 30s for a free slot before starting.

Input Schema

NameRequiredDescriptionDefault
hostYesSSH hostname or IP address
pathYesAbsolute path to the remote file. Must start with /.
portNoSSH port (default: 22)
lengthNoNumber of bytes to read (default: the rest of the file, up to 10 MB). Behind Yaw MCP keep it at or under about 90000 so the page is not cut. A page boundary can split a multi-byte UTF-8 character.
offsetNoByte offset to start reading at (default 0). Setting offset or length switches to a paged read.
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. Changed2 schema fields changedv0.18.1
    • addedInput schema / properties / length
      Added value: +{
      +  "description": "Number of bytes to read (default: the rest of the file, up to 10 MB). Behind Yaw MCP keep it at or under about 90000 so the page is not cut. A page boundary can split a multi-byte UTF-8 character.",
      +  "exclusiveMinimum": 0,
      +  "maximum": 10485760,
      +  "type": "integer"
      +}
    • addedInput schema / properties / offset
      Added value: +{
      +  "description": "Byte offset to start reading at (default 0). Setting offset or length switches to a paged read.",
      +  "maximum": 9007199254740991,
      +  "minimum": 0,
      +  "type": "integer"
      +}
  2. Changed1 schema field changedv0.11.7
    • changedInput schema / properties / path / description
      Previous value: -"Absolute path to the remote file"New value: +"Absolute path to the remote file. Must start with /."
  3. Changed5 schema fields changedv0.9.1
    • removedInput schema / additionalProperties
      Removed value: -false
    • changedInput schema / properties / password / description
      Previous value: -"SSH password (prefer keys)"New value: +"SSH 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."
    • addedInput schema / properties / port / maximum
      Added value: +65535
    • addedInput schema / properties / port / minimum
      Added value: +1
    • changedInput schema / properties / port / type
      Previous value: -"number"New value: +"integer"
  4. First observedv0.2.0

TDQS

A4.3/5.0
Behavior5/5

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

Beyond the readOnly and openWorld annotations, the description discloses important behavioral traits: the 10 MB whole-file limit, proxy result caps, paged-read status output, UTF-8 boundary splitting, and a 30-second wait when the SSH connection pool is exhausted. These are exactly the operational constraints an agent needs before invoking the tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is compact and front-loaded: the core action and size limit appear first, followed by paging guidance and pool-wait behavior. Every sentence carries useful operational information with no filler.

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 explaining paged-read return behavior, size limits, proxy caps, and pool timeouts. Combined with the fully described input schema, an agent has enough context to call this tool correctly and understand its key constraints.

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 coverage is 100%, and the schema already documents host, path, port, length, offset, auth fields, and pagination behavior in detail. The description adds useful paging context but largely repeats what the schema already conveys about offset and length, so it does not substantially add parameter-level meaning beyond the structured fields.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb and resource: reading a remote file via SFTP. It is clearly about file reading, but it does not explicitly differentiate itself from sibling tools such as ssh_download or ssh_tail, which also retrieve remote file content.

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 concrete invocation guidance: whole-file reads are capped at 10 MB, and large files or proxy-capped environments should use paged reads with offset and length. It does not explicitly say when to choose this tool over alternatives like ssh_download or ssh_tail, so it stops short of full when/when-not guidance.

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