Skip to main content
Glama

ssh_view_config

View complete SSH configuration, including all servers and settings, to verify or understand your remote access setup.

Instructions

View the full SSH configuration including servers and settings

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • src/index.ts:53-61 (registration)
    Registration of 'ssh_view_config' tool: defines name, description, and empty inputSchema (no params required).
    {
      name: 'ssh_view_config',
      description: 'View the full SSH configuration including servers and settings',
      inputSchema: {
        type: 'object',
        properties: {},
        required: [],
      },
    },
  • Handler for 'ssh_view_config': sanitizes config by filtering sensitive fields (password, privateKeyPath) from servers, returns servers list (id, name, host, port, username, authMethod) plus settings as JSON.
    case 'ssh_view_config': {
      // Filter out sensitive information (passwords and private key paths)
      const sanitizedConfig = {
        servers: config.servers.map(s => ({
          id: s.id,
          name: s.name,
          host: s.host,
          port: s.port,
          username: s.username,
          authMethod: s.authMethod,
          // Exclude: password, privateKeyPath for security
        })),
        settings: config.settings,
      };
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(sanitizedConfig, null, 2),
          },
        ],
      };
    }
  • loadConfig() helper: reads and validates the config file from ~/.hydrossh/config.json using Zod schemas.
    export function loadConfig(): Config {
      const configPath = getConfigPath();
    
      if (!fs.existsSync(configPath)) {
        throw new Error(
          `Config file not found: ${configPath}\n` +
          `Run the server again to auto-create, or manually:\n` +
          `  mkdir -p ~/.hydrossh && cp <mcp-dir>/example-config.json ~/.hydrossh/config.json`
        );
      }
    
      const raw = fs.readFileSync(configPath, 'utf-8');
      let parsed: any;
      try {
        parsed = JSON.parse(raw);
      } catch (err) {
        throw new Error(
          `Invalid JSON in config file: ${configPath}\n` +
          `Details: ${err instanceof Error ? err.message : String(err)}`
        );
      }
      const validated = ConfigSchema.parse(parsed);
    
      return validated as Config;
    }
  • getConfigSettings() helper: extracts the settings section from the config object.
    export function getConfigSettings(config: Config) {
      return config.settings;
    }
  • Type definitions for Config (servers array + settings) and ServerConfig used by the handler to structure the output.
    export interface ServerConfig {
      id: string;
      name: string;
      host: string;
      port: number;
      username: string;
      authMethod: 'agent' | 'key' | 'password';
      privateKeyPath?: string;
      password?: string;
      connectTimeout?: number;
      keepaliveInterval?: number;
    }
    
    // 全局配置
    export interface Config {
      servers: ServerConfig[];
      settings: {
        defaultConnectTimeout: number;
        defaultKeepaliveInterval: number;  // 新增:默认心跳间隔
        commandTimeout: number;
        maxConnections: number;
        autoReconnect: boolean;
        logCommands: boolean;
      };
    }
Behavior3/5

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

Implies read-only via 'View', but lacks disclosure of output format, caching, or error behavior. With no annotations, description carries burden; minimal but adequate for a simple view 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?

Single concise sentence with clear front-loaded verb and resource. No filler.

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

Completeness4/5

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

For a parameterless view tool with no output schema, the description sufficiently conveys purpose. Could note read-only explicitly, but not necessary.

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?

No parameters, so schema coverage is 100%. Description adds no param info, which is acceptable given zero params.

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?

Clear verb 'View' and resource 'SSH configuration' with scope 'including servers and settings'. Distinct from siblings like ssh_list_servers and ssh_get_status.

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 on when to use vs alternatives such as ssh_list_servers for just servers or ssh_get_status for status.

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