Get the FREE Ultimate OpenClaw Setup Guide →

ssh

MCP server exposing SSH control for Linux servers via Model Context Protocol.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
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:

  1. Clone the repository: git clone https://github.com/tufantunc/ssh-mcp.git cd ssh-mcp

  2. Install dependencies: npm install

  3. Run the server (example): npm run start

  4. (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

Sponsor this space

Reach thousands of developers