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
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:156-182 (handler)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}".` }], }; } - src/tools.ts:26-33 (schema)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: {}, }, },