Skip to main content
Glama
d3v1an
by d3v1an

ssh_disconnect

Terminate active SSH connections to remote servers. Use this tool to close established sessions and release resources when administration tasks are complete.

Instructions

Cierra la conexión SSH activa

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler logic for 'ssh_disconnect' that closes the SSH connection, cleans up shell sessions, and clears internal state.
    private async handleDisconnect(): Promise<CallToolResult> {
      if (!this.sshClient) {
        throw new Error("No hay conexión activa.");
      }
    
      const profileName = this.currentProfile;
    
      // Cerrar todas las sesiones de shell activas
      for (const [id, session] of this.shellSessions) {
        this.destroyShellSession(id, session);
        this.audit("ssh_shell_close", `sessionId=${id} (disconnect cleanup)`, "ok");
      }
    
      this.sftpClient = null;
      this.sshClient.end();
      this.sshClient = null;
      this.currentProfile = null;
      this.connectedAt = null;
      this.commandHistory = [];
      this.recordCounter = 0;
    
      this.audit("ssh_disconnect", `profile=${profileName}`, "ok");
    
      return {
        content: [{ type: "text", text: `Desconectado de "${profileName}".` }],
      };
    }
  • The tool definition for 'ssh_disconnect' including its name and input schema.
    {
      name: "ssh_disconnect",
      description: "Cierra la conexión SSH activa",
      inputSchema: {
        type: "object",
        properties: {},
      },
    },

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

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