
How to add SSH MCP Server to Claude Desktop
Execute shell commands on remote Linux and Windows servers over SSH via MCP. Paste the config into ~/Library/Application Support/Claude/claude_desktop_config.json and restart Claude Desktop.
Last updated June 14, 2026 ยท 504โ ยท stdio ยท no auth
Claude Desktop config for SSH MCP Server
npx -y ssh-mcp{
"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"
]
}
}
}Setup steps
- 1Open Claude Desktop โ Settings โ Developer โ Edit Config (this opens ~/Library/Application Support/Claude/claude_desktop_config.json).
- 2Paste the SSH MCP Server config below under the top-level "mcpServers" key.
- 3Fill in any placeholder secrets (API keys, paths) in the snippet.
- 4Save the file, then fully quit and reopen Claude Desktop.
- 5Open a chat and confirm SSH MCP Server's tools appear under the ๐ tools menu.
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
What SSH MCP Server can do in Claude Desktop
execExecute 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-execExecute 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.
Security
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 + Claude Desktop FAQ
Where is the Claude Desktop config file?
Claude Desktop reads MCP servers from ~/Library/Application Support/Claude/claude_desktop_config.json. Paste the SSH MCP Server config there under the "mcpServers" key and restart the client.
Is SSH MCP Server safe to use with Claude Desktop?
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.
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.