ssh_tunnel_list
List active SSH tunnels to monitor connections and manage secure remote access across servers.
Instructions
List active SSH tunnels
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| server | No | Filter by server name |
Implementation Reference
- src/tunnel-manager.js:497-509 (handler)Handler function that lists all active SSH tunnels (filtered by serverName if provided). Returns array of tunnel info objects with id, server, type, state, config, stats, timestamps, and active connections.export function listTunnels(serverName = null) { const activeTunnels = []; for (const [id, tunnel] of tunnels.entries()) { if (tunnel.state !== TUNNEL_STATES.CLOSED) { if (!serverName || tunnel.serverName === serverName) { activeTunnels.push(tunnel.getInfo()); } } } return activeTunnels; }
- src/tool-registry.js:57-72 (registration)Registration of 'ssh_tunnel_list' tool in the TOOL_GROUPS.advanced array. Used by the system to conditionally register MCP tools based on user configuration.advanced: [ 'ssh_deploy', 'ssh_execute_sudo', 'ssh_alias', 'ssh_command_alias', 'ssh_hooks', 'ssh_profile', 'ssh_connection_status', 'ssh_tunnel_create', 'ssh_tunnel_list', 'ssh_tunnel_close', 'ssh_key_manage', 'ssh_execute_group', 'ssh_group_manage', 'ssh_history' ]
- src/tunnel-manager.js:356-373 (helper)SSHTunnel.getInfo() method called by listTunnels to serialize tunnel information for the tool response.getInfo() { return { id: this.id, server: this.serverName, type: this.type, state: this.state, config: { localHost: this.config.localHost, localPort: this.config.localPort, remoteHost: this.config.remoteHost, remotePort: this.config.remotePort }, stats: this.stats, created: this.createdAt, lastActivity: this.lastActivity, activeConnections: this.connections.size }; }