Skip to main content
Glama
bvisible

MCP SSH Manager

ssh_upload

Upload files from local system to remote SSH server using MCP SSH Manager. Specify server name, local file path, and remote destination path for secure file transfer.

Instructions

Upload file to remote SSH server

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
serverYesServer name
localPathYesLocal file path
remotePathYesRemote destination path

Implementation Reference

  • Registration of the 'ssh_upload' tool as part of the essential core SSH operations group in the centralized tool registry.
    // Core group (5 tools) - Essential SSH operations
    core: [
      'ssh_list_servers',
      'ssh_execute',
      'ssh_upload',
      'ssh_download',
      'ssh_sync'
    ],
  • The putFile method in SSHManager class provides the core implementation for uploading files to remote servers. It handles path resolution for '~' (expands to user's home directory), initializes SFTP if needed, checks local file existence, and uses ssh2's fastPut for efficient transfer.
    async putFile(localPath, remotePath) {
      // SFTP doesn't resolve ~ automatically, we need to get the real path
      let resolvedRemotePath = remotePath;
      if (remotePath.includes('~')) {
        try {
          const homeDir = await this.resolveHomePath();
          // Replace ~ with the actual home directory
          // Handle both ~/path and ~ alone
          if (remotePath === '~') {
            resolvedRemotePath = homeDir;
          } else if (remotePath.startsWith('~/')) {
            resolvedRemotePath = homeDir + remotePath.substring(1);
          } else {
            // If ~ is not at the beginning, don't replace it
            resolvedRemotePath = remotePath;
          }
        } catch (err) {
          // If we can't resolve home, throw a more descriptive error
          throw new Error(`Failed to resolve home directory for path: ${remotePath}. ${err.message}`);
        }
      }
    
      const sftp = await this.getSFTP();
      return new Promise((resolve, reject) => {
        // Check if local file exists and is readable
        if (!fs.existsSync(localPath)) {
          reject(new Error(`Local file does not exist: ${localPath}`));
          return;
        }
    
        sftp.fastPut(localPath, resolvedRemotePath, (err) => {
          if (err) reject(err);
          else resolve();
        });
      });
    }
  • putFiles helper method for batch uploading multiple files, calling putFile for each and collecting results with optional stop-on-error.
    async putFiles(files, options = {}) {
      const sftp = await this.getSFTP();
      const results = [];
    
      for (const file of files) {
        try {
          await this.putFile(file.local, file.remote);
          results.push({ ...file, success: true });
        } catch (error) {
          results.push({ ...file, success: false, error: error.message });
          if (options.stopOnError) break;
        }
      }
    
      return results;
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden for behavioral disclosure. While 'upload' implies a write operation, the description doesn't mention authentication requirements, file size limits, overwrite behavior, error handling, or what happens if the remote path already exists. This leaves significant gaps for a tool that performs file transfers.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise at just four words, front-loading the core functionality without any wasted words. It efficiently communicates the essential purpose in minimal space.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a file transfer tool with no annotations and no output schema, the description is insufficient. It doesn't address critical context like authentication requirements, transfer protocols, error conditions, or what constitutes successful completion. Given the complexity of SSH file operations and the lack of structured metadata, more descriptive content is needed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 100% schema description coverage, all three parameters (server, localPath, remotePath) are documented in the schema. The description adds no additional parameter context beyond what's already in the structured fields, so it meets the baseline expectation but doesn't enhance understanding of parameter usage or constraints.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Upload file to remote SSH server' clearly states the action (upload) and resource (file to SSH server), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like ssh_download or ssh_sync, which would require more specificity about what distinguishes this upload operation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like ssh_sync or ssh_download. With multiple SSH-related tools available, there's no indication of prerequisites, constraints, or typical use cases for file uploads specifically.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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

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