Install
mcp-registry/ssh-mcp
ssh-mcp logo

ssh-mcp

Author: tufantunc

Description: Local MCP server that lets LLMs/other MCP clients run shell commands over SSH on Linux or Windows targets with configurable time-outs.

Stars: 51

Forks: 4

License: MIT License

Category: Open Source

Overview

Installation

Prerequisites
- Linux/macOS or WSL shell
- Node.js ≥ 18 and NPM/Yarn installed
- An SSH key-pair with access to the target Linux machines
Step-by-step
1. Clone the repository
git clone https://github.com/tufantunc/ssh-mcp.git cd ssh-mcp
2. Install dependencies
npm install # or: yarn install
3. Configure your environment
cp .env.example .env # open .env and supply values # SSH_HOST=192.168.1.20 # SSH_USER=ubuntu # SSH_PRIVATE_KEY=/home/you/.ssh/id_rsa # MCP_PORT=8080
4. Run tests (optional)
npm test
5. Start the MCP server
npm run start # production # or npm run dev # if nodemon/dev-watch is provided
6. The server now listens on the MCP_PORT you set (default 8080). Point any MCP-compatible client at `ws://<server-host>:8080`.
Docker (optional)
docker build -t ssh-mcp . docker run -d -p 8080:8080 \ -e SSH_HOST=192.168.1.20 \ -e SSH_USER=ubuntu \ -v $HOME/.ssh/id_rsa:/key/id_rsa:ro \ ssh-mcp

01

exec

Execute a shell command on the remote server

License: MIT License
Updated 7/30/2025