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
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/mcp.ts:510-527 (handler)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: [] } },