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
30 stars

The MCP SSH Agent provides a standardized interface for AI assistants like Claude to manage SSH connections. It discovers hosts from your SSH configuration files and executes commands using native SSH tools for maximum reliability and security.

Installation

Desktop Extension (Recommended)

The easiest installation method is through Claude Desktop:

  1. Download the .dxt file from the GitHub releases page
  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

Using npx

You can run the MCP SSH Agent directly with npx:

npx @aiondadotcom/mcp-ssh

Manual Claude Desktop Configuration

To configure Claude Desktop manually:

On macOS: Edit ~/Library/Application Support/Claude/claude_desktop_config.json

On Windows: Edit %APPDATA%/Claude/claude_desktop_config.json

Add this configuration:

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

After adding this configuration, restart Claude Desktop.

Global Installation

Install the package globally with npm:

npm install -g @aiondadotcom/mcp-ssh

Key Features

  • Uses native ssh/scp commands for reliability
  • Automatically discovers hosts from SSH config and known_hosts files
  • Supports SSH agents, keys, and all authentication methods
  • Upload and download files using scp
  • Execute multiple commands in sequence
  • Comprehensive error reporting with timeouts

Available Functions

The MCP SSH Agent provides these tools:

  • listKnownHosts() - Lists all known SSH hosts
  • runRemoteCommand(hostAlias, command) - Executes a command on a remote host
  • getHostInfo(hostAlias) - Returns detailed configuration for a host
  • checkConnectivity(hostAlias) - Tests SSH connectivity
  • 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

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"

Claude will use the MCP SSH tools to perform these operations.

SSH Key Setup

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

1. Creating SSH Keys

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

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

2. Installing Public Key on Remote Servers

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

3. Setting Correct Permissions

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

4. Testing SSH Key Authentication

# Test connection
ssh -i ~/.ssh/id_ed25519 user@hostname

Advanced SSH Configuration

The MCP SSH Agent fully supports complex SSH configurations including:

  • Multiple users for the same host
  • Jump hosts via ProxyJump
  • IPv6 addresses
  • Custom identity files
  • Non-standard ports

Here's an example ~/.ssh/config file:

# Include directives must be at the beginning due to SSH bug
Include ~/.ssh/config.d/*
Include ~/.ssh/work-servers

# Global settings
ServerAliveInterval 55

# Production server with jump host
Host prod
    Hostname 203.0.113.10
    Port 22022
    User deploy
    IdentityFile ~/.ssh/id_prod_rsa

# Web server with specific configuration
Host web1.example.com
    Hostname 198.51.100.15
    Port 22022
    User root
    IdentityFile ~/.ssh/id_ed25519

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

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

Requirements

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

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