vps-mcp-server
Manage Docker containers — list, start, stop, restart, logs, stats, images
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@vps-mcp-serverRestart nginx and show recent logs"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
🖥️ VPS MCP Server
An MCP (Model Context Protocol) server that gives AI assistants full control over a VPS via SSH. Execute commands, manage files, control services, monitor resources, manage Docker containers, and configure firewalls — all through a secure SSH tunnel.
✨ Features
Tool | Description |
| Execute any shell command on the VPS |
| Read file contents via SFTP |
| Create or overwrite files via SFTP |
| List directory contents with detailed info |
| Start, stop, restart, reload, enable, disable systemd services & view logs |
| List systemd services filtered by state (running, failed, enabled) |
| Get CPU, memory, disk, network, uptime, and process stats |
| Manage Docker containers — list, start, stop, restart, logs, stats, images |
| Manage UFW rules — status, allow, deny, delete, reset |
Related MCP server: MCP VPS Manager
📦 Installation
# Clone the repository
git clone https://github.com/your-username/vps-mcp-server.git
cd vps-mcp-server
# Install dependencies
pnpm install
# Build
pnpm build⚙️ Configuration
Create a .env file from the example:
cp .env.example .envSet the following environment variables:
Variable | Required | Default | Description |
| ✅ | — | Hostname or IP of your VPS |
| ✅ | — | SSH username |
| ✅ | — | Absolute path to your SSH private key |
| ❌ |
| SSH port |
| ❌ | — | Passphrase for the SSH key (if encrypted) |
Example .env:
VPS_HOST=203.0.113.10
VPS_USER=deploy
VPS_KEY_PATH=/Users/you/.ssh/id_ed25519
VPS_PORT=22🚀 Usage
With Claude Desktop / Gemini CLI / Any MCP Client
Add the server to your MCP client configuration:
{
"mcpServers": {
"vps": {
"command": "node",
"args": ["/absolute/path/to/vps-mcp-server/dist/index.js"],
"env": {
"VPS_HOST": "203.0.113.10",
"VPS_USER": "deploy",
"VPS_KEY_PATH": "/Users/you/.ssh/id_ed25519"
}
}
}
}Development Mode
pnpm devProduction
pnpm build
pnpm start🛠️ Tools Reference
run_command
Execute a shell command on the VPS.
Parameter | Type | Required | Default | Description |
|
| ✅ | — | The shell command to execute |
|
| ❌ |
| Timeout in milliseconds |
|
| ❌ | — | Directory to run the command in |
Returns: JSON with exit_code, stdout, and stderr.
read_file
Read the contents of a file on the VPS via SFTP.
Parameter | Type | Required | Default | Description |
|
| ✅ | — | Absolute path to the file |
|
| ❌ | — | Max lines to return (omit for full file) |
write_file
Write content to a file on the VPS via SFTP.
Parameter | Type | Required | Default | Description |
|
| ✅ | — | Absolute path to the file |
|
| ✅ | — | Content to write |
|
| ❌ |
| Create parent directories if missing |
list_directory
List files and directories at a given path.
Parameter | Type | Required | Default | Description |
|
| ❌ |
| Directory path to list |
|
| ❌ |
| Include dotfiles |
|
| ❌ |
| Show permissions, size, date |
manage_service
Manage systemd services.
Parameter | Type | Required | Default | Description |
|
| ✅ | — | Service name (e.g., |
|
| ✅ | — |
|
|
| ❌ |
| Lines to show (for |
list_services
List systemd services filtered by state.
Parameter | Type | Required | Default | Description |
|
| ❌ |
|
|
system_stats
Get system resource usage.
Parameter | Type | Required | Default | Description |
|
| ❌ |
|
|
docker
Manage Docker containers.
Parameter | Type | Required | Default | Description |
|
| ✅ | — |
|
|
| ❌ | — | Container name/ID (required for |
|
| ❌ |
| Lines to show (for |
firewall
Manage UFW firewall rules.
Parameter | Type | Required | Default | Description |
|
| ✅ | — |
|
|
| ❌ | — | Rule spec (e.g., |
📁 Project Structure
src/
├── index.ts # Server bootstrap & lifecycle
├── ssh.ts # SSHManager class (connection pooling)
├── types.ts # Shared TypeScript types
├── helpers.ts # Response helper functions
└── tools/
├── index.ts # Tool registration barrel
├── run-command.ts # Shell command execution
├── read-file.ts # SFTP file reading
├── write-file.ts # SFTP file writing
├── list-directory.ts
├── manage-service.ts
├── list-services.ts
├── system-stats.ts
├── docker.ts
└── firewall.ts🔒 Security Notes
The server connects via SSH using key-based authentication (no passwords).
Commands run with the privileges of the configured SSH user.
Service management and firewall tools use
sudo— ensure your SSH user has appropriate sudoers permissions.The server maintains a persistent SSH connection that is automatically reconnected if dropped.
📄 License
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/harbouli/vps-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server