get_available_connections
List SSH-capable machines available for connection through the SSH MCP Server to execute remote commands securely.
Instructions
List every SSH-capable machine this server knows about (but is NOT yet connected).
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:301-315 (handler)Handler implementation for the 'get_available_connections' tool within the CallToolRequestSchema handler. It returns a text content block with JSON-stringified list of available machines (machine_id, label, os, source) from the global availableMachines array.// get_available_connections if (name === "get_available_connections") { return { content: [ { type: "text", text: JSON.stringify( availableMachines.map(({ machine_id, label , os , source }) => ({ machine_id, label , os , source })), null, 2 ), }, ], }; }
- src/index.ts:142-146 (registration)Registration of the 'get_available_connections' tool in the ListToolsRequestSchema handler, including its name, description, and input schema (empty object since no parameters).{ name: "get_available_connections", description: "List every SSH-capable machine this server knows about (but is NOT yet connected).", inputSchema: { type: "object", properties: {}, additionalProperties: false },
- src/index.ts:42-60 (helper)Global availableMachines array configuration and loading logic from MACHINES_PATH environment variable, which provides the data source for the get_available_connections tool.const machinesPath = process.env.MACHINES_PATH ; console.log(`Loading machines from: ${machinesPath}`); const availableMachines = [ ]; // read machines from file if MACHINES_PATH is set if (machinesPath) { try { const machinesData = readFileSync(machinesPath, "utf8"); const machinesFromFile = JSON.parse(machinesData); availableMachines.push(...machinesFromFile); } catch (err) { console.error(`Failed to read machines from ${machinesPath}:`, err); } }