MCP Directory

SSH MCP Server

Execute shell commands on remote Linux and Windows servers over SSH via MCP.

Unverified
stdio (local)
No auth
TypeScript

Add to your client

Copy the config for your MCP client and paste it into its config file.

Install / run
npx -y ssh-mcp

Paste into ~/Library/Application Support/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "ssh-mcp-server": {
      "command": "npx",
      "args": [
        "ssh-mcp",
        "-y",
        "--",
        "--host=1.2.3.4",
        "--port=22",
        "--user=root",
        "--password=pass",
        "--key=path/to/key",
        "--timeout=30000",
        "--maxChars=none"
      ]
    }
  }
}

Step-by-step guides: Add to Claude Desktop · Add to Cursor · Add to Windsurf

Before you start

  • Node.js (per package engines)
  • A reachable SSH server (Linux or Windows) with host, username, and password or SSH private key
  • An MCP client such as Claude Desktop, Claude Code, Cursor, or Windsurf

About SSH MCP Server

SSH MCP Server is a local, MCP-compliant server that lets LLMs and MCP clients (Claude Desktop, Claude Code, Cursor, Windsurf, etc.) execute shell commands on remote Linux and Windows servers over SSH. Authentication is via password or SSH private key. It supports configurable command timeouts with automatic process abortion, a maximum command-length limit, and optional sudo/su privilege elevation. Connection details and credentials are supplied as command-line arguments in the MCP client configuration.

Tools & capabilities (2)

exec

Execute a shell command on the remote SSH server. Parameters: command (required) — shell command to execute; description (optional) — note appended as a comment. Subject to the configurable --timeout (default 60000ms) and --maxChars limit (default 1000, disable with none or 0).

sudo-exec

Execute a shell command with sudo elevation as root. Parameters: command (required); description (optional). Requires --sudoPassword for password-protected sudo (or use --suPassword for a persistent root shell). Subject to the same --timeout and --maxChars settings. Not available when the server is started with --disableSudo.

When to use it

  • Run remote shell commands on a Linux or Windows server via natural language
  • Automate server administration and DevOps tasks through an LLM
  • Inspect logs, processes, and system status on a remote host
  • Perform privileged operations on a remote server using sudo/su elevation

Security notes

Grants an MCP client the ability to run arbitrary shell commands on a remote server over SSH, including optional sudo/su root elevation. Credentials (password, SSH key path, sudo/su passwords) are passed as command-line arguments in the client config. Use a least-privilege SSH account, prefer key-based auth, and pass `--disableSudo` when root access is not needed. Provided under the MIT License; use at your own risk.

SSH MCP Server FAQ

Which authentication methods are supported?

Password authentication via --password, or SSH key-based authentication via --key (path to a private SSH key). Optional --sudoPassword and --suPassword enable privileged operations.

How do I add it to Claude Code?

Use the claude mcp add command, e.g. `claude mcp add --transport stdio ssh-mcp -- npx -y ssh-mcp -- --host=YOUR_HOST --user=YOUR_USER --password=YOUR_PASSWORD`. Scopes can be set with --scope local|project|user.

Can I disable sudo access?

Yes. Pass the --disableSudo flag at startup and the sudo-exec tool will not be registered at all, which is useful when sudo access is not needed or not available.

How are command timeouts handled?

Timeout is set via --timeout in milliseconds (default 60000ms = 1 minute). When a command times out, the server attempts to abort the running process before closing the connection.

Alternatives to SSH MCP Server

Compare all alternatives →

GitHub's official server for repos, issues, PRs, and Actions — local Docker or hosted remote.

Featured
Verified
stdio (local)
API key
Go
7 tools
Updated 7 days agoRepo

Official AWS Labs server that lets agents call any AWS API via the AWS CLI surface.

Verified
stdio (local)
API key
Python
3 tools
Updated 9 days agoRepo

Bulk Kubernetes port forwarding with an MCP server that lets AI assistants forward services, inspect pods, and monitor traffic.

Unverified
stdio (local)
No auth
Go
28 tools
Updated 1 day agoRepo