SSH
Enables secure SSH connections to remote servers for executing shell commands and managing active sessions. It supports authentication via passwords or private keys and provides optional host-based access control.
What is SSH?
SSH is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to enables secure ssh connections to remote servers for executing shell commands and managing active sessions. it supports authentication via passwords or private keys and provides optional host-based ac...
Enables secure SSH connections to remote servers for executing shell commands and managing active sessions. It supports authentication via passwords or private keys and provides optional host-based access control.
This server falls under the Cloud Services category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- Enables secure SSH connections to remote servers for executi
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx mcp-sshConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use SSH
mcp-ssh is a TypeScript MCP server that enables AI assistants to establish and manage secure SSH connections to remote servers, execute shell commands within persistent sessions, and list or close active connections. It supports both password-based and private key authentication (inline or by file path), optional host allowlisting via MCP_SSH_ALLOWED_HOSTS, and configurable timeouts — making it suitable for DevOps automation, remote server management, and AI-driven infrastructure workflows.
Prerequisites
- Node.js 18 or newer (for local setup) OR Docker with Docker Compose (for containerized deployment)
- SSH access to the remote servers you want to manage (credentials or private key)
- An MCP-compatible client such as Claude Desktop or Cursor
- Git to clone the repository
Clone the repository
Clone the mcp-ssh repository to your local machine.
git clone https://github.com/atlcomgit/mcp-ssh.git
cd mcp-sshCreate your environment file
Copy the example environment file and configure it. Set MCP_SSH_ALLOWED_HOSTS to a comma-separated list of permitted hostnames if you want to restrict which servers the AI can connect to.
cp .env.example .env
# Edit .env and optionally set:
# MCP_SSH_ALLOWED_HOSTS=server1.example.com,server2.example.comInstall dependencies and build
Install npm dependencies and build the TypeScript project.
npm install
npm run buildRun the server
Start the MCP server in development mode or as a built binary. The server communicates over stdio as required by the MCP protocol.
npm run dev
# or after build:
npm startConfigure your MCP client
Add the mcp-ssh server to your Claude Desktop configuration. The server runs via stdio, so no port forwarding is needed.
SSH Examples
Client configuration
Claude Desktop configuration for mcp-ssh, running the built Node.js binary with an optional host allowlist.
{
"mcpServers": {
"mcp-ssh": {
"command": "node",
"args": ["/path/to/mcp-ssh/dist/index.js"],
"env": {
"MCP_SSH_ALLOWED_HOSTS": "myserver.example.com,staging.example.com"
}
}
}
}Prompts to try
Use these prompts to connect to remote servers and run commands through the AI assistant.
- "Connect to myserver.example.com as user 'deploy' using my private key at ~/.ssh/id_rsa"
- "Run 'df -h' on the connected server and show me disk usage"
- "List all active SSH sessions"
- "Execute 'systemctl status nginx' in the /etc directory on session abc-123"
- "Run 'tail -n 50 /var/log/app.log' and summarize any errors you find"
- "Disconnect from the SSH session when done"Troubleshooting SSH
Connection refused or timeout when using ssh_connect
Verify the target host and port are reachable from your machine with `ssh user@host`. Check firewall rules on the remote server. If using MCP_SSH_ALLOWED_HOSTS, ensure the hostname exactly matches one of the allowed entries.
Private key authentication fails
Ensure the private key path passed as privateKeyPath is correct and readable by the Node.js process. For inline keys (privateKey), the full PEM content must be provided. The remote server must have the corresponding public key in ~/.ssh/authorized_keys.
Command execution times out via ssh_exec
Increase the timeoutMs parameter when calling ssh_exec for long-running commands. For commands that produce continuous output (e.g., log tailing), break them into time-bounded invocations or use a specific line count with head/tail.
Frequently Asked Questions about SSH
What is SSH?
SSH is a Model Context Protocol (MCP) server that enables secure ssh connections to remote servers for executing shell commands and managing active sessions. it supports authentication via passwords or private keys and provides optional host-based access control. It connects AI assistants to external tools and data sources through a standardized interface.
How do I install SSH?
Follow the installation instructions on the SSH GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with SSH?
SSH works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is SSH free to use?
Yes, SSH is open source and available under the MIT License license. You can use it freely in both personal and commercial projects.
SSH Alternatives — Similar Cloud Services Servers
Looking for alternatives to SSH? Here are other popular cloud services servers you can use with Claude, Cursor, and VS Code.
Open WebUI
★ 138.2kUser-friendly AI Interface (Supports Ollama, OpenAI API, ...)
Anything LLM
★ 60.4kThe all-in-one AI productivity accelerator. On device and privacy first with no annoying setup or configuration.
LocalAI
★ 46.4kLocalAI is the open-source AI engine. Run any model - LLMs, vision, voice, image, video - on any hardware. No GPU required.
Nacos
★ 33.0kan easy-to-use dynamic service discovery, configuration and service management platform for building AI cloud native applications.
Xiaozhi ESP32
★ 26.7k本项目为xiaozhi-esp32提供后端服务,帮助您快速搭建ESP32设备控制服务器。Backend service for xiaozhi-esp32, helps you quickly build an ESP32 device control server.
Gateway
★ 11.8kA blazing fast AI Gateway with integrated guardrails. Route to 1,600+ LLMs, 50+ AI Guardrails with 1 fast & friendly API.
Browse More Cloud Services MCP Servers
Explore all cloud services servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up SSH in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use SSH?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.