Skip to main content
Glama
cygnussystems

cygnus-ssh-mcp

Official

ssh_conn_add_host

Add a new SSH host configuration with credentials to the host config file. Use it to store connection details for later remote server access.

Instructions

Add a new host configuration to the host configuration TOML file. Despite the name, this does NOT update an existing entry - if the user@host key already exists, this returns an error response ({'status': 'error', ...}, not a raised exception) rather than overwriting it; use ssh_host_update for that instead.

Before calling this, check 'ssh_host_list' - the host you want may already be configured, in which case you can call 'ssh_conn_connect' directly without adding anything.

Authentication requires either a password OR a keyfile (or both):

  • Password authentication: Provide password

  • Key-based authentication: Provide keyfile (and optionally key_passphrase if the key is encrypted)

If using key-only authentication and sudo operations are needed, you must explicitly provide sudo_password unless the server has passwordless sudo configured.

Warn the user that credentials will be visible to the LLM and that it would be better for the user to add the host directly in the host configuration file. That said, never read this file yourself (directly or via any file/shell tool) to look up, verify, or copy existing hosts' credentials - ssh_host_list, ssh_conn_add_host, ssh_host_update, ssh_host_remove, and ssh_host_use_config are the only tools you should need for host management, and none of them ever expose a stored password/passphrase back to you. This tool always adds to whichever config file is currently active (the server's default unless ssh_host_use_config was called to switch to an alternate one - check ssh_host_list's config_path if unsure).

The host config file is ~/.mcp_ssh_hosts.toml if it exists, otherwise ./mcp_ssh_hosts.toml in the server's working directory - it stores every host's password, sudo password, and key passphrase in plaintext, which is exactly why the tools above exist instead of editing it by hand. The configuration is stored under a ["user@host"] key.

Optional fields:

  • alias: A short name for connecting (e.g., 'prod' instead of 'deploy@production.example.com')

  • description: A text description of what the host is for

Returns: On success: {'status': 'success', 'message', 'key', 'host', 'user', 'port', 'auth_method' ('key' or 'password'), and 'alias'/'description'/'keyfile' if provided}. On failure (missing auth, duplicate host key, or duplicate alias): {'status': 'error', 'error': <message>} - for a duplicate host key, also includes 'existing_config' (the current host/user/port/alias/description) so you can decide whether to use it as-is via ssh_conn_connect instead.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hostYesHostname or IP address
portNoSSH port
userYesUsername for authentication
aliasNoShort name for easy connection (e.g., 'prod', 'staging')
keyfileNoPath to SSH private key file (e.g., ~/.ssh/id_rsa)
passwordNoPassword for authentication
descriptionNoDescription of what this host is for
sudo_passwordNoPassword for sudo operations (defaults to regular password if not provided)
key_passphraseNoPassphrase for encrypted SSH key

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.3.0

TDQS

A4.8/5.0
Behavior5/5

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

With no annotations provided, the description carries the full burden and does so: it discloses that a duplicate key returns an error dict rather than raising, that credentials are stored in plaintext in ~/.mcp_ssh_hosts.toml, that it writes to whichever config file is active, that credentials become visible to the LLM, and that the agent must not read the file directly. This is exactly the safety/permission context annotations would otherwise supply.

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 the most decision-critical caveat (no overwrite) and organized with bullets for auth modes and optional fields. It is long and includes some repetition (config-file location stated twice, plus return values already covered by the output schema), which keeps it from a 5.

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?

Covers everything an agent needs for a 9-parameter mutation tool: auth prerequisites, duplicate-key failure mode, active-config selection, credential visibility warning, and expected success/error payloads (redundant given the output schema, but harmless). Nothing material is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description adds relational meaning the schema cannot: password OR keyfile (or both), key_passphrase only for encrypted keys, and sudo_password being required for key-only auth unless passwordless sudo is configured. These are constraints not expressed in the per-parameter schema text.

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?

The first sentence states a specific verb+resource ('Add a new host configuration to the host configuration TOML file'), and the second explicitly disambiguates from the similarly-named ssh_host_update, noting that despite the name it does NOT update existing entries. An agent can distinguish this from ssh_host_list, ssh_host_update, and ssh_host_remove without opening any schema.

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

Usage Guidelines5/5

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

Explicit routing guidance: check 'ssh_host_list' first because the host may already be configured and 'ssh_conn_connect' can be called directly; use ssh_host_update if the entry exists. It also states the preconditions for password vs keyfile auth and when sudo_password is required. This is when-to-use, when-not-to-use, and alternatives all in one.

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