MCP SSH Server
Securely execute remote commands and perform file operations over SSH, with support for both password and key-based authentication.
MCP SSH Server
A powerful SSH server implementation for Model Context Protocol (MCP). This server enables secure remote command execution and file operations through SSH protocol, supporting both password and key-based authentication.
Features
- ✨ Secure SSH connection management
- 🔑 Password and key-based authentication
- 💻 Remote command execution
- 📁 File operations (upload/download)
- 📊 Progress tracking for file transfers
- 🔐 Permission management
- 📂 Directory operations
- 🚀 Bulk file transfers
- 📝 Detailed logging
Installation
- Install the package:
npm install mcp-ssh
- Add to your Claude desktop config (
claude_desktop_config.json):
{
"mcpServers": {
"ssh": {
"command": "node",
"args": ["%APPDATA%/npm/node_modules/mcp-ssh/dist/server.js"],
"env": {
"SSH_PORT": "8889",
"SSH_LOG_LEVEL": "info"
}
}
}
}
Usage
Password Authentication
$body = @{
id = "test"
host = "example.com"
port = 22
username = "user"
password = "pass123"
} | ConvertTo-Json
Invoke-RestMethod -Uri "http://localhost:8889/connect" -Method Post -Body $body -ContentType "application/json"
Key Authentication
$body = @{
id = "test"
host = "example.com"
port = 22
username = "user"
privateKey = Get-Content ~/.ssh/id_rsa | Out-String
passphrase = "optional-key-passphrase" # if your key is protected
} | ConvertTo-Json
Invoke-RestMethod -Uri "http://localhost:8889/connect" -Method Post -Body $body -ContentType "application/json"
Execute Commands
$execBody = @{
id = "test"
command = "ls -la"
} | ConvertTo-Json
Invoke-RestMethod -Uri "http://localhost:8889/exec" -Method Post -Body $execBody -ContentType "application/json"
File Operations
# Upload file
$uploadForm = @{
file = Get-Item -Path "localfile.txt"
remotePath = "/remote/path/file.txt"
}
Invoke-RestMethod -Uri "http://localhost:8889/upload/test" -Method Post -Form $uploadForm
# Download file
Invoke-RestMethod -Uri "http://localhost:8889/download/test?remotePath=/remote/path/file.txt" -Method Get -OutFile "downloaded.txt"
Directory Operations
# List directory
Invoke-RestMethod -Uri "http://localhost:8889/ls/test?path=/remote/path" -Method Get
# Get connection status
Invoke-RestMethod -Uri "http://localhost:8889/status/test" -Method Get
Development
- Clone the repository:
git clone https://github.com/shaike1/mcp-server-ssh.git
cd mcp-server-ssh
- Install dependencies:
npm install
- Build:
npm run build
- Start server:
npm start
Environment Variables
SSH_PORT: Server port (default: 8889)SSH_LOG_LEVEL: Logging level (default: info)
Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
MIT
Related Servers
Currents
Enable AI Agents to fix Playwright test failures reported to Currents.
i18next MCP Server
An MCP server for managing translations in i18next projects, allowing AI assistants to interact directly with translation files.
Hippycampus
Turns any Swagger/OpenAPI REST endpoint with a yaml/json definition into an MCP Server with Langchain/Langflow integration automatically.
Metasploit MCP Server
An MCP server for integrating with the Metasploit Framework, enabling payload generation and management.
PolyMarket
Access prediction market data from the PolyMarket API.
Remote MCP Server (Authless)
An example of a remote MCP server deployable on Cloudflare Workers without authentication.
Python Weather Server
A FastAPI-based server that provides weather information from the National Weather Service API, secured with OAuth 2.1.
Yellhorn MCP
An MCP server that integrates Gemini 2.5 Pro and OpenAI models for software development tasks, allowing the use of your entire codebase as context.
Multichain MCP Server
A toolkit for building and deploying AI agents with blockchain capabilities, featuring a Model Context Protocol (MCP) server.
ZeroPath MCP Server
Interact with your product security findings using natural language.