get_available_connections
Retrieve a list of SSH-capable machines recognized by the server but not currently connected, enabling users to identify potential remote systems for secure execution of shell commands.
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:302-315 (handler)Handler function for the 'get_available_connections' tool. Returns a JSON string containing the list of available machines, mapping to {machine_id, label, os, source}.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-147 (registration)Registration of the 'get_available_connections' tool in the ListTools response, including its name, description, and input schema (empty object).{ 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)Helper code that initializes and loads the availableMachines array from a JSON file specified by MACHINES_PATH environment variable, which is used by the tool handler.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); } }