Get the FREE Ultimate OpenClaw Setup Guide →

ssh

SSH MCP Server - 基于 MCP 协议的安全远程服务器管理工具

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio jiahuidegit-ssh-mcp-server npx -y @erliban/ssh-mcp-server \
  --env SSH_MCP_LOG_LEVEL="info"

How to use

SSH MCP Server is a security-focused remote server management tool built around the MCP protocol. It enables safe, token-verified operations across one or more remote servers via SSH, including command execution and SFTP file transfers, with safeguards like target locking, alias-based routing, and environment labeling to ensure you always know which server you’re acting on. The server exposes tools for connecting to remote hosts, executing commands (including sudo and batched commands), managing persistent shells for bastion-style workflows, and performing file transfers. Clients can switch targets with cryptographic confirmations, preventing accidental commands on the wrong machine, and all outputs include server identity and environment context for auditability.

How to install

Prerequisites:

  • Node.js 20+ and npm installed on the host
  • Network access to install or run the MCP server

Option A: Run with npx (recommended)

  1. Ensure Node.js/npm are installed
  2. Run:
npx @erliban/ssh-mcp-server

Option B: Global installation

  1. Install globally:
npm install -g @erliban/ssh-mcp-server
  1. Start the server:
ssh-mcp-server

Option C: Build from source

  1. Clone the repository:
git clone https://github.com/jiahuidegit/ssh-mcp-server.git
cd ssh-mcp-server
  1. Install dependencies and build:
npm install
npm run build

Notes:

  • The server exposes an MCP interface compatible with various MCP clients. See the README for integration details.

Additional notes

Tips and common considerations:

  • The recommended usage is via npx to always fetch the latest release, especially for security updates.
  • The SSH MCP Server supports environment labeling and target locking to prevent misrouted commands; ensure your MCP client supplies explicit targets when multiple servers are connected.
  • Configure logging via SSH_MCP_LOG_LEVEL (debug/info/warn/error) and optionally SSH_MCP_LOG_FILE for persistent logs.
  • If you enable private key-based connections, you can pass keys as content or file paths; ensure proper permissions for key files.
  • Review the MCP Tools section in the README to understand the available commands like connect, disconnect, save_server, list_servers, and remove_server.

Related MCP Servers

Sponsor this space

Reach thousands of developers