Skip to main content
Glama

checkConnectivity

Verify SSH connectivity to a remote host using its alias or hostname. Ensures successful connection setup for further operations on the MCP SSH Agent server.

Instructions

Checks if an SSH connection to the host is possible

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hostAliasYesAlias or hostname of the SSH host

Implementation Reference

  • The handler function that executes the checkConnectivity tool. It attempts to connect to the SSH host specified by hostAlias, runs an 'echo connected' command to test connectivity, and returns a ConnectionStatus indicating success or failure with a message.
    async checkConnectivity(hostAlias: string): Promise<ConnectionStatus> { try { // Establish connection await this.connectToHost(hostAlias); // Execute ping command const result = await this.ssh.execCommand('echo connected'); const connected = result.stdout.trim() === 'connected'; this.ssh.dispose(); return { connected, message: connected ? 'Connection successful' : 'Echo test failed' }; } catch (error) { console.error(`Connectivity error with ${hostAlias}:`, error); return { connected: false, message: error instanceof Error ? error.message : String(error) }; } }
  • TypeScript interface defining the output schema for the checkConnectivity tool.
    export interface ConnectionStatus { connected: boolean; message: string; }

Other Tools

Related 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/AiondaDotCom/mcp-ssh'

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