$git clone https://github.com/classfang/ssh-mcp-serverSSH-based MCP (Model Context Protocol) server that allows remote execution of SSH commands via the MCP protocol.
| 1 | # 🔐 ssh-mcp-server |
| 2 | |
| 3 |  |
| 4 |  |
| 5 |  |
| 6 |  |
| 7 |  |
| 8 |  |
| 9 |  |
| 10 | |
| 11 | SSH-based MCP (Model Context Protocol) server that allows remote execution of SSH commands via the MCP protocol. |
| 12 | |
| 13 | English Document | [中文文档](README_CN.md) |
| 14 | |
| 15 | ## 📝 Project Overview |
| 16 | |
| 17 | ssh-mcp-server is a bridging tool that enables AI assistants and other applications supporting the MCP protocol to execute remote SSH commands through a standardized interface. This allows AI assistants to safely operate remote servers, execute commands, and retrieve results without directly exposing SSH credentials to AI models. |
| 18 | |
| 19 | Welcome to join wechat group: |
| 20 | |
| 21 |  |
| 22 | |
| 23 | > Scan the code with wechat and reply "Join group". |
| 24 | |
| 25 | ## ✨ Key Features |
| 26 | |
| 27 | - **🔒 Secure Connections**: Supports multiple secure SSH connection methods, including password authentication and private key authentication (with passphrase support) |
| 28 | - **🛡️ Command Security Control**: Precisely control the range of allowed commands through flexible blacklist and whitelist mechanisms to prevent dangerous operations |
| 29 | - **🔄 Standardized Interface**: Complies with MCP protocol specifications for seamless integration with AI assistants supporting the protocol |
| 30 | - **🚇 Dual Transport Modes**: Supports both `exec` and `shell` transport modes for direct SSH hosts and bastion or jump-host scenarios |
| 31 | - **📂 File Transfer**: Supports bidirectional file transfers, uploading local files to servers or downloading files from servers |
| 32 | - **🔑 Credential Isolation**: SSH credentials are managed entirely locally and never exposed to AI models, enhancing security |
| 33 | - **🚀 Ready to Use**: Can be run directly using NPX without global installation, making it convenient and quick to deploy |
| 34 | |
| 35 | ## 📦 Open Source Repository |
| 36 | |
| 37 | GitHub: [https://github.com/classfang/ssh-mcp-server](https://github.com/classfang/ssh-mcp-server) |
| 38 | |
| 39 | NPM: [https://www.npmjs.com/package/@fangjunjie/ssh-mcp-server](https://www.npmjs.com/package/@fangjunjie/ssh-mcp-server) |
| 40 | |
| 41 | ## 🛠️ Tools List |
| 42 | |
| 43 | | Tool | Name | Description | |
| 44 | |---------|-----------|----------| |
| 45 | | execute-command | Command Execution Tool | Execute SSH commands on remote servers and get results | |
| 46 | | upload | File Upload Tool | Upload local files to specified locations on remote servers | |
| 47 | | download | File Download Tool | Download files from remote servers to local specified locations | |
| 48 | | list-servers | List Servers Tool | List all available SSH server configurations | |
| 49 | |
| 50 | ## 📚 Usage |
| 51 | |
| 52 | ### 0. 🤖 Quick Setup via AI Skill (Recommended) |
| 53 | |
| 54 | If you are using an AI coding assistant that supports skills (such as Claude Code), you can use the built-in **ssh-mcp-helper** skill to complete the installation and configuration interactively — no need to manually edit JSON files. |
| 55 | |
| 56 | **How to use:** |
| 57 | |
| 58 | 1. Install the skill from this repository's `skills/` directory |
| 59 | 2. Tell your AI assistant: "Help me set up ssh-mcp-server" or "Configure SSH MCP for my remote server" |
| 60 | 3. The skill will guide you step by step: check Node.js environment → choose MCP client → select authentication method → collect connection parameters → generate and write configuration |
| 61 | |
| 62 | The skill supports all scenarios covered below (password, private key, SSH config reuse, SOCKS proxy, bastion hosts, multi-connection, 2FA, command restrictions, etc.) and automatically produces correctly formatted configuration. |
| 63 | |
| 64 | --- |
| 65 | |
| 66 | The sections below are arranged f |