SSH MCP

v1.0.0Developer Toolsstable

Enables AI assistants to securely execute remote SSH commands, perform file transfers, and monitor system status through a standardized interface. It features robust security controls including command whitelisting, blacklisting, and credential isola

sshmcpai-integration
Share:
463
Stars
0
Downloads
0
Weekly
0/5

What is SSH MCP?

SSH MCP is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to enables ai assistants to securely execute remote ssh commands, perform file transfers, and monitor system status through a standardized interface. it features robust security controls including comman...

Enables AI assistants to securely execute remote SSH commands, perform file transfers, and monitor system status through a standardized interface. It features robust security controls including command whitelisting, blacklisting, and credential isola

This server falls under the Developer Tools category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • Enables AI assistants to securely execute remote SSH command

Use Cases

Secure remote command execution
SSH file transfers
System monitoring
classfang

Maintainer

LicenseISC License
Languagetypescript
Versionv1.0.0
UpdatedMay 21, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

NPM

npx -y ssh

Manual Installation

npx -y ssh

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use SSH MCP

ssh-mcp-server is a TypeScript MCP server that lets AI assistants securely execute commands, upload files, and download files on remote servers via SSH. It supports password authentication, private key authentication with passphrases, 2FA keyboard-interactive auth, SOCKS proxy tunnelling, and fine-grained security controls including regex-based command whitelists and blacklists. SSH credentials are handled entirely locally and are never sent to the AI model, making it safe for use with cloud AI assistants.

Prerequisites

  • Node.js 18 or higher installed
  • SSH access to the remote server (IP address, username, and either a password or a private key)
  • An MCP client such as Claude Desktop or Cursor
1

Test the server with npx

Run the server directly with npx to verify it can connect to your SSH target before writing a config file.

npx -y @fangjunjie/ssh-mcp-server --host 192.168.1.1 --username admin --password yourpassword
2

Configure your MCP client with password authentication

Add ssh-mcp-server to your claude_desktop_config.json using password authentication. Replace the host, username, and password with your actual values.

3

Or configure with private key authentication

For key-based auth, pass the path to your private key file instead of a password. Optionally restrict which commands are allowed using the whitelist flag.

4

Add command restrictions for security

Use --whitelist to allow only specific commands (regex patterns), or --blacklist to block dangerous ones. This limits what the AI assistant can execute on your server.

5

Set up multiple servers via a config file

For managing multiple SSH targets, create a JSON config file listing each server and pass it with --config-file instead of inline arguments.

SSH MCP Examples

Client configuration

Three common configurations for claude_desktop_config.json: password auth, private key auth with whitelisting, and multiple servers via a config file.

{
  "mcpServers": {
    "ssh-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@fangjunjie/ssh-mcp-server",
        "--host", "192.168.1.1",
        "--username", "admin",
        "--password", "yourpassword"
      ]
    }
  }
}

Prompts to try

Use these prompts once the SSH MCP server is connected to your AI assistant.

- "Run 'df -h' on the server and show me disk usage for all mounted filesystems."
- "List all running Docker containers on the remote server."
- "Upload the file /local/path/config.yaml to /etc/myapp/config.yaml on the server."
- "Download /var/log/nginx/error.log from the server and summarise the last 50 errors."
- "Show me the list of configured SSH servers available."

Troubleshooting SSH MCP

Connection refused or SSH authentication fails

Verify the host IP, port (default is 22), username, and credentials are correct. For private key auth, ensure the key file path is absolute and the file is readable. For 2FA, set the SSH_MCP_2FA_CODE environment variable with your one-time code.

Commands are blocked or return permission denied errors

If you configured a --whitelist, check that the command pattern you are trying to run matches one of the allowed regex patterns. Whitelist patterns are matched against the full command string.

The server crashes or times out when running long-running commands

Switch from the default 'exec' transport mode to 'shell' mode by adding '--transport-mode shell' to your args. Shell mode maintains a persistent session better suited to interactive or long-running commands.

Frequently Asked Questions about SSH MCP

What is SSH MCP?

SSH MCP is a Model Context Protocol (MCP) server that enables ai assistants to securely execute remote ssh commands, perform file transfers, and monitor system status through a standardized interface. it features robust security controls including command whitelisting, blacklisting, and credential isola It connects AI assistants to external tools and data sources through a standardized interface.

How do I install SSH MCP?

Install via npm with the command: npx -y ssh. Then add the server configuration to your AI client's JSON config file (e.g., claude_desktop_config.json or .cursor/mcp.json).

Which AI clients work with SSH MCP?

SSH MCP works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is SSH MCP free to use?

Yes, SSH MCP is open source and available under the ISC License license. You can use it freely in both personal and commercial projects.

Browse More Developer Tools MCP Servers

Explore all developer tools servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

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

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use SSH MCP?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides