Skip to main content
Glama

uploadFile

Transfer local files to remote SSH servers using secure SSH protocols. Specify host, local file path, and remote destination to complete file uploads.

Instructions

Uploads a local file to an SSH host

Input Schema

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

Implementation Reference

  • The main handler function for the 'uploadFile' MCP tool. It connects to the specified SSH host using the SSHClient instance, uploads the local file to the remote path using node-ssh's putFile method, and returns true on success or false on failure.
    async uploadFile(hostAlias: string, localPath: string, remotePath: string): Promise<boolean> { try { await this.connectToHost(hostAlias); await this.ssh.putFile(localPath, remotePath); this.ssh.dispose(); return true; } catch (error) { console.error(`Error uploading file to ${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