Skip to main content
Glama

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
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • 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 }, },
  • The input schema for the 'get_connections' tool, which requires no parameters.
    inputSchema: { type: "object", properties: {}, additionalProperties: false },
  • 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();

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/vilasone455/ssh-mcp-server'

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