ssh
MCP server exposing SSH control for Linux servers via Model Context Protocol.
claude mcp add --transport stdio tufantunc-ssh-mcp npx ssh-mcp -y -- --host=YOUR_HOST --port=22 --user=YOUR_USER
How to use
SSH MCP Server exposes remote SSH control via MCP so you can run shell commands on a Linux or Windows host through an MCP client. The server implements tools such as exec for executing arbitrary commands on the remote machine, and sudo-exec for commands that require elevated privileges. It supports authentication via password or SSH keys, configurable timeouts, and an optional persistent root shell via su. To use it, configure an MCP client (for example Claude Code, Windsurf, or any MCP-compatible client) to connect to the SSH MCP Server using the provided host, port, user, and authentication details. Once connected, you can issue natural language prompts or structured tool invocations that translate into SSH commands executed on the remote host. The server handles timeouts and attempts graceful termination of commands when limits are reached.
How to install
Prerequisites:
- Node.js (and npm) installed on the machine where you will run the MCP server
- Internet access to install dependencies from npm registry
Installation steps:
-
Clone the repository: git clone https://github.com/tufantunc/ssh-mcp.git cd ssh-mcp
-
Install dependencies: npm install
-
Run the server (example): npm run start
-
(Optional) Build for production if applicable per repository scripts: npm run build
Note: The README indicates this is a TypeScript/Node.js project built with the official MCP SDK, so running npm install and then starting the server with the typical npm start or equivalent script defined in package.json is expected. Ensure your environment has network access to fetch packages and that any required SSH tools are available on the host where commands will run.
Additional notes
Tips and tips:
- Ensure SSH authentication details are correctly configured in your MCP client (host, port, user, and either password or key path).
- The exec tool runs arbitrary shell commands on the remote system; secure usage by limiting what commands can be executed and by enabling appropriate authentication controls.
- The sudo-exec tool requires --sudoPassword (or suPassword for a persistent root shell); you can disable this tool entirely with --disableSudo if not needed.
- Timeout behavior: the server enforces a timeout (default 60000 ms) and will attempt to abort long-running processes when a timeout occurs.
- Max command length: configure maxChars (default 1000); set to none or 0 to disable the limit.
- If you run into SSH connection issues, verify network reachability, firewall rules, and that the SSH server accepts the provided credentials or key.
- When using Claude or similar clients, you can add the MCP server using the provided npx command template to integrate with your workflow.
Related MCP Servers
iterm
A Model Context Protocol server that executes commands in the current iTerm session - useful for REPL and CLI assistance
mcp
Octopus Deploy Official MCP Server
furi
CLI & API for MCP management
editor
MCP Server for Phaser Editor
DoorDash
MCP server from JordanDalton/DoorDash-MCP-Server
mcp
MCP сервер для автоматического создания и развертывания приложений в Timeweb Cloud