Skip to main content
Glama

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
NameRequiredDescriptionDefault
serverNoFilter by server name

Implementation Reference

  • 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; }
  • 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' ]
  • 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 }; }

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/bvisible/mcp-ssh-manager'

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