get_connections
Retrieve active SSH sessions to monitor and manage ongoing connections on remote Linux and Windows systems using the SSH MCP Server.
Instructions
Return every STILL-OPEN SSH session in global state.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:372-392 (handler)The handler function for the 'get_connections' tool. It retrieves all active SSH connections from the global 'connections' Map, maps them to a simplified structure, and returns them as a formatted JSON string in the tool response.if (name === "get_connections") { return { content: [ { type: "text", text: JSON.stringify( Array.from(connections.values()).map( ({ connection_id, machine_id, title, currentPath }) => ({ connection_id, machine_id, title, currentPath, }) ), null, 2 ), }, ], }; }
- src/index.ts:162-166 (registration)The tool registration entry in the ListTools response, defining the name, description, and input schema (empty object) for 'get_connections'.{ name: "get_connections", description: "Return every STILL-OPEN SSH session in global state.", inputSchema: { type: "object", properties: {}, additionalProperties: false }, },
- src/index.ts:165-165 (schema)The input schema for the 'get_connections' tool, which requires no parameters.inputSchema: { type: "object", properties: {}, additionalProperties: false },
- src/index.ts:66-69 (helper)Global state Map that stores all active SSH connections, destructured and iterated by the get_connections handler./** * Map<connection_id, { client, machine_id, title, currentPath }> */ const connections = new Map();