ProxmoxMCP-advance

Proxmox MCP Server Manager (Advanced Edition) is a tool designed to streamline the management of virtual machines. It allows for instant starting, stopping, and managing of VMs, as well as in-VM command execution and automated provisioning features. With a real-time overview of cluster resource status, monitoring the entire cluster becomes easy. Security is also a priority, with sensitive information managed securely, and seamless integration with VSCode enables automated workflows.

GitHub Stars

0

User Rating

Not Rated

Forks

0

Issues

0

Views

1

Favorites

0

README
๐Ÿฆธ Proxmox MCP Server Manager (Advanced Edition)

โœจ What's New in This Release

Advanced Features Recently Added:

  • ๐ŸŸข Start/Stop/Manage VMs: Instantly start, stop, or reboot any VM in your cluster.
  • ๐Ÿ–ฅ๏ธ In-VM Command Execution: Run system updates, install packages (e.g., nginx), and patch VMs directly from the MCP interface.
  • โšก Automated VM Provisioning: Spin up new VMs from any ISO with default or custom resources in a single command.
  • ๐Ÿ“Š Cluster Resource Overview: List all nodes, VMs, and storage pools with real-time status and resource usage.
  • ๐Ÿ”’ Secure Configuration: All sensitive credentials are managed via config files and environment variables, never hardcoded.
  • ๐Ÿง‘โ€๐Ÿ’ป Rich CLI/VSCode Integration: Seamless operation with Cline and VSCode for automated workflows.
  • ๐ŸŽฌ Demo Video: See ProxmoxMCP/Proxmox-adv-demo.webm for a walkthrough of these features.

๐Ÿ–ฅ๏ธ Setting Up Proxmox on a Virtual Machine Manager

๐Ÿ“ Step-by-step guide to install Proxmox using the official ISO:

  1. ๐Ÿ“ฅ Download the Proxmox ISO:

  2. ๐Ÿ†• Create a New Virtual Machine:

    • Open your Virtual Machine Manager (e.g., virt-manager, VMware, VirtualBox).
    • Create a new VM and select the downloaded Proxmox ISO as the installation media.
    • Assign at least 2 CPU cores, 4GB RAM, and 32GB disk (recommended for testing).
    • Configure networking (bridged or NAT as needed).
  3. ๐Ÿ’ฟ Install Proxmox:

    • Boot the VM from the ISO and follow the on-screen instructions to install Proxmox VE.
    • Set a secure password and note the IP address assigned to the VM.
  4. โš™๏ธ Initial Configuration:

    • Access the Proxmox web UI at https://<proxmox-vm-ip>:8006 from your browser.
    • Complete the setup wizard, configure storage, and create an admin user if needed.
  5. ๐Ÿ”‘ API Token Setup:

    • In the Proxmox web UI, go to Datacenter โ†’ Permissions โ†’ API Tokens.
    • Create a new API token for your user (e.g., Markermav@pam). #Example user here!
    • Save the token name and value securely.
  6. ๐Ÿ›ฐ๏ธ Enable QEMU Guest Agent (for VM command execution):

    • For each VM you want to manage, install the QEMU Guest Agent:
      apt-get update
      apt-get install -y qemu-guest-agent
      systemctl enable --now qemu-guest-agent
      
    • Ensure the agent is enabled in the VM's options settings in Proxmox.
    • Right click on VM โ†’ Options โ†’ enable QEMU Guest Agent. (**without this agent will not start)

๐Ÿ—‚๏ธ Configuration Example

proxmox-config/config.json (with sensitive info replaced):

{
    "proxmox": {
        "host": "proxmox.example.local",
        "port": 8006,
        "verify_ssl": false,
        "service": "PVE"
    },
    "auth": {
        "user": "Markermav@pam", #Example user here!
        "token_name": "mcp-token",
        "token_value": "your-token-value"
    },
    "logging": {
        "level": "DEBUG",
        "format": "%(asctime)s - %(name)s - %(levelname)s - %(message)s",
        "file": "proxmox_mcp.log"
    }
}

๐Ÿ“ฆ Installation
๐Ÿ› ๏ธ Prerequisites
  • ๐Ÿ Python 3.10+
  • ๐Ÿงฌ Git
  • ๐Ÿ“ฆ UV package manager (pip install uv)
  • ๐Ÿ”— Access to a Proxmox server with API token credentials
โšก Quick Install
git clone https://github.com/Markermav/ProxmoxMCP.git
cd ProxmoxMCP
uv venv
source .venv/bin/activate
uv pip install -e ".[dev]"
mkdir -p proxmox-config
cp config/config.example.json proxmox-config/config.json
# Edit proxmox-config/config.json with your Proxmox details

๐Ÿš€ Running the Server

Development Mode:

source .venv/bin/activate
python -m proxmox_mcp.server

Cline Desktop Integration:

Add this to your MCP settings (replace paths and sensitive info):

{
  "mcpServers": {
    "github.com/Markermav/ProxmoxMCP": {
      "command": "/home/Markermav/ProxmoxMCP/.venv/bin/python",
      "args": ["-m", "proxmox_mcp.server"],
      "cwd": "/home/Markermav/ProxmoxMCP",
      "env": {
        "PYTHONPATH": "/home/Markermav/ProxmoxMCP/src",
        "PROXMOX_MCP_CONFIG": "/home/Markermav/ProxmoxMCP/proxmox-config/config.json",
        "PROXMOX_HOST": "proxmox.example.local",
        "PROXMOX_USER": "Markermav@pam", #Example user here!
        "PROXMOX_TOKEN_NAME": "mcp-token",
        "PROXMOX_TOKEN_VALUE": "your-token-value",
        "PROXMOX_PORT": "8006",
        "PROXMOX_VERIFY_SSL": "false",
        "PROXMOX_SERVICE": "PVE",
        "LOG_LEVEL": "DEBUG"
      },
      "disabled": false,
      "autoApprove": []
    }
  }
}

๐Ÿงฐ Available Tools
  • ๐Ÿ–ฅ๏ธ List Nodes: View all nodes in the cluster with status and resource usage.
  • ๐Ÿ“ก Node Status: Get detailed info for any node.
  • ๐Ÿ—ƒ๏ธ List VMs: See all VMs, their status, and resources.
  • ๐Ÿ”„ VM State Management: Start, stop, reboot, suspend, or reset VMs.
  • ๐Ÿ›ฐ๏ธ In-VM Command Execution: Run any shell command in a VM (requires QEMU Guest Agent).
  • ๐Ÿ’พ Storage Overview: List all storage pools and usage.
  • ๐Ÿฅ Cluster Health: Get overall cluster status and health.

๐Ÿ—๏ธ Project Structure
proxmox-mcp/
โ”œโ”€โ”€ src/
โ”‚   โ””โ”€โ”€ proxmox_mcp/
โ”‚       โ”œโ”€โ”€ server.py
โ”‚       โ”œโ”€โ”€ config/
โ”‚       โ”œโ”€โ”€ core/
โ”‚       โ”œโ”€โ”€ formatting/
โ”‚       โ”œโ”€โ”€ tools/
โ”‚       โ”‚   โ””โ”€โ”€ console/
โ”‚       โ””โ”€โ”€ utils/
โ”œโ”€โ”€ tests/
โ”œโ”€โ”€ proxmox-config/
โ”‚   โ””โ”€โ”€ config.example.json
โ”œโ”€โ”€ pyproject.toml
โ””โ”€โ”€ LICENSE

๐Ÿ“„ License

MIT License

Author Information
Kalinga Swain

CKA | DevOps | Linux | AWS | CI/CD | Microservices | MACS Concordia University, Montrรฉal

Montreal, Canada

2

Followers

22

Repositories

0

Gists

0

Total Contributions

Threads