Skip to main content
Glama

connect_ssh

Establish a persistent SSH connection to a remote server that remains active for sequential command execution. Supports password and key-based authentication.

Instructions

Establishes a persistent, stateful connection to a remote SSH server, automatically accepting host keys.
This session remains active across tool calls, allowing multiple execute commands to run sequentially.

CONNECTION LIFECYCLE:
- Initiates connection and performs handshake.
- Waits up to `banner_timeout` seconds to capture the MOTD/welcome banner.
- Returns a persistent session_id representing this connection.
- The connection remains open until explicitly closed using the `disconnect` tool.

AUTHENTICATION METHODS:
- Username & Password: Use 'username' and 'password' arguments.
- Key-based (Recommended): Provide 'username' and 'key_filepath' (absolute path to private key).
- If both password and private key are provided, key-based authentication is attempted first.

DEFAULT BEHAVIORS:
- Automatically trusts and accepts SSH host keys (no prompt).
- Starts a remote shell session ready to execute commands.

ERROR HANDLING:
- Raises exceptions for authentication failures, hostname resolution issues, or connection timeouts.
- Ensure paths provided in 'key_filepath' are absolute and readable by the server process.

Returns:
    A dictionary containing:
        - session_id: Unique identifier for the created SSH session (use this for execute commands).
        - banner: The server's welcome message/MOTD, or an empty string if timeout.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hostYesThe hostname or IP address of the SSH server to connect to (e.g., '192.168.1.10' or 'example.com')
portNoThe port number of the SSH server (default is 22)
usernameNoOptional username for authentication. If omitted, the connection will use SSH agent or system defaults
passwordNoOptional password for password-based authentication. If using key-based authentication, this can be omitted
key_filepathNoOptional absolute path to a private key file (SSH key) for key-based authentication
banner_timeoutNoThe timeout in seconds to wait for the MOTD/welcome banner after the connection opens
Behavior4/5

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

No annotations provided, so description carries full burden. It discloses auto-accepting host keys, session persistence, error handling (authentication failures, timeouts), authentication fallback, and return values (session_id, banner). It does not contradict any hidden behavior.

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?

The description is well-structured with sections (Lifecycle, Authentication, Defaults, Error Handling) and is front-loaded with the core purpose. It is detailed but not overly verbose; every sentence serves a purpose.

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?

With 6 parameters, no output schema, and no annotations, the description comprehensively covers connection lifecycle, authentication options, default behaviors, error handling, and return values (session_id and banner). It also references the disconnect tool, completing the context.

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 baseline is 3. Description adds value by explaining authentication methods (password vs key_filepath), requirement for absolute path in key_filepath, and purpose of banner_timeout. This goes beyond schema descriptions.

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 description clearly states it establishes a persistent SSH connection, automatically accepting host keys. The verb 'Establishes' and resource 'SSH server' are specific, and it distinguishes from siblings like disconnect and execute.

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?

The description explains when to use (to start an SSH session) and mentions the lifecycle (must disconnect). It recommends authentication methods and states that after connection, use execute. It lacks explicit exclusions but provides clear context.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/QiuwenZheng/interminal'

If you have feedback or need assistance with the MCP directory API, please join our Discord server