ssh_download
Download files from remote servers to your local system using secure SFTP transfers. Transfer files between remote SSH servers and local machines with this SSH administration tool.
Instructions
Descarga un archivo del servidor remoto al sistema local via SFTP
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| remotePath | Yes | Ruta del archivo en el servidor remoto | |
| localPath | Yes | Ruta destino en el sistema local |
Implementation Reference
- src/index.ts:302-336 (handler)Handler for the 'ssh_download' tool, which uses SFTP to download a file and logs the operation for history/undo.
private async handleDownload(args: any): Promise<CallToolResult> { this.requireConnection(); const { remotePath, localPath } = args as { remotePath: string; localPath: string }; const sftp = await this.getSftp(); return new Promise<CallToolResult>((resolve, reject) => { sftp.fastGet(remotePath, localPath, (err) => { if (err) { this.audit("ssh_download", `${remotePath} -> ${localPath}`, "error"); reject(new Error(`Error descargando archivo: ${err.message}`)); } else { this.audit("ssh_download", `${remotePath} -> ${localPath}`, "ok"); this.recordOperation( "ssh_download", { remotePath, localPath }, `Archivo descargado: ${remotePath} -> ${localPath}`, true, { type: "local_file_delete", description: `Eliminar archivo local descargado: ${localPath}`, localPath, } ); resolve({ content: [ { type: "text", text: `Archivo descargado: ${remotePath} -> ${localPath}` }, ], }); } }); }); } - src/tools.ts:80-97 (schema)Schema definition for the 'ssh_download' tool.
{ name: "ssh_download", description: "Descarga un archivo del servidor remoto al sistema local via SFTP", inputSchema: { type: "object", properties: { remotePath: { type: "string", description: "Ruta del archivo en el servidor remoto", }, localPath: { type: "string", description: "Ruta destino en el sistema local", }, }, required: ["remotePath", "localPath"], }, },