Skip to main content
Glama

ssh_add_server

Add new SSH servers to the mcpHydroSSH configuration by specifying connection details like host, username, and authentication method.

Instructions

Add a new SSH server to config

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesUnique server ID
nameYesServer display name
hostYesServer hostname or IP
portNoSSH port (default: 22)
usernameYesSSH username
authMethodNoAuthentication method (default: "key")
privateKeyPathNoPath to private key (required for "key" auth)
passwordNoPassword (required for "password" auth)

Implementation Reference

  • Handler implementation for 'ssh_add_server'. It constructs a server object, persists it using `addServer` (imported helper), updates the in-memory configuration, and returns a success/error message.
    case 'ssh_add_server': {
      const server = {
        id: args.id as string,
        name: args.name as string,
        host: args.host as string,
        port: (args.port as number) || 22,
        username: args.username as string,
        authMethod: (args.authMethod as 'agent' | 'key' | 'password') || 'key',
        privateKeyPath: args.privateKeyPath as string | undefined,
        password: args.password as string | undefined,
      };
      try {
        addServer(server);
        // Update in-memory config
        config.servers.push(server);
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify({ success: true, message: `Server "${server.id}" added` }, null, 2),
            },
          ],
        };
      } catch (err: unknown) {
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify({ error: err instanceof Error ? err.message : String(err) }, null, 2),
            },
          ],
          isError: true,
        };
      }
    }
  • src/index.ts:150-191 (registration)
    Tool registration for 'ssh_add_server' within the `ListToolsRequestSchema` handler. Defines the tool's name, description, and input schema.
      name: 'ssh_add_server',
      description: 'Add a new SSH server to config',
      inputSchema: {
        type: 'object',
        properties: {
          id: {
            type: 'string',
            description: 'Unique server ID',
          },
          name: {
            type: 'string',
            description: 'Server display name',
          },
          host: {
            type: 'string',
            description: 'Server hostname or IP',
          },
          port: {
            type: 'number',
            description: 'SSH port (default: 22)',
          },
          username: {
            type: 'string',
            description: 'SSH username',
          },
          authMethod: {
            type: 'string',
            enum: ['agent', 'key', 'password'],
            description: 'Authentication method (default: "key")',
          },
          privateKeyPath: {
            type: 'string',
            description: 'Path to private key (required for "key" auth)',
          },
          password: {
            type: 'string',
            description: 'Password (required for "password" auth)',
          },
        },
        required: ['id', 'name', 'host', 'username'],
      },
    },
Behavior2/5

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

No annotations are provided, so the description carries full disclosure burden. It fails to specify idempotency behavior (what happens if 'id' already exists?), persistence characteristics, validation rules (does it verify host reachability?), or return values. 'Add' implies mutation but lacks safety context.

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 single sentence is efficiently structured with zero redundancy. However, given the tool's complexity (8 parameters with interdependent conditional logic), the description is arguably undersized rather than optimally concise.

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

Completeness2/5

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

For a tool with 8 parameters, complex conditional requirements between authMethod and credential fields, and no output schema, the description is inadequate. It omits return value specification, error handling scenarios, and the critical relationship between authentication method selection and required credential parameters.

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%, with clear documentation for all 8 parameters including enum values and conditional requirements. The description adds no parameter-specific context, but baseline 3 is appropriate when schema coverage is complete.

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 uses specific verb 'Add' with resource 'SSH server' and destination 'to config', distinguishing it from siblings like ssh_connect (session establishment) and ssh_update_server (modification). However, it lacks specificity about what 'config' entails (persistence model, scope).

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

Usage Guidelines2/5

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

No guidance provided on when to use this versus ssh_update_server (for existing entries) or prerequisites like ID uniqueness. The conditional parameter requirements (privateKeyPath required only when authMethod is 'key') are not mentioned despite being critical for correct invocation.

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/hydroCoderClaud/mcpHydroSSH'

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