Enhanced Proxmox MCP server with advanced virtualization management and full OpenAPI integration.
ProxmoxMCP-Plus - Enhanced Proxmox MCP Server
An enhanced Python-based Model Context Protocol (MCP) server for interacting with Proxmox virtualization platforms. This project is built upon canvrno/ProxmoxMCP with numerous new features and improvements, providing complete OpenAPI integration and more powerful virtualization management capabilities.
Acknowledgments
This project is built upon the excellent open-source project ProxmoxMCP by @canvrno. Thanks to the original author for providing the foundational framework and creative inspiration!
๐ New Features and Improvements
Major enhancements compared to the original version:
-
โจ Complete VM Lifecycle Management
- Brand new
create_vm
tool - Support for creating virtual machines with custom configurations - New
delete_vm
tool - Safe VM deletion (with force deletion option) - Enhanced intelligent storage type detection (LVM/file-based)
- Brand new
-
๐ง Extended Power Management Features
start_vm
- Start virtual machinesstop_vm
- Force stop virtual machinesshutdown_vm
- Graceful shutdownreset_vm
- Restart virtual machines
-
๐ณ New Container Support
get_containers
- List all LXC containers and their status
-
๐ Enhanced Monitoring and Display
- Improved storage pool status monitoring
- More detailed cluster health status checks
- Rich output formatting and themes
-
๐ Complete OpenAPI Integration
- 11 complete REST API endpoints
- Production-ready Docker deployment
- Perfect Open WebUI integration
- Natural language VM creation support
-
๐ก๏ธ Production-grade Security and Stability
- Enhanced error handling mechanisms
- Comprehensive parameter validation
- Production-level logging
- Complete unit test coverage
Built With
- Cline - Autonomous coding agent - Go faster with Cline
- Proxmoxer - Python wrapper for Proxmox API
- MCP SDK - Model Context Protocol SDK
- Pydantic - Data validation using Python type annotations
Features
- ๐ค Full integration with Cline and Open WebUI
- ๐ ๏ธ Built with the official MCP SDK
- ๐ Secure token-based authentication with Proxmox
- ๐ฅ๏ธ Complete VM lifecycle management (create, start, stop, reset, shutdown, delete)
- ๐ป VM console command execution
- ๐ณ LXC container management support
- ๐๏ธ Intelligent storage type detection (LVM/file-based)
- ๐ Configurable logging system
- โ Type-safe implementation with Pydantic
- ๐จ Rich output formatting with customizable themes
- ๐ OpenAPI REST endpoints for integration
- ๐ก 11 fully functional API endpoints
Installation
Prerequisites
- UV package manager (recommended)
- Python 3.10 or higher
- Git
- Access to a Proxmox server with API token credentials
Before starting, ensure you have:
- [ ] Proxmox server hostname or IP
- [ ] Proxmox API token (see API Token Setup)
- [ ] UV installed (
pip install uv
)
Option 1: Quick Install (Recommended)
-
Clone and set up environment:
# Clone repository git clone https://github.com/RekklesNA/ProxmoxMCP-Plus.git cd ProxmoxMCP-Plus # Create and activate virtual environment uv venv source .venv/bin/activate # Linux/macOS # OR .\.venv\Scripts\Activate.ps1 # Windows
-
Install dependencies:
# Install with development dependencies uv pip install -e ".[dev]"
-
Create configuration:
# Create config directory and copy template mkdir -p proxmox-config cp proxmox-config/config.example.json proxmox-config/config.json
-
Edit
proxmox-config/config.json
:{ "proxmox": { "host": "PROXMOX_HOST", # Required: Your Proxmox server address "port": 8006, # Optional: Default is 8006 "verify_ssl": false, # Optional: Set false for self-signed certs "service": "PVE" # Optional: Default is PVE }, "auth": { "user": "USER@pve", # Required: Your Proxmox username "token_name": "TOKEN_NAME", # Required: API token ID "token_value": "TOKEN_VALUE" # Required: API token value }, "logging": { "level": "INFO", # Optional: DEBUG for more detail "format": "%(asctime)s - %(name)s - %(levelname)s - %(message)s", "file": "proxmox_mcp.log" # Optional: Log to file } }
Verifying Installation
-
Check Python environment:
python -c "import proxmox_mcp; print('Installation OK')"
-
Run the tests:
pytest
-
Verify configuration:
# Linux/macOS PROXMOX_MCP_CONFIG="proxmox-config/config.json" python -m proxmox_mcp.server # Windows (PowerShell) $env:PROXMOX_MCP_CONFIG="proxmox-config\config.json"; python -m proxmox_mcp.server
Configuration
Proxmox API Token Setup
- Log into your Proxmox web interface
- Navigate to Datacenter -> Permissions -> API Tokens
- Create a new API token:
- Select a user (e.g., root@pam)
- Enter a token ID (e.g., "mcp-token")
- Uncheck "Privilege Separation" if you want full access
- Save and copy both the token ID and secret
Running the Server
Development Mode
For testing and development:
# Activate virtual environment first
source .venv/bin/activate # Linux/macOS
# OR
.\.venv\Scripts\Activate.ps1 # Windows
# Run the server
python -m proxmox_mcp.server
OpenAPI Deployment (Production Ready)
Deploy ProxmoxMCP Plus as standard OpenAPI REST endpoints for integration with Open WebUI and other applications.
Quick OpenAPI Start
# Install mcpo (MCP-to-OpenAPI proxy)
pip install mcpo
# Start OpenAPI service on port 8811
./start_openapi.sh
Docker Deployment
# Build and run with Docker
docker build -t proxmox-mcp-api .
docker run -d --name proxmox-mcp-api -p 8811:8811 \
-v $(pwd)/proxmox-config:/app/proxmox-config proxmox-mcp-api
# Or use Docker Compose
docker-compose up -d
Access OpenAPI Service
Once deployed, access your service at:
- ๐ API Documentation: http://your-server:8811/docs
- ๐ง OpenAPI Specification: http://your-server:8811/openapi.json
- โค๏ธ Health Check: http://your-server:8811/health
Cline Desktop Integration
For Cline users, add this configuration to your MCP settings file (typically at ~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
):
{
"mcpServers": {
"ProxmoxMCP-Plus": {
"command": "/absolute/path/to/ProxmoxMCP-Plus/.venv/bin/python",
"args": ["-m", "proxmox_mcp.server"],
"cwd": "/absolute/path/to/ProxmoxMCP-Plus",
"env": {
"PYTHONPATH": "/absolute/path/to/ProxmoxMCP-Plus/src",
"PROXMOX_MCP_CONFIG": "/absolute/path/to/ProxmoxMCP-Plus/proxmox-config/config.json",
"PROXMOX_HOST": "your-proxmox-host",
"PROXMOX_USER": "username@pve",
"PROXMOX_TOKEN_NAME": "token-name",
"PROXMOX_TOKEN_VALUE": "token-value",
"PROXMOX_PORT": "8006",
"PROXMOX_VERIFY_SSL": "false",
"PROXMOX_SERVICE": "PVE",
"LOG_LEVEL": "DEBUG"
},
"disabled": false,
"autoApprove": []
}
}
}
Available Tools & API Endpoints
The server provides 11 comprehensive MCP tools and corresponding REST API endpoints:
VM Management Tools
create_vm
Create a new virtual machine with specified resources.
Parameters:
node
(string, required): Name of the nodevmid
(string, required): ID for the new VMname
(string, required): Name for the VMcpus
(integer, required): Number of CPU cores (1-32)memory
(integer, required): Memory in MB (512-131072)disk_size
(integer, required): Disk size in GB (5-1000)storage
(string, optional): Storage pool nameostype
(string, optional): OS type (default: l26)
API Endpoint:
POST /create_vm
Content-Type: application/json
{
"node": "pve",
"vmid": "200",
"name": "my-vm",
"cpus": 1,
"memory": 2048,
"disk_size": 10
}
Example Response:
๐ VM 200 created successfully!
๐ VM Configuration:
โข Name: my-vm
โข Node: pve
โข VM ID: 200
โข CPU Cores: 1
โข Memory: 2048 MB (2.0 GB)
โข Disk: 10 GB (local-lvm, raw format)
โข Storage Type: lvmthin
โข Network: virtio (bridge=vmbr0)
โข QEMU Agent: Enabled
๐ง Task ID: UPID:pve:001AB729:0442E853:682FF380:qmcreate:200:root@pam!mcp
VM Power Management ๐
start_vm: Start a virtual machine
POST /start_vm
{"node": "pve", "vmid": "200"}
stop_vm: Force stop a virtual machine
POST /stop_vm
{"node": "pve", "vmid": "200"}
shutdown_vm: Gracefully shutdown a virtual machine
POST /shutdown_vm
{"node": "pve", "vmid": "200"}
reset_vm: Reset (restart) a virtual machine
POST /reset_vm
{"node": "pve", "vmid": "200"}
delete_vm ๐: Completely delete a virtual machine
POST /delete_vm
{"node": "pve", "vmid": "200", "force": false}
๐ Container Management Tools
get_containers ๐
List all LXC containers across the cluster.
API Endpoint: POST /get_containers
Example Response:
๐ณ Containers
๐ณ nginx-server (ID: 200)
โข Status: RUNNING
โข Node: pve
โข CPU Cores: 2
โข Memory: 1.5 GB / 2.0 GB (75.0%)
Monitoring Tools
get_nodes
Lists all nodes in the Proxmox cluster.
API Endpoint: POST /get_nodes
Example Response:
๐ฅ๏ธ Proxmox Nodes
๐ฅ๏ธ pve-compute-01
โข Status: ONLINE
โข Uptime: โณ 156d 12h
โข CPU Cores: 64
โข Memory: 186.5 GB / 512.0 GB (36.4%)
get_node_status
Get detailed status of a specific node.
Parameters:
node
(string, required): Name of the node
API Endpoint: POST /get_node_status
get_vms
List all VMs across the cluster.
API Endpoint: POST /get_vms
get_storage
List available storage pools.
API Endpoint: POST /get_storage
get_cluster_status
Get overall cluster status and health.
API Endpoint: POST /get_cluster_status
execute_vm_command
Execute a command in a VM's console using QEMU Guest Agent.
Parameters:
node
(string, required): Name of the node where VM is runningvmid
(string, required): ID of the VMcommand
(string, required): Command to execute
API Endpoint: POST /execute_vm_command
Requirements:
- VM must be running
- QEMU Guest Agent must be installed and running in the VM
Open WebUI Integration
Configure Open WebUI
- Access your Open WebUI instance
- Navigate to Settings โ Connections โ OpenAPI
- Add new API configuration:
{
"name": "Proxmox MCP API Plus",
"base_url": "http://your-server:8811",
"api_key": "",
"description": "Enhanced Proxmox Virtualization Management API"
}
Natural Language VM Creation
Users can now request VMs using natural language:
- "Can you create a VM with 1 cpu core and 2 GB ram with 10GB of storage disk"
- "Create a new VM for testing with minimal resources"
- "I need a development server with 4 cores and 8GB RAM"
The AI assistant will automatically call the appropriate APIs and provide detailed feedback.
Storage Type Support
Intelligent Storage Detection
ProxmoxMCP Plus automatically detects storage types and selects appropriate disk formats:
LVM Storage (local-lvm, vm-storage)
- โ
Format:
raw
- โ High performance
- โ ๏ธ No cloud-init image support
File-based Storage (local, NFS, CIFS)
- โ
Format:
qcow2
- โ Cloud-init support
- โ Flexible snapshot capabilities
Project Structure
ProxmoxMCP-Plus/
โโโ ๐ src/ # Source code
โ โโโ proxmox_mcp/
โ โโโ server.py # Main MCP server implementation
โ โโโ config/ # Configuration handling
โ โโโ core/ # Core functionality
โ โโโ formatting/ # Output formatting and themes
โ โโโ tools/ # Tool implementations
โ โ โโโ vm.py # VM management (create/power) ๐
โ โ โโโ container.py # Container management ๐
โ โ โโโ console/ # VM console operations
โ โโโ utils/ # Utilities (auth, logging)
โ
โโโ ๐ tests/ # Unit test suite
โโโ ๐ test_scripts/ # Integration tests & demos
โ โโโ README.md # Test documentation
โ โโโ test_vm_power.py # VM power management tests ๐
โ โโโ test_vm_start.py # VM startup tests
โ โโโ test_create_vm.py # VM creation tests ๐
โ โโโ test_openapi.py # OpenAPI service tests
โ
โโโ ๐ proxmox-config/ # Configuration files
โ โโโ config.json # Server configuration
โ
โโโ ๐ Configuration Files
โ โโโ pyproject.toml # Project metadata
โ โโโ docker-compose.yml # Docker orchestration
โ โโโ Dockerfile # Docker image definition
โ โโโ requirements.in # Dependencies
โ
โโโ ๐ Scripts
โ โโโ start_server.sh # MCP server launcher
โ โโโ start_openapi.sh # OpenAPI service launcher
โ
โโโ ๐ Documentation
โโโ README.md # This file
โโโ VM_CREATION_GUIDE.md # VM creation guide
โโโ OPENAPI_DEPLOYMENT.md # OpenAPI deployment
โโโ LICENSE # MIT License
Testing
Run Unit Tests
pytest
Run Integration Tests
cd test_scripts
# Test VM power management
python test_vm_power.py
# Test VM creation
python test_create_vm.py
# Test OpenAPI service
python test_openapi.py
API Testing with curl
# Test node listing
curl -X POST "http://your-server:8811/get_nodes" \
-H "Content-Type: application/json" \
-d "{}"
# Test VM creation
curl -X POST "http://your-server:8811/create_vm" \
-H "Content-Type: application/json" \
-d '{
"node": "pve",
"vmid": "300",
"name": "test-vm",
"cpus": 1,
"memory": 2048,
"disk_size": 10
}'
Production Security
API Key Authentication
Set up secure API access:
export PROXMOX_API_KEY="your-secure-api-key"
export PROXMOX_MCP_CONFIG="/app/proxmox-config/config.json"
Nginx Reverse Proxy
Example nginx configuration:
server {
listen 80;
server_name your-domain.com;
location / {
proxy_pass http://localhost:8811;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
}
Troubleshooting
Common Issues
-
Port already in use
netstat -tlnp | grep 8811 # Change port if needed mcpo --port 8812 -- ./start_server.sh
-
Configuration errors
# Verify config file cat proxmox-config/config.json
-
Connection issues
# Test Proxmox connectivity curl -k https://your-proxmox:8006/api2/json/version
View Logs
# View service logs
tail -f proxmox_mcp.log
# Docker logs
docker logs proxmox-mcp-api -f
Deployment Status
โ Feature Completion: 100%
- [x] VM Creation (user requirement: 1 CPU + 2GB RAM + 10GB storage) ๐
- [x] VM Power Management (start VPN-Server ID:101) ๐
- [x] VM Deletion Feature ๐
- [x] Container Management (LXC) ๐
- [x] Storage Compatibility (LVM/file-based)
- [x] OpenAPI Integration (port 8811)
- [x] Open WebUI Integration
- [x] Error Handling & Validation
- [x] Complete Documentation & Testing
Production Ready!
ProxmoxMCP Plus is now fully ready for production use!
When users say "Can you create a VM with 1 cpu core and 2 GB ram with 10GB of storage disk", the AI assistant can:
- ๐ Call the
create_vm
API - ๐ง Automatically select appropriate storage and format
- ๐ฏ Create VMs that match requirements
- ๐ Return detailed configuration information
- ๐ก Provide next-step recommendations
Development
After activating your virtual environment:
- Run tests:
pytest
- Format code:
black .
- Type checking:
mypy .
- Lint:
ruff .
License
MIT License
Special Thanks
- Thanks to @canvrno for the excellent foundational project ProxmoxMCP
- Thanks to the Proxmox community for providing the powerful virtualization platform
- Thanks to all contributors and users for their support
Ready to Deploy! ๐ Your enhanced Proxmox MCP service with OpenAPI integration is ready for production use.