Skip to main content
Glama

ssh_list_configured_hosts

List all SSH hosts configured in your SSH config file to quickly access and manage remote server connections.

Instructions

Lists all hosts configured in ~/.ssh/config

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler implementation for ssh_list_configured_hosts in the switch case.
    case 'ssh_list_configured_hosts': {
      const hosts = await getConfiguredHosts();
      const result = {
        count: hosts.length,
        hosts
      };
      logger.info('Configured hosts listed', { count: hosts.length });
      return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
    }
  • Helper function used by the handler to retrieve hosts from ssh config.
    export async function getConfiguredHosts(): Promise<string[]> {
        const parser = await getSSHConfigParser();
        return parser.getAllHosts();
    }
  • src/mcp.ts:358-365 (registration)
    Registration of the tool in the list of tools.
      name: 'ssh_list_configured_hosts',
      description: 'Lists all hosts configured in ~/.ssh/config',
      inputSchema: {
        type: 'object',
        properties: {},
        required: []
      }
    },

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/oaslananka/mcp-ssh-tool'

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