Skip to main content
Glama

ezssh-mcp

npm version License: MIT

Easy SSH MCP Server - Execute commands and transfer files via SSH with AI assistance.

Features

  • 🖥️ Cross-platform: Linux, macOS, Windows

  • 🔑 SSH Agent support: System SSH Agent, 1Password, Windows OpenSSH

  • 📋 Auto-discovery: Reads hosts from ~/.ssh/config

  • ⚡ Concurrent execution: Run commands on multiple hosts simultaneously

  • 📁 File transfer: Upload/download via SFTP

  • 🔗 MCP Resources: SSH hosts exposed as resources for AI access

  • 🤖 Multi-AI compatible: Works with Claude, ChatGPT, Gemini and other MCP-compatible clients

Related MCP server: SSH MCP Server

Installation

npm install -g ezssh-mcp

From Source

git clone https://github.com/laomeifun/ezssh-mcp.git
cd ezssh-mcp
npm install
npm run build

Quick Start

1. Run as MCP Server

ezssh-mcp
# or
npx ezssh-mcp

2. Configure with Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "ssh": {
      "command": "npx",
      "args": ["-y", "ezssh-mcp"]
    }
  }
}

Or if installed globally:

{
  "mcpServers": {
    "ssh": {
      "command": "ezssh-mcp"
    }
  }
}

Tools

Tool

Description

ssh_list_hosts

List available SSH hosts from config

ssh_execute

Execute commands on one or more hosts

ssh_transfer

Upload/download files via SFTP

ssh_execute

Execute commands on multiple hosts concurrently:

{
  "hosts": ["web1", "web2", "web3"],
  "command": "uptime"
}

Direct connection (without SSH config):

{
  "hosts": ["192.168.1.100"],
  "command": "uptime",
  "username": "root",
  "password": "your-password",
  "port": 22
}

ssh_transfer

Upload files:

{
  "direction": "upload",
  "hosts": ["web1", "web2"],
  "localPath": "./dist/app.zip",
  "remotePath": "/opt/app/app.zip"
}

Download files (with {host} placeholder for multiple hosts):

{
  "direction": "download",
  "hosts": ["web1", "web2"],
  "localPath": "./logs/{host}.log",
  "remotePath": "/var/log/app.log"
}

Resources

SSH hosts are exposed as MCP resources with URI format ssh://<host-name>.

Environment Variables

Variable

Description

Default

SSH_CONFIG_PATH

SSH config file path

~/.ssh/config

SSH_KNOWN_HOSTS_PATH

known_hosts file path

~/.ssh/known_hosts

SSH_AUTH_SOCK

SSH Agent socket path

System default

SSH_TIMEOUT

Connection timeout (ms)

30000

SSH_STRICT_HOST_KEY

Strict host key checking

false

SSH_MAX_CONCURRENCY

Max concurrent connections

10

Development

# Install dependencies
npm install

# Development mode (watch)
npm run dev

# Build
npm run build

# Type check
npm run typecheck

# Run tests
npm test

License

MIT

Available Tools

3 tools
ssh_executeA

Execute a command on one or more SSH hosts. Runs concurrently on multiple hosts and returns results from each.

Inputs: hosts (required), command (required), port, timeout, +3 more.

ssh_list_hostsA

List all available SSH hosts from ~/.ssh/config. Returns host names, addresses, users, and connection details.

Inputs: no named parameters.

ssh_transferB

Transfer files between local machine and remote SSH hosts. Supports upload to multiple hosts or download from multiple hosts.

Inputs: hosts (required), direction (required), localPath (required), remotePath (required), +4 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.8/5.0

    Scored across 3 tools

    Disambiguation5/5

    Each tool targets a distinct SSH operation: listing hosts, executing commands, and transferring files. There is no overlap in their purposes, making selection unambiguous.

    Naming Consistency4/5

    All tools share the 'ssh_' prefix, but while 'ssh_list_hosts' and 'ssh_transfer' follow a verb_noun pattern, 'ssh_execute' lacks an explicit object. Still, the names are predictable and readable.

    Tool Count4/5

    Three tools is on the lean side, but they cover the most common SSH operations well. The count is reasonable for a focused SSH toolkit.

    Completeness4/5

    The set covers listing, executing, and transferring, which form a solid core. Missing host management is a minor gap since hosts are typically configured in files.

    Maintenance

    ActivityNo data
    ResponsivenessSyncing

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables remote file operations and command execution across multiple machines via SSH. Supports reading files, listing directories, and running commands on any host configured in your SSH config.
      -
    • A
      license
      A
      quality
      D
      maintenance
      Enables secure SSH connections to multiple remote servers with support for command execution, file transfers (SFTP), directory listing, and both password and key-based authentication.
      7
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables executing commands on remote SSH hosts, with full support for bastion/jump hosts and ~/.ssh/config, plus Slurm job management and rsync.
      4
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables SSH command execution, file uploads/downloads, and multi-server management with zero-config inline credentials, supporting async jobs and AI-readable output.
      2
      AGPL 3.0