ssh_read_file
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
| Name | Required | Description | Default |
|---|---|---|---|
| host | Yes | SSH hostname or IP address | |
| path | Yes | Absolute path to the remote file. Must start with /. | |
| port | No | SSH port (default: 22) | |
| length | No | 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. | |
| offset | No | Byte offset to start reading at (default 0). Setting offset or length switches to a paged read. | |
| password | No | 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. | |
| username | No | SSH username (default: current user) | |
| privateKeyPath | No | Path to SSH private key |