Skip to main content
Glama

ssh_connect

Establishes a new SSH connection to a remote server, returning a session_id and accepted host key fingerprint while verifying host keys against known_hosts.

Instructions

Create a new SSH connection to a remote server. Returns a session_id and the accepted host key fingerprint. Host keys are checked against known_hosts (default accept-new: remember a new key, reject a changed key). If server is pre-configured via environment variables, this is optional.

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

Input Schema

NameRequiredDescriptionDefault
hostYesRemote server hostname or IP address
portNoSSH port (default: 22)
timeoutNoCommand execution timeout in ms (default: 30000)
passwordNoPassword for authentication
usernameYesSSH username
passphraseNoPassphrase for encrypted private key
private_keyNoPrivate key content (PEM format)
connect_timeoutNoConnection timeout in ms (default: 10000)
keepalive_countNoMax keepalive failures before disconnect (default: 3)
host_fingerprintNoRequired SHA256 host key fingerprint, for example SHA256:abc...
known_hosts_pathNoknown_hosts file. Defaults to ~/.ssh/known_hosts
private_key_pathNoPath to private key file
keepalive_intervalNoKeepalive interval in ms (default: 10000, 0 to disable)
strict_host_key_checkingNoHost key policy. accept-new records unseen keys and rejects changed keys. yes rejects unseen keys. no skips known_hosts.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations, the description carries the full burden, and it does disclose useful behavior: the return value, the default accept-new host-key policy, and that changed keys are rejected. It omits significant operational facts, though: which credentials are mutually required (password vs private_key vs private_key_path vs passphrase), whether the session persists until ssh_disconnect is called, and any limits on concurrent connections.

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?

Three short sentences, front-loaded with the action and the return value, then the host-key policy caveat. Nothing is padded, though the trailing environment-variable sentence is slightly vague about what 'pre-configured' means.

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 14-parameter connection tool with no annotations and no output schema, the description covers the return contract and host-key policy, which is the highest-risk area. It still leaves authentication-method selection and session lifecycle unexplained, so an agent could connect successfully but misjudge which credentials to supply or when to tear the session down.

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%, so every one of the 14 parameters is already documented, which sets the baseline at 3. The prose adds only marginal meaning, reinforcing the host-key checking semantics around host_fingerprint, known_hosts_path, and strict_host_key_checking without explaining the credential parameter trade-offs.

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 opens with a specific verb and resource: 'Create a new SSH connection to a remote server.' It also states what the tool returns (session_id and accepted host key fingerprint), which makes the outcome concrete. It does not explicitly contrast itself with siblings like ssh_exec or ssh_list_sessions, leaving that differentiation to the reader, so a 4 rather than a 5.

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 a clear usage context ('this is optional' when the server is pre-configured via environment variables), which is a real when-not-use signal. However, it never says what to do after connecting (e.g., that ssh_exec needs an existing session) or when to prefer this over alternatives, so the guidance is contextual rather than complete.

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