Skip to main content
Glama

ssh_resolve_host

Resolve SSH host aliases from ~/.ssh/config to obtain connection parameters for remote server automation.

Instructions

Resolves a host alias from ~/.ssh/config to connection parameters

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hostAliasYesHost alias from SSH config

Implementation Reference

  • The MCP tool handler for 'ssh_resolve_host' which invokes resolveSSHHost.
    case 'ssh_resolve_host': {
      const { hostAlias } = z.object({ hostAlias: z.string() }).parse(args);
      const resolved = await resolveSSHHost(hostAlias);
      logger.info('Host resolved', { hostAlias, resolved: resolved.host });
      return { content: [{ type: 'text', text: JSON.stringify(resolved, null, 2) }] };
    }
  • The core helper function that resolves an SSH host alias using the parser.
    export async function resolveSSHHost(hostAlias: string): Promise<{
        host: string;
        username?: string;
        port?: number;
        privateKeyPath?: string;
        proxyJump?: string;
    }> {
        const parser = await getSSHConfigParser();
        return parser.resolveHost(hostAlias);
    }
  • src/mcp.ts:366-376 (registration)
    Definition and registration of the 'ssh_resolve_host' tool in the MCP server.
    {
      name: 'ssh_resolve_host',
      description: 'Resolves a host alias from ~/.ssh/config to connection parameters',
      inputSchema: {
        type: 'object',
        properties: {
          hostAlias: { type: 'string', description: 'Host alias from SSH config' }
        },
        required: ['hostAlias']
      }
    }

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