Skip to main content
Glama
SSH MCP Server

SSH MCP Server

by YawLabs

ssh_mkdir

Creates a directory on a remote SSH host over SFTP, with optional recursive parent creation (like mkdir -p) for nested paths.

Instructions

Create a directory on a remote host via SFTP. Set recursive: true to create parent directories as needed (like mkdir -p). Existing intermediate dirs are tolerated; an existing leaf path is still an error. Unlike the other SFTP tools, the path may be relative. 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 the remote command-execution tools (single-host and multi-host), so a blacklist such as ^rm does NOT block this tool.

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_mkdir"
  }
}

Input Schema

NameRequiredDescriptionDefault
hostYesSSH hostname or IP address
pathYesPath of the directory to create. Absolute (starting with /) is recommended and unambiguous. A relative path is also accepted and resolves against the SFTP working directory, which is normally the remote user's home. ~ is NOT expanded — SFTP has no shell to expand it.
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)
recursiveNoCreate parent directories as needed (default: false). Like `mkdir -p`.
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 of the directory to create"New value: +"Path of the directory to create. Absolute (starting with /) is recommended and unambiguous. A relative path is also accepted and resolves against the SFTP working directory, which is normally the remote user's home. ~ is NOT expanded — SFTP has no shell to expand it."
  2. Addedv0.11.0

TDQS

A4.3/5.0
Behavior5/5

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

Adds substantial context beyond the annotations: pool exhaustion causes up to a 30s wait (SSH_MCP_MAX_POOL_SIZE default 100), intermediate directories are tolerated while an existing leaf path errors, and command policy does not apply to this tool. These are exactly the failure-mode and policy details an agent cannot get from readOnlyHint/openWorldHint/destructiveHint alone.

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-loads the core action in sentence one and moves to conditionals immediately; nothing is padded. The final sentence on whitelist/blacklist is long and dense but carries genuinely non-obvious information, so it earns its space.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a mutating filesystem tool with no output schema, the description covers prerequisites (none), error semantics (existing leaf fails), path resolution, and concurrency behavior. The only gap is that it doesn't say what a successful call returns, which is minor since there is no output schema to conflict with.

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%, so host, path, port, username, password, recursive, and privateKeyPath are all already documented, including the `mkdir -p` analogy and the `~` non-expansion caveat. The description largely restates those schema notes rather than adding new meaning, so the baseline 3 applies.

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?

States a specific verb+resource+transport: 'Create a directory on a remote host via SFTP.' It also differentiates itself from the other SFTP siblings by noting that relative paths are permitted here but not elsewhere, so an agent can place it precisely among ssh_ls, ssh_upload, ssh_delete, etc.

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 conditional guidance: set `recursive: true` for mkdir -p behavior, intermediate dirs tolerated but existing leaf is an error, and explicitly notes the tool is not subject to the command whitelist/blacklist so a `^rm` blacklist won't block it. That removes a real hesitation an agent might have. It stops short of naming a sibling alternative for related tasks like directory removal.

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