Skip to main content
Glama

downloadFile

Download files from remote SSH hosts to local destinations using secure SSH connections. Transfer files between systems by specifying host, remote path, and local path.

Instructions

Downloads a file from an SSH host

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hostAliasYesAlias or hostname of the SSH host
remotePathYesPath on the remote host
localPathYesPath to the local destination

Implementation Reference

  • The handler function for the 'downloadFile' MCP tool. It connects to an SSH host using the provided alias, downloads a file from the remote path to the local path using node-ssh's getFile method, handles errors, and returns a boolean indicating success.
    async downloadFile(hostAlias: string, remotePath: string, localPath: string): Promise<boolean> { try { await this.connectToHost(hostAlias); await this.ssh.getFile(localPath, remotePath); this.ssh.dispose(); return true; } catch (error) { console.error(`Error downloading file from ${hostAlias}:`, error); return false; } }

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

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