A Node.js-based Model Context Protocol (MCP) server for interacting with Proxmox hypervisors, providing a clean interface for managing nodes, VMs, and containers with configurable permission levels.
This project is based on the original Python implementation by canvrno/ProxmoxMCP. This Node.js version maintains the same core functionality while adapting it for JavaScript/Node.js environments and adding configurable permission management.
Architecture Changes:
- β Complete rewrite from Python to Node.js
- β
Uses
@modelcontextprotocol/sdkinstead of Python MCP SDK - β Environment variable configuration instead of JSON config files
- β Simplified dependency management with npm
New Features:
- π Configurable Permission Levels:
PROXMOX_ALLOW_ELEVATEDsetting for security - π‘οΈ Basic Mode: Safe operations (node listing, VM status) with minimal permissions
- π Elevated Mode: Advanced features (detailed metrics, command execution) requiring full permissions
- π Better Error Handling: Clear permission warnings and graceful degradation
- π§ Auto Environment Loading: Automatically loads
.envfiles from parent directories
- Node.js - JavaScript runtime
- @modelcontextprotocol/sdk - Model Context Protocol SDK for Node.js
- node-fetch - HTTP client for API requests
- π Configurable Security: Two permission levels for safe operation
- π οΈ Built with the official MCP SDK for Node.js
- π Secure token-based authentication with Proxmox
- π₯οΈ Comprehensive node and VM management
- π» VM console command execution (elevated mode)
- π Real-time resource monitoring
- π¨ Rich markdown-formatted output
- β‘ Fast Node.js performance
- π§ Easy environment-based configuration
Proxmox.Manager.Demo.mp4
- Node.js 16+ and npm
- Git
- Access to a Proxmox server with API token credentials
Before starting, ensure you have:
- Node.js and npm installed
- Proxmox server hostname or IP
- Proxmox API token (see API Token Setup)
-
Clone and set up:
git clone https://github.com/gilby125/mcp-proxmox.git cd mcp-proxmox npm install -
Create
.envfile with your Proxmox configuration:# Proxmox Configuration PROXMOX_HOST=192.168.1.100 PROXMOX_USER=root@pam PROXMOX_TOKEN_NAME=mcp-server PROXMOX_TOKEN_VALUE=your-token-value-here PROXMOX_ALLOW_ELEVATED=false # Set to 'true' for advanced features
Note:
PROXMOX_PORTdefaults to 8006 and can be omitted unless using a custom port.
Basic Mode (PROXMOX_ALLOW_ELEVATED=false):
- List cluster nodes and their status
- List VMs and containers
- Basic cluster health overview
- Requires minimal API token permissions
Elevated Mode (PROXMOX_ALLOW_ELEVATED=true):
- All basic features plus:
- Detailed node resource metrics
- VM command execution
- Advanced cluster statistics
- Requires API token with
Sys.Audit,VM.Monitor,VM.Consolepermissions
-
Test the MCP server:
echo '{"jsonrpc": "2.0", "id": 1, "method": "tools/list"}' | node index.js
-
Test a basic API call:
echo '{"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "proxmox_get_nodes", "arguments": {}}}' | node index.js
You should see either:
- A successful list of your Proxmox nodes
- Or a connection/permission error with helpful guidance
- Log into your Proxmox web interface
- Navigate to Datacenter β Permissions β API Tokens
- Click Add to create a new API token:
- User: Select existing user (e.g.,
root@pam) - Token ID: Enter a name (e.g.,
mcp-server) - Privilege Separation: Uncheck for full access or leave checked for limited permissions
- Click Add
- User: Select existing user (e.g.,
- Important: Copy both the Token ID and Secret immediately (secret is only shown once)
- Use Token ID as
PROXMOX_TOKEN_NAME - Use Secret as
PROXMOX_TOKEN_VALUE
- Use Token ID as
Permission Requirements:
- Basic Mode: Minimal permissions (usually default user permissions work)
- Elevated Mode: Add permissions for
Sys.Audit,VM.Monitor,VM.Consoleto the user/token
node index.jsFor Claude Code or other MCP clients, add this to your MCP configuration:
{
"mcpServers": {
"mcp-proxmox": {
"command": "node",
"args": ["index.js"],
"cwd": "/absolute/path/to/mcp-proxmox"
}
}
}Important:
- Replace
/absolute/path/to/mcp-proxmoxwith the actual path to your installation - The server automatically loads environment variables from
.envfiles - Ensure the
.envfile is in the same directory asindex.jsor a parent directory
The server provides the following MCP tools for interacting with Proxmox:
Lists all nodes in the Proxmox cluster with their status and resources.
- Parameters: None
- Example Response:
π₯οΈ **Proxmox Cluster Nodes** π’ **pve1** β’ Status: online β’ Uptime: 3d 2h 53m β’ CPU: 1.8% β’ Memory: 5.89 GB / 62.21 GB (9.5%) β’ Load: N/A
Get detailed status of a specific node (requires elevated permissions).
- Parameters:
node(string, required): Name of the node
- Example Response (Basic Mode):
β οΈ **Node Status Requires Elevated Permissions** To view detailed node status, set `PROXMOX_ALLOW_ELEVATED=true` in your .env file and ensure your API token has Sys.Audit permissions. **Current permissions**: Basic (node listing only)
List all virtual machines across the cluster with their status.
- Parameters:
node(string, optional): Filter by specific nodetype(string, optional): VM type filter ('qemu', 'lxc', 'all'), default: 'all'
- Example Response:
π» **Virtual Machines** π’ π¦ **docker** (ID: 100) β’ Node: pve1 β’ Status: running β’ Type: LXC β’ Uptime: 5h 40m β’ CPU: 0.8% β’ Memory: 7.46 GB / 46.88 GB π΄ π¦ **ubuntu1** (ID: 115) β’ Node: pve1 β’ Status: stopped β’ Type: LXC
Get detailed status information for a specific VM.
- Parameters:
node(string, required): Node name where VM is locatedvmid(string, required): VM ID numbertype(string, optional): VM type ('qemu', 'lxc'), default: 'qemu'
- Example Response:
π’ π¦ **docker** (ID: 100) β’ **Node**: pve1 β’ **Status**: running β’ **Type**: LXC β’ **Uptime**: 5h 42m β’ **CPU Usage**: 0.8% β’ **Memory**: 7.47 GB / 46.88 GB (15.9%) β’ **Disk Read**: 19.74 GB β’ **Disk Write**: 21.71 GB β’ **Network In**: 1.32 GB β’ **Network Out**: 216.56 MB
List all storage pools and their usage across the cluster.
- Parameters:
node(string, optional): Filter by specific node
- Example Response:
πΎ **Storage Pools** π’ **local** β’ Node: pve1 β’ Type: dir β’ Content: vztmpl,iso,backup β’ Usage: 19.58 GB / 93.93 GB (20.8%) β’ Status: Enabled π’ **zfs** β’ Node: pve1 β’ Type: zfspool β’ Content: rootdir,images β’ Usage: 87.33 MB / 899.25 GB (0.0%) β’ Status: Enabled
Get overall cluster status including nodes and resource usage.
- Parameters: None
- Example Response (Basic Mode):
ποΈ **Proxmox Cluster Status** **Cluster Health**: π’ Healthy **Nodes**: 1/1 online β οΈ **Limited Information**: Resource usage requires elevated permissions **Node Details**: π’ pve1 - online
Execute a shell command on a virtual machine via Proxmox API (requires elevated permissions).
- Parameters:
node(string, required): Node name where VM is locatedvmid(string, required): VM ID numbercommand(string, required): Shell command to executetype(string, optional): VM type ('qemu', 'lxc'), default: 'qemu'
- Example Response (Basic Mode):
β οΈ **VM Command Execution Requires Elevated Permissions** To execute commands on VMs, set `PROXMOX_ALLOW_ELEVATED=true` in your .env file and ensure your API token has appropriate VM permissions. **Current permissions**: Basic (VM listing only) **Requested command**: `uptime` - Requirements (Elevated Mode):
- VM must be running
- For QEMU: QEMU Guest Agent must be installed and running
- For LXC: Direct execution via Proxmox API
- Appropriate API token permissions
# Install dependencies
npm install
# Run server (production)
npm start
# or
node index.js
# Run server with auto-reload (development)
npm run dev
# Test MCP server functionality
echo '{"jsonrpc": "2.0", "id": 1, "method": "tools/list"}' | node index.js
# Test specific API call
echo '{"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "proxmox_get_nodes", "arguments": {}}}' | node index.js- The server loads environment variables from
.envfiles automatically - Use
npm run devfor development with auto-reload on file changes - All API calls require a proper
.envconfiguration - Check the server logs for connection and permission issues
mcp-proxmox/
βββ index.js # Main MCP server implementation
βββ package.json # Node.js dependencies and scripts
βββ package-lock.json # Dependency lock file
βββ .env # Environment configuration (not in git)
βββ node_modules/ # Dependencies (not in git)
βββ README.md # This documentation
MIT License