Skip to main content
Glama
SSH MCP Server

SSH MCP Server

by quiloos39

SSH Connect

ssh_connect

Open an SSH connection to a remote server, using ~/.ssh/config aliases or explicit host details with password, private key, or agent authentication.

Instructions

Establish an SSH connection to a remote server. Reads ~/.ssh/config on every call for host aliases, identity files, ports, and usernames. Supports password, private key, and SSH agent authentication. Host keys are accepted on first use (TOFU) — no strict checking.

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>"
    },
    "name": "ssh_connect"
  }
}

Input Schema

NameRequiredDescriptionDefault
hostYesHostname, IP address, or SSH config alias to connect to
portNoSSH port (overrides SSH config, default 22)
passwordNoPassword for authentication
useAgentNoUse SSH agent for authentication (default: true if no password/key provided and SSH_AUTH_SOCK is set)
usernameNoSSH username (overrides SSH config)
passphraseNoPassphrase for the private key
connectionIdNoCustom identifier for this connection (default: host value). Use to manage multiple connections.
connectTimeoutNoConnection timeout in milliseconds covering both TCP connect and SSH handshake (default 20000)
privateKeyPathNoPath to private key file (e.g. ~/.ssh/id_ed25519)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.9/5.0
Behavior4/5

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

With no annotations at all, the description carries the full burden and delivers meaningful behavior: config is re-read on every call, three auth mechanisms are supported, and host keys use TOFU without strict checking — a notable security posture an agent should know. It still omits connection lifecycle (persistence, reuse, whether a prior connection is reused) and failure behavior, which matters for a stateful 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?

Four short sentences, front-loaded with the action and immediately followed by the behaviors that matter most (config re-read, auth support, host-key policy). No wasted words and no repetition of schema fields.

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

Completeness3/5

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

For a 9-parameter, stateful, unannotated tool with no output schema, the description should say what a successful call yields (connection handle?) and how the connection persists for ssh_execute. The security and auth story is complete, but the return/lifecycle story is left to inference.

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 each parameter already documents its own override/default semantics, so the baseline is 3. The description adds useful framing — that host, port, and username interact with ~/.ssh/config — plus the auth selection logic, but nothing about connectionId lifecycle or timeout interaction beyond the schema.

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 and resource ("Establish an SSH connection to a remote server") that is plainly distinct from ssh_disconnect, ssh_execute, and ssh_list_connections. The scope — connection setup only, not command execution — is unambiguous from the first sentence.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is only implied: an agent must connect before it can execute, and the auth-method rules hint at prerequisites, but nothing states when to choose this over alternatives or what to do on reconnect. There is no explicit prerequisite or exclusion guidance.

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