SSH MCP server

Provides secure remote server management capabilities through SSH connections, automatically discovering hosts from SSH configuration files and executing commands, transferring files, and managing connectivity using native SSH and SCP commands.
Back to servers
Setup instructions
Provider
AiondaDotCom
Release date
May 27, 2025
Stats
13 stars

MCP SSH Agent is a server that integrates with Claude Desktop and other MCP-compatible clients, allowing AI assistants to manage SSH connections and execute remote commands. It discovers SSH hosts from your configuration files and executes commands using native SSH tools for maximum reliability and security.

Installation Options

Desktop Extension Installation (Recommended)

  1. Download the latest mcp-ssh-*.dxt file from GitHub releases
  2. Double-click the .dxt file to install it in Claude Desktop
  3. The SSH tools will be automatically available in your conversations with Claude

Installation via npx

npx @aiondadotcom/mcp-ssh

Manual Claude Desktop Configuration

To use this MCP server with Claude Desktop using manual configuration:

On macOS: Add to ~/Library/Application Support/Claude/claude_desktop_config.json On Windows: Add to %APPDATA%/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "mcp-ssh": {
      "command": "npx",
      "args": ["@aiondadotcom/mcp-ssh"]
    }
  }
}

After adding this configuration, restart Claude Desktop.

Global Installation

npm install -g @aiondadotcom/mcp-ssh

Key Features

  • Reliable SSH: Uses native ssh/scp commands instead of JavaScript SSH libraries
  • Automatic Discovery: Finds hosts from SSH config and known_hosts files
  • Full SSH Support: Works with SSH agents, keys, and all authentication methods
  • File Operations: Upload and download files using scp
  • Batch Commands: Execute multiple commands in sequence
  • Error Handling: Comprehensive error reporting with timeouts

Available Functions

The agent provides these MCP tools:

  • listKnownHosts() - Lists all known SSH hosts
  • runRemoteCommand(hostAlias, command) - Executes a command on a remote host
  • getHostInfo(hostAlias) - Returns detailed configuration for a specific host
  • checkConnectivity(hostAlias) - Tests SSH connectivity to a host
  • uploadFile(hostAlias, localPath, remotePath) - Uploads a file to the remote host
  • downloadFile(hostAlias, remotePath, localPath) - Downloads a file from the remote host
  • runCommandBatch(hostAlias, commands) - Executes multiple commands sequentially

Requirements

  • Node.js 18 or higher
  • SSH client installed (ssh and scp commands available)
  • SSH configuration files (~/.ssh/config and ~/.ssh/known_hosts)

Using with Claude Desktop

Once configured, you can ask Claude to help with SSH operations like:

  • "List all my SSH hosts"
  • "Check connectivity to my production server"
  • "Run a command on my web server"
  • "Upload this file to my remote server"
  • "Download logs from my application server"

SSH Key Setup

For the MCP SSH Agent to work properly, you need to set up SSH key authentication:

Creating SSH Keys

# Generate Ed25519 key (recommended)
ssh-keygen -t ed25519 -C "[email protected]"

# Or generate RSA key
ssh-keygen -t rsa -b 4096 -C "[email protected]"

Important: When prompted for a passphrase, leave it empty (press Enter). The MCP SSH Agent cannot handle password-protected keys as it runs non-interactively.

Installing Public Key on Remote Servers

# Using ssh-copy-id (easiest)
ssh-copy-id user@hostname

# Manual copy
cat ~/.ssh/id_ed25519.pub | ssh user@hostname "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys"

Setting Correct Permissions

On your local machine:

chmod 700 ~/.ssh
chmod 600 ~/.ssh/id_ed25519
chmod 644 ~/.ssh/id_ed25519.pub
chmod 644 ~/.ssh/config
chmod 644 ~/.ssh/known_hosts

On the remote server:

chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys

Troubleshooting

Common Issues

  1. Command not found: Ensure ssh and scp are installed and in your PATH
  2. Permission denied: Check SSH key permissions and SSH agent
  3. Host not found: Verify host exists in ~/.ssh/config or ~/.ssh/known_hosts
  4. Connection timeout: Check network connectivity and firewall settings

Debug Mode

Run with debug output to see detailed operation logs:

# Enable debug mode
MCP_SILENT=false npx @aiondadotcom/mcp-ssh

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "mcp-ssh" '{"command":"npx","args":["@aiondadotcom/mcp-ssh"]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "mcp-ssh": {
            "command": "npx",
            "args": [
                "@aiondadotcom/mcp-ssh"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "mcp-ssh": {
            "command": "npx",
            "args": [
                "@aiondadotcom/mcp-ssh"
            ]
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later