Skip to main content
Glama
SSH MCP Server

SSH MCP Server

by YawLabs

ssh_write_file

Destructive

Writes or overwrites a file on a remote SSH host via SFTP, enabling you to create and update remote file content directly from the MCP server.

Instructions

Write content to a file on a remote host via SFTP. Creates or overwrites the file. If the connection pool is full (SSH_MCP_MAX_POOL_SIZE, default 100), waits up to 30s for a free slot before starting. NOT gated by SSH_MCP_COMMAND_WHITELIST / SSH_MCP_COMMAND_BLACKLIST: command policy applies only to ssh_exec and ssh_multi_exec, so a blacklist such as ^rm does NOT block this tool.

Input Schema

NameRequiredDescriptionDefault
hostYesSSH hostname or IP address
pathYesAbsolute path to the remote file. Must start with /.
portNoSSH port (default: 22)
contentYesFile content to write
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"New value: +"Absolute path to the remote file. Must start with /."
  2. 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"
  3. First observedv0.2.0

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and openWorldHint=true, and the description adds real value on top: it makes explicit that existing file contents are overwritten, discloses the pool-exhaustion wait (up to 30s, gated by SSH_MCP_MAX_POOL_SIZE, default 100), and clarifies that command blacklists do not protect against it. It omits failure behavior (permission denied, missing parent directory) and whether the write is atomic, which are the remaining gaps for a destructive mutation.

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?

Front-loaded with purpose and overwrite semantics before the operational caveats, and every sentence carries information. The blacklist sentence is long and tool-specific but earns its place by preventing a false safety assumption.

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 destructive 7-parameter write with full schema coverage, no output schema, and safety hints already in annotations, the description covers purpose, overwrite risk, throughput limits, and a misleading policy assumption. Nothing essential to calling it correctly is missing.

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% and the schema already documents host, path, port, content, credentials, and key path with guidance (password plaintext warning, absolute-path requirement). The description adds no parameter-level detail beyond what the schema provides, so the baseline 3 applies.

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?

States a specific verb (write), resource (remote file), and transport (SFTP), plus the create-or-overwrite semantics. It does not explicitly distinguish itself from ssh_upload, the other obvious write-path sibling, so an agent must infer that ssh_upload takes a local source path while this takes inline 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?

Gives clear operating context: the tool bypasses SSH_MCP_COMMAND_WHITELIST/BLACKLIST, which is exactly the kind of pre-call assumption an agent might get wrong, and names the sibling tools (ssh_exec, ssh_multi_exec) where policy does apply. It stops short of stating when to prefer ssh_upload or ssh_delete over this tool, so no direct alternative routing is provided.

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