Skip to main content

Read-only Model Context Protocol server for VMware vCenter Server Appliance and VCF-aligned operations

Project description

vcenter-mcp

License: MIT PyPI Python 3.10+

Ask GitHub Copilot questions about your Broadcom VCF and VMware vCenter environment in plain English — clusters, datacenters, datastores, folders, hosts, networks, resource pools, VMs, guest details, appliance version and time, and more — directly from VS Code.

Supports Broadcom VCF vCenter Server Appliance and VMware vCenter Server Appliance — with per-vCenter credentials stored securely in your OS keyring (Windows Credential Manager / macOS Keychain / Linux Secret Service).

Requirements

Quick start

# 1. Install
pip install vcenter-mcp

# 2. Create a folder for your inventory, navigate to it, and run the wizard
mkdir my-vcenter && cd my-vcenter
vcenter-mcp configure

The wizard will:

  • Verify Python 3.10+ is active
  • Install / update all dependencies
  • Register your vCenter Server Appliance instance(s) in inventory.yaml
  • Store credentials securely in the OS keyring — no plain-text passwords anywhere
  • Write .vscode/mcp.json pointing VS Code at the server (no credentials in this file)
# 3. Open the folder in VS Code
code .

In VS Code, open Copilot Chat, switch to Agent mode, and start asking questions.

Already set up? Re-run vcenter-mcp configure at any time to add new vCenter instances and to update credentials.

Configuration

Credential storage

Credentials are stored in the OS keyring under the service name vcenter-mcp. Key format:

Entity Keyring key examples
vCenter (default) vcenter.default.username, vcenter.default.password
vCenter (override) vcenter.VCENTER-NAME.username, vcenter.VCENTER-NAME.password

Lookup falls back from named entry → vcenter.default.* → environment variables (VCENTER_USERNAME etc.) for compatibility and automation.

vCenter inventory — inventory.yaml

Register your instances here. Edit directly or re-run vcenter-mcp configure.

vcenters:
  - name: PROD-VCENTER-1
    fqdn: vcsa01.example.local
    ip_address: 192.168.1.10
    verify_ssl: false

  - name: PROD-VCENTER-2
    fqdn: vcsa02.example.local
    ip_address: 192.168.1.11
    verify_ssl: true
  • name — label used in prompts and tool parameters (vcenter_name)
  • fqdn or ip_address — at least one is required; if both are provided, fqdn is preferred
  • Single entry → selected automatically; multiple entries → specify the name in your prompt

VS Code — .vscode/mcp.json

Generated by vcenter-mcp configure. Contains no credentials:

{
  "servers": {
    "vcenter-mcp": {
      "type": "stdio",
      "command": "vcenter-mcp",
      "env": {
        "VCENTER_MCP_INVENTORY": "${workspaceFolder}/inventory.yaml"
      }
    }
  }
}

Usage

Switch Copilot Chat to Agent mode and ask in plain English:

List all VMs and their power state
Show me all clusters and datacenters
Which hosts are in the cluster and what version are they running?
List all datastores and their free capacity
Show me the networks in vCenter
Get guest identity details for VM <vm-id>
Show me the appliance version and time

Target a specific vCenter by name:

List all VMs from PROD-VCENTER-1
Show appliance version for PROD-VCENTER-1
List all datastores from PROD-VCENTER-2

Copilot calls list_vcenters automatically when needed to discover available entries.

Project structure

vcenter-mcp/
├── inventory.yaml              vCenter registry (user-generated)
├── pyproject.toml              Package metadata and dependencies
├── available_tools.md          Full tool reference
└── src/
    └── vcenter_mcp/
        ├── __init__.py
        ├── app.py              Shared FastMCP instance ("vcenter-mcp")
        ├── cli.py              Entry point — 'vcenter-mcp' and 'vcenter-mcp configure'
        ├── server.py           Thin wrapper delegating to cli.main()
        ├── credentials.py      OS keyring read/write helpers
        ├── registry.py         Inventory loading, host+credential resolver, JSON helper
        ├── client.py           HTTP client: session auth, GET, read-only POST actions
        ├── vsphere_ws.py       vSphere Web Services helpers for ESXi host detail
        └── tools/
            ├── inventory.py            list_vcenters, get_vcenter_inventory
            ├── vcenter_inventory.py    list_clusters, get_cluster,
            │                           list_datacenters, get_datacenter,
            │                           list_datastores, get_datastore,
            │                           list_folders,
            │                           list_hosts, get_host,
            │                           list_networks,
            │                           list_resource_pools, get_resource_pool,
            │                           list_vms, get_vm, get_vm_power
            ├── vm_details.py           get_vm_guest_identity, list_vm_guest_local_filesystems,
            │                           list_vm_guest_network_interfaces, get_vm_hardware,
            │                           get_vm_boot, get_vm_cpu, get_vm_memory,
            │                           list_vm_disks, get_vm_disk,
            │                           list_vm_nics, get_vm_nic
            └── appliance.py            get_appliance_version, get_appliance_time,
                                        get_appliance_time

See available_tools.md for the full tool reference including parameters, return values, and source modules.

Notes

  • All tools are read-only — no changes are made to your vCenter environment
  • Uses the vCenter REST API at /api/* over HTTPS, typically port 443
  • Uses the vSphere Web Services API through vCenter for list_hosts and get_host, because REST host detail coverage is not available in your vCenter API surface
  • Authentication uses POST /api/session and reuses the session token for tool calls
  • If multiple vCenters are configured, specify vcenter_name to target the correct instance
  • Transport is stdio — the server runs locally and is managed by VS Code

Disclaimer

This is an independent, community-built project and is not an official Broadcom or VMware product. It is not affiliated with, endorsed by, or supported by Broadcom Inc. or VMware by Broadcom in any way. VMware, vSphere, vCenter, and VCF are trademarks of their respective owners.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vcenter_mcp-0.1.1.tar.gz (17.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vcenter_mcp-0.1.1-py3-none-any.whl (17.5 kB view details)

Uploaded Python 3

File details

Details for the file vcenter_mcp-0.1.1.tar.gz.

File metadata

  • Download URL: vcenter_mcp-0.1.1.tar.gz
  • Upload date:
  • Size: 17.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for vcenter_mcp-0.1.1.tar.gz
Algorithm Hash digest
SHA256 4a8680dd79f3f1234edfe945280e71d2e694306aa8ba2e5e19774bf2e98fe570
MD5 15f9c5fdce8cb8469d599962e4f7bd75
BLAKE2b-256 f43c574e523e127246b2038fa6e934705d1359bdbcc2b572ee26e0d242b33b51

See more details on using hashes here.

File details

Details for the file vcenter_mcp-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: vcenter_mcp-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 17.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for vcenter_mcp-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8ff7891bbbc2462deac1566b11ab2c8e406870fea799ae2da24a89387fd1b210
MD5 e92d72e0d325bfa74e360acf8b8d233c
BLAKE2b-256 a84bba5ad0e7e3afd28aa5a6990b5f33f94821707c1db98b699993f4bc6b80da

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page