Skip to main content
Glama

ssh_list_sessions

View active SSH sessions to monitor connections and manage remote server access. Lists session details for oversight and control.

Instructions

Lists all active SSH sessions with their details

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler for 'ssh_list_sessions' which calls sessionManager.getActiveSessions() and returns a formatted list of active sessions.
    case 'ssh_list_sessions': {
      const sessions = sessionManager.getActiveSessions();
      const result = {
        count: sessions.length,
        sessions: sessions.map(s => ({
          sessionId: s.sessionId,
          host: s.host,
          username: s.username,
          port: s.port,
          createdAt: new Date(s.createdAt).toISOString(),
          expiresAt: new Date(s.expiresAt).toISOString(),
          lastUsed: new Date(s.lastUsed).toISOString(),
          remainingMs: Math.max(0, s.expiresAt - Date.now())
        }))
      };
      logger.info('Sessions listed', { count: sessions.length });
      return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
    }
  • src/mcp.ts:337-345 (registration)
    The tool definition and schema registration for 'ssh_list_sessions'.
    {
      name: 'ssh_list_sessions',
      description: 'Lists all active SSH sessions with their details',
      inputSchema: {
        type: 'object',
        properties: {},
        required: []
      }
    },

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/oaslananka/mcp-ssh-tool'

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