nera0875/mcp-ssh-vps
3.2
If you are the rightful owner of mcp-ssh-vps and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
A Model Context Protocol (MCP) server for managing SSH connections to VPS servers with root access.
Tools
6
Resources
0
Prompts
0
MCP SSH VPS Server
A Model Context Protocol (MCP) server for managing SSH connections to VPS servers with root access.
Features
- 🔐 Secure SSH connections with key or password authentication
- 🖥️ Execute commands remotely (with optional sudo)
- 📤 Upload files to VPS
- 📥 Download files from VPS
- 🔌 Multiple simultaneous connections
- ⚙️ Environment variable and JSON configuration support
Installation
From npm
npm install -g mcp-ssh-vps
From source
git clone https://github.com/neurodopa/mcp-ssh-vps.git
cd mcp-ssh-vps
npm install
npm run build
Configuration
Method 1: Environment Variables
Create a .env
file:
SSH_HOST=your-vps-ip
SSH_USERNAME=root
SSH_PORT=22
SSH_PRIVATE_KEY_PATH=~/.ssh/id_rsa
# or use password:
# SSH_PASSWORD=your-password
Method 2: JSON Configuration
Create ~/.mcp-ssh-vps/config.json
:
{
"production": {
"host": "192.168.1.100",
"username": "root",
"privateKeyPath": "~/.ssh/id_rsa",
"port": 22
},
"staging": {
"host": "staging.example.com",
"username": "root",
"password": "password123",
"port": 2222
}
}
Method 3: Claude Desktop Configuration
Add to your Claude Desktop config:
{
"mcpServers": {
"ssh-vps": {
"command": "npx",
"args": ["mcp-ssh-vps"],
"env": {
"SSH_HOST": "your-vps-ip",
"SSH_USERNAME": "root",
"SSH_PRIVATE_KEY_PATH": "~/.ssh/id_rsa"
}
}
}
}
Usage
Available Tools
ssh_connect
Connect to a VPS server.
{
"name": "production",
"host": "192.168.1.100",
"username": "root",
"privateKeyPath": "~/.ssh/id_rsa"
}
ssh_exec
Execute commands on the VPS.
{
"command": "ls -la /var/www",
"connection": "production",
"sudo": false
}
ssh_upload
Upload files to the VPS.
{
"localPath": "./deploy.tar.gz",
"remotePath": "/tmp/deploy.tar.gz",
"connection": "production"
}
ssh_download
Download files from the VPS.
{
"remotePath": "/var/log/app.log",
"localPath": "./logs/app.log",
"connection": "production"
}
ssh_disconnect
Close an SSH connection.
{
"connection": "production"
}
ssh_list_connections
List all active connections.
Security Best Practices
- Use SSH keys instead of passwords when possible
- Protect your private keys with appropriate permissions (600)
- Use passphrases for your SSH keys
- Store sensitive data in environment variables, not in code
- Limit root access - consider using sudo with a regular user
- Keep your VPS updated with security patches
Development
# Install dependencies
npm install
# Run in development mode
npm run dev
# Build for production
npm run build
# Run tests
npm test
License
MIT
Author
neurodopa
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.