VPS Docker MCP (Advanced)
Provides tools for managing Docker containers and Docker Compose projects on a remote VPS, including diagnostics, container operations, and compose management.
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 Docker MCP (Advanced)Check the VPS health and show Docker container status."
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 Docker MCP — Advanced
MCP server for Claude Code that provides safe VPS diagnostics and Docker/Docker Compose management over SSH.
Architecture
Claude Code
|
| MCP / stdio
v
Local Python MCP server
|
| SSH / AsyncSSH
v
VPS
|
+-- systemd
+-- Docker
+-- Docker ComposeThe MCP server runs locally. Nothing needs to listen on the VPS.
Module layout
src/vps_docker_mcp/
├── server.py # MCP instance, wires modules together
├── ssh.py # SSH config, run_ssh/run_many helpers
├── docker.py # Docker and Docker Compose tools
└── infrastructure.py # VPS diagnostics toolsRelated MCP server: Docker/Hetzner MCP Server
Security model
This project intentionally does not expose arbitrary shell execution.
There is no:
ssh(command)
execute(command)
bash(command)Instead, every operation is a predefined MCP tool.
Arguments such as container and service names are validated with a restrictive allow-list pattern and shell-quoted before being inserted into commands.
SSH host key checking is enabled through VPS_KNOWN_HOSTS.
Use a dedicated non-root SSH account, e.g. deploy, with Docker access.
Requirements
Python 3.11+
uvSSH access
Docker on VPS
Docker Compose v2 if Compose tools are used
deployuser with permission to run Docker
Installation
uv syncConfigure:
cp .env.example .envExample:
VPS_HOST=YOUR_VPS_IP
VPS_PORT=22
VPS_USER=deploy
VPS_SSH_KEY=~/.ssh/vps_mcp
VPS_KNOWN_HOSTS=~/.ssh/known_hosts
DOCKER_COMPOSE_DIR=/opt/news-bot
MAX_OUTPUT_CHARS=20000Test SSH independently:
ssh -i ~/.ssh/vps_mcp deploy@YOUR_VPS_IP docker psTest MCP:
uv run vps-docker-mcpIt will wait for MCP stdio input. That is expected.
Claude Code configuration
Copy .mcp.json.example to the project-level .mcp.json used by Claude Code and replace the absolute path.
Example:
{
"mcpServers": {
"vps-docker": {
"type": "stdio",
"command": "uv",
"args": [
"--directory",
"/home/me/projects/vps-docker-mcp-advanced",
"run",
"vps-docker-mcp"
]
}
}
}Then start/restart Claude Code and inspect MCP status with:
/mcpDepending on the Claude Code version, MCP servers can also be managed with the Claude Code CLI.
Tool groups
VPS diagnostics
system_infodisk_usagetop_processesnetwork_infosystemd_failedjournal_errorsdiagnose_vps
Docker read-only
docker_psdocker_logsdocker_inspectdocker_statsdocker_healthdocker_imagesdocker_volumesdocker_networksdocker_disk_usage
Docker mutations
docker_restartdocker_startdocker_stop
Docker Compose
Read-only:
docker_compose_psdocker_compose_configdocker_compose_logs
Mutating:
docker_compose_restartdocker_compose_pulldocker_compose_up
Restricted diagnostics
diagnostic_command only permits a fixed list:
pwd
whoami
date
df
free
uptime
docker_version
docker_info
It does not accept arbitrary shell syntax.
Example Claude Code requests
Check the VPS health.Claude can use:
diagnose_vpsFor a broken container:
Find out why news-bot is unhealthy.A useful diagnostic sequence is:
docker_health
docker_ps
docker_logs
docker_stats
docker_inspectFor a general resource problem:
Check whether the VPS is running out of RAM or disk space.Claude can inspect:
system_info
disk_usage
top_processes
docker_stats
docker_disk_usageThen:
Restart news-bot if the diagnosis indicates that a restart is appropriate.The restart operation is a separate mutating tool.
Important production recommendation
Keep Claude Code's own permission/approval mechanism enabled for mutating operations.
The MCP server intentionally labels mutating tools in their descriptions, but MCP itself should not be treated as an authorization boundary.
For a production VPS, do not add arbitrary shell execution unless you deliberately accept the risk.
Future improvements
Good next additions would be:
application-specific health checks
Docker container restart-loop detection
OOM detection
disk growth detection
systemd service restart tools
configurable allow-list of Compose projects
audit logging
command execution timeouts per tool
separate read-only and write SSH credentials
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityCmaintenanceEnables AI assistants to securely execute remote SSH commands, perform file transfers, and monitor system status through a standardized interface. It features robust security controls including command whitelisting, blacklisting, and credential isolation to prevent unauthorized operations.1022MIT
- Alicense-quality-maintenanceProvides tools for managing Docker containers, Compose stacks, and system resources on Hetzner servers via SSH. It also includes capabilities for reloading Caddy configurations and managing Cloudflare DNS records.
- Alicense-qualityDmaintenanceEnables LLMs to securely manage Virtual Private Servers via SSH, with features including command execution, file operations, system monitoring, and service management.MIT
- AlicenseAqualityAmaintenanceEnables AI assistants to perform controlled Linux system administration tasks like reading logs, managing services, cron jobs, WordPress, and executing sandboxed Python code, with strict security constraints.292GPL 2.0
Related MCP Connectors
Let AI operate servers without SSH. Choose actions, approve risky changes, and audit every step.
Operate Linux, macOS and Windows from your LLM. Every action runs through an auditable allowlist.
Execute PowerShell commands securely with controlled timeouts and input validation. Retrieve syste…
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- 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/mordanov/vps_mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server