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
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/mcp.ts:565-573 (handler)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) }] }; } - src/ssh-config.ts:246-249 (helper)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: [] } },