Vcenter MCP

MCPAI代理

提供方 davlloyd

AI代理 stdio · 本地进程 会话登录 社区 / 第三方
查看接入方式

为VMware vCenter提供只读访问服务的MCP协议服务器,支持集群、资源池和虚拟机等资源查询。

一句话选型结论

按资料字段整理

Vcenter MCP 属于AI代理类 MCP 服务器,stdio · 本地进程,会话登录,有可直接执行的安装命令。接入前先确认权限范围;涉及写入、删除或付款的操作,建议先在测试环境验证。

分类AI代理 传输方式stdio · 本地进程 鉴权会话登录 部署方式本地部署
GitHub 星标 0 仓库热度,无公开仓库时显示未标注
工具数 5 暴露给模型的工具数量
资源 / 提示词 0 / 0 资源与提示词模板数量
维护方 社区 / 第三方 核验等级 仅资料核对

工具与能力

AI代理
数量来自来源目录的标注,具体工具清单以官方文档为准
工具数量5暴露给模型可调用的工具个数
资源数量0可读取的资源条目
提示词数量0内置提示词模板数量

能力标签

适用场景

虚拟化管理Python本地部署云计算RESTAPIMCP协议只读访问

安装与配置

stdio · 本地进程 会话登录
客户端在本机拉起子进程,数据不出本机
python -m venv venv

这条命令只是入口,具体启动参数请按官方文档补齐,不要直接照搬到别的服务器。

  1. 1
    准备运行环境

    stdio 服务在本地起进程,需要先装好 Python,再按安装命令拉取依赖。

  2. 2
    安装服务

    复制上面的安装命令执行;命令里带占位符的位置,换成自己的密钥或路径。

  3. 3
    写入客户端配置

    在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,让新配置生效。

  4. 4
    验证是否可用

    连接成功后客户端会列出约 5 个工具,随便调一个只读工具确认能返回结果。

典型使用场景

3 类
按分类与标签整理的常见用法,具体以官方文档为准
给代理接外部能力

让代理在任务中途调用搜索、数据库等真实工具。

多步任务编排

把一串操作拆成步骤,由代理按顺序执行。

自动化重复流程

把固定流程交给代理跑,减少手工操作。

选择建议

选之前先看这几条
按条目字段给出的判断,不替你决定用不用

值得选的地方

  • 资料标注 5 个工具,职责相对集中,接入后不容易误操作。
  • 有现成的安装命令,不用自己找入口,照着跑就能起服务。

先想清楚的地方

  • stdio 方式要求本地装好运行时(如 Node.js),换机器要重新装一遍。
  • 使用前要准备好会话登录对应的凭据,并按最小权限配置。
  • 版本更新与行为细节以官方仓库为准。

更适合

  • 需要在AI代理场景里让模型直接调用外部能力的人。
  • 想先快速试一下、能接受在本地或自有环境跑服务的人。

不太适合

  • 完全不想在本地装环境的人。
  • 不方便管理密钥或第三方授权的人。
  • 需要厂商级 SLA 和技术支持的生产环境。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
MCP 服务器工具数传输方式部署方式安装命令最后核验
Vcenter MCP当前 5 stdio · 本地进程 本地部署 有 2026-05-17
Filesystem 560c4363 13 未标注 本地部署 无 2026-05-17
Server Everything (everything) 11 stdio · 本地进程 本地部署 有 2026-05-17
Time 7365cb6d 2 SSE · 服务端推送 远程部署 有 2026-05-18
Everything Claude Code 未标注 stdio · 本地进程 本地部署 有 2026-05-17
Openmemory 557e1585 未标注 stdio · 本地进程 本地部署 有 2026-05-17

服务器档案

AI代理
字段来自项目仓库与公开索引,中文说明由本站标注
提供方davlloyd上游标注的维护方 davlloyd
分类AI代理本站按上游分类展示
连接方式stdio · 本地进程客户端在本机拉起子进程,数据不出本机
鉴权方式会话登录远程服务建议用最小权限凭据
维护方社区 / 第三方核验等级 仅资料核对
包名 / 运行时未标注 · Python本地安装时用到的包标识与运行时
部署类型本地部署上游给出的部署形态
最近核验2026-05-17上游最后核验时间

详细介绍

13.5 KB
来自项目仓库与上游目录的原文,未做删改

vCenter MCP Server

A Model Context Protocol (MCP) server for VMware vCenter that provides read-only access to vCenter resources including clusters, resource pools, and virtual machines.

Features

  • Read-only access to vCenter resources
  • Cloud Foundry deployment support for Tanzu Cloud Foundry
  • Flexible credential management via environment variables or Cloud Foundry service bindings
  • vCenter REST API integration for all operations
  • FastMCP framework for MCP protocol support
  • MVC architecture following software design best practices
  • Comprehensive testing with pytest
  • Type hints throughout the codebase

Supported Operations

  1. List all clusters - Get all clusters in vCenter
  2. List VMs in cluster - Get all virtual machines in a specific cluster
  3. List resource pools - Get all resource pools in a specific cluster
  4. List VMs in resource pool - Get all virtual machines in a specific resource pool
  5. Get vCenter status - Get connection status and basic statistics

Project Structure (MVC Architecture)```

vcenter-mcp/
├── main/ # Main application package
│ ├── init.py
│ ├── main.py # Application entry point
│ ├── server_factory.py # Server creation and MVC initialization
│ ├── models/ # Data models (M in MVC)
│ │ ├── init.py
│ │ └── vcenter_config.py # Configuration and data models
│ ├── views/ # Presentation layer (V in MVC)
│ │ ├── init.py
│ │ └── mcp_tools.py # MCP tools and formatting
│ ├── controllers/ # Business logic (C in MVC)
│ │ ├── init.py
│ │ └── vcenter_controller.py # Main controller
│ ├── services/ # Service layer
│ │ ├── init.py
│ │ └── vcenter_service.py # vCenter API service
│ └── config/ # Configuration management
│ ├── init.py
│ └── config_manager.py # Configuration and credentials
├── tests/ # Test suite
│ ├── init.py
│ ├── test_config.py # Configuration tests
│ └── test_mvc_structure.py # MVC structure tests
├── app.py # Legacy entry point
├── test_connection.py # Connection testing utility
├── config.env.example # Environment configuration template
├── setup_env.py # Environment setup script
├── requirements.txt # Python dependencies
├── setup.py # Package setup
├── pyproject.toml # Modern Python packaging
├── manifest.yml # Cloud Foundry manifest
├── Procfile # Cloud Foundry process
├── runtime.txt # Python runtime version
└── README.md # This file


## Architecture Overview

### MVC Pattern Implementation

- **Models** (`main/models/`): Data structures and configuration models
  - `VCenterConfig`: Configuration for vCenter connection
  - `Cluster`, `ResourcePool`, `VirtualMachine`: Data models for vCenter resources

- **Views** (`main/views/`): Presentation layer for MCP tools
  - `MCPToolsView`: Handles MCP tool registration and data formatting
  - Formats data for display to MCP clients

- **Controllers** (`main/controllers/`): Business logic and coordination
  - `VCenterController`: Main controller that coordinates between models and views
  - Handles data transformation and business rules

- **Services** (`main/services/`): Data access layer
  - `VCenterService`: Handles vCenter REST API interactions
  - Manages HTTP requests and responses

- **Config** (`main/config/`): Configuration management
  - `ConfigManager`: Handles credentials and environment configuration
  - Supports Cloud Foundry service bindings

- **Server Factory** (`main/server_factory.py`): Application initialization
  - `create_mcp_server()`: Creates and configures the MCP server
  - Handles proper MVC component initialization
  - Resolves circular import issues

## Prerequisites

- **Python 3.12+** (Required - tested with Python 3.12.3, Cloud Foundry uses python-3.12.*)
- VMware vCenter server with REST API access
- vCenter credentials (username/password)

## Installation

### Development Installation

1. Clone this repository:```bash
git clone <repository-url>
cd vcenter-mcp
  1. Create a virtual environment:```bash
    python -m venv venv
    source venv/bin/activate # On Windows: venv\Scripts\activate

3. Install in development mode:```bash
pip install -e .
  1. Install development dependencies:```bash
    pip install -e ".[dev]"

### Production Installation```bash
pip install vcenter-mcp

Configuration

Environment Setup

The easiest way to set up your environment is using the provided setup script:```bash

Interactive setup

python setup_env.py

View current configuration (passwords are masked)

python setup_env.py show


### Manual Environment Variables

Alternatively, you can manually set the following environment variables for vCenter access:```bash
export VCENTER_HOST="https://your-vcenter-server.com"
export VCENTER_USERNAME="your-username"
export VCENTER_PASSWORD="your-password"

# Optional configuration
export VCENTER_VERIFY_SSL="true"  # Default: true
export VCENTER_TIMEOUT="30"       # Default: 30 seconds
export LOG_LEVEL="INFO"           # Default: INFO

Using .env File

Create a .env file in the project root with the following content:```bash

Copy from config.env.example and update with your values

VCENTER_HOST=https://your-vcenter-server.com
VCENTER_USERNAME=your-username
VCENTER_PASSWORD=your-password
VCENTER_VERIFY_SSL=true
VCENTER_TIMEOUT=30
LOG_LEVEL=INFO


### Cloud Foundry Service Binding

Alternatively, you can bind to a vCenter service in Cloud Foundry. The service should provide credentials in the following format:```json
{
  "host": "https://your-vcenter-server.com",
  "username": "your-username",
  "password": "your-password"
}

Usage

Command Line

Run the MCP server:```bash

Using the package

python -m main

Using the console script (if installed)

vcenter-mcp

Using the legacy entry point

python app.py


### Programmatic Usage```python
from main.config.config_manager import ConfigManager
from main.controllers.vcenter_controller import VCenterController

# Get configuration
config_manager = ConfigManager()
config = config_manager.get_vcenter_config()

# Create controller and run MCP server
controller = VCenterController(config)
app = controller.create_mcp_server()
app.run()

Testing Configuration

After setting up your environment, test your vCenter connection:```bash

Test connection and basic API calls

python test_connection.py

View current configuration (passwords are masked)

python setup_env.py show


## Cloud Foundry Deployment

The application is configured for Cloud Foundry with flexible Python versioning:
- **Runtime**: `python-3.12.*` (allows automatic updates to any 3.12.x version)
- **Buildpack**: `python_buildpack`
- **Memory**: 256M
- **Disk**: 512M
- **Transport**: HTTP using FastMCP's async `http` transport (compatible with Spring AI WebMVC)
- **Health Check**: HTTP endpoint at `/health`

### Deploy to Tanzu Cloud Foundry

1. Login to your Cloud Foundry instance:```bash
cf login -a https://api.your-cf-instance.com
  1. Set the target organization and space:```bash
    cf target -o your-org -s your-space

3. Deploy the application:```bash
cf push

Environment Variables in Cloud Foundry

Set environment variables for vCenter access:```bash
cf set-env vcenter-mcp-server VCENTER_HOST "https://your-vcenter-server.com"
cf set-env vcenter-mcp-server VCENTER_USERNAME "your-username"
cf set-env vcenter-mcp-server VCENTER_PASSWORD "your-password"


### Optional: Bind to vCenter Service

If you have a vCenter service available in your Cloud Foundry marketplace:```bash
cf create-service vcenter-service standard vcenter-service
cf bind-service vcenter-mcp-server vcenter-service

MCP Tools

The MCP server provides the following tools with proper names and descriptions for better discovery:

1. List Clusters (list_clusters)

Description: List all clusters in vCenter. Returns a formatted list of all available clusters with their names and IDs.

Usage:```
list_clusters()


### 2. List VMs in Cluster (`list_vms_in_cluster`)
**Description**: List all virtual machines in a specific cluster. Requires the cluster name as input and returns a formatted list of VMs with their names and power states.

**Usage**:```
list_vms_in_cluster(cluster_name: str)

3. List Resource Pools (list_resource_pools)

Description: List all resource pools in a specific cluster. Requires the cluster name as input and returns a formatted list of resource pools with their names and IDs.

Usage:```
list_resource_pools(cluster_name: str)


### 4. List VMs in Resource Pool (`list_vms_in_resource_pool`)
**Description**: List all virtual machines in a specific resource pool. Requires the resource pool name as input and returns a formatted list of VMs with their names and power states.

**Usage**:```
list_vms_in_resource_pool(resource_pool_name: str)

5. Get vCenter Status (get_vcenter_status)

Description: Get vCenter connection status and basic information. Returns connection status, host information, and counts of clusters, resource pools, and virtual machines.

Usage:```
get_vcenter_status()


## MCP Client Connection

### Cloud Foundry Deployment
When deployed to Cloud Foundry, the MCP server is accessible via HTTPS transport:

- **URL**: `https://vcenter-mcp-server.apps.tas.tanzu.rocks` (port 443)
- **Transport**: `http` (async)
- **Protocol**: MCP over HTTPS

### Local Development
For local development, the server runs on:
- **Host**: `0.0.0.0` (default, configurable via `HOST` environment variable)
- **Port**: `8080` (default, configurable via `PORT` environment variable)
- **Transport**: `http` (async)

**Note**: Cloud Foundry sets the `PORT` environment variable for health checks, while external access is routed through HTTPS on port 443. The application must use the `PORT` environment variable to ensure health checks work correctly. The server defaults to port 8080 but can be overridden with the `PORT` environment variable.

## Development

### Python Version
This project requires **Python 3.12+** and has been tested with Python 3.12.3. For Cloud Foundry deployment, the runtime is set to `python-3.12.*` to allow automatic minor version updates.

### Running Tests```bash
# Run all tests
pytest

# Run with coverage
pytest --cov=main

# Run specific test file
pytest tests/test_mvc_structure.py

Code Quality```bash

Format code

black main/ tests/

Lint code

flake8 main/ tests/

Type checking

mypy main/


### Building the Package```bash
# Build wheel
python -m build

# Install from wheel
pip install dist/vcenter_mcp-*.whl

API Endpoints

Health Check Endpoint

  • GET /health - Application health status (returns JSON with status information)

MCP Protocol Endpoint

The server uses FastMCP's async http transport for MCP protocol communication over HTTP, compatible with Spring AI WebMVC MCP servers.

vCenter REST API Endpoints

The server uses the vCenter REST API with the following endpoints:

  • GET /rest/vcenter/cluster - List clusters
  • GET /rest/vcenter/resource-pool - List resource pools
  • GET /rest/vcenter/vm - List virtual machines

Security Considerations

  • The server operates in read-only mode
  • Credentials are stored securely in environment variables or service bindings
  • SSL verification is enabled by default
  • No persistent storage of sensitive data
  • All API requests are logged for debugging

Troubleshooting

Common Issues

  1. Connection failed: Verify vCenter host URL and credentials
  2. SSL certificate errors: Ensure vCenter has valid SSL certificates
  3. Authentication failed: Check username and password
  4. API access denied: Verify user has appropriate permissions
  5. MCP client timeout: Ensure the client is configured to use http transport (compatible with Spring AI WebMVC)
  6. Cloud Foundry deployment issues: Check that the app is running and accessible via HTTPS on port 443

Logs

Check application logs for detailed error information:```bash

Local development

python -m main

Cloud Foundry

cf logs vcenter-mcp-server --recent


### Debug Mode

Enable debug logging:```bash
export LOG_LEVEL=DEBUG
python -m main

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes following the MVC pattern
  4. Add tests for new functionality
  5. Run the test suite
  6. Submit a pull request

Development Setup```bash

Clone and setup

git clone <your-fork-url>
cd vcenter-mcp
pip install -e ".[dev]"

Run tests

pytest

Format code

black main/ tests/
```

Adding New Features

When adding new features, follow the MVC pattern:

  1. Models: Add new data models in main/models/
  2. Services: Add API interactions in main/services/
  3. Controllers: Add business logic in main/controllers/
  4. Views: Add presentation logic in main/views/
  5. Tests: Add corresponding tests in tests/

License

[Add your license information here]

Changelog

1.0.0

  • Initial release
  • MVC architecture implementation
  • Comprehensive testing
  • Cloud Foundry deployment support
  • FastMCP integration

常见问题

7 问
答案由本站依据条目字段整理,不引用上游原文
Vcenter MCP 怎么安装?

在客户端按下面的安装命令接入:python -m venv venv。装完在客户端配置里引用同一个包或端点。

Vcenter MCP 怎么在客户端里配置?

它的传输方式未标注,在客户端 MCP 配置里按官方文档填写启动命令和参数,保存后重启客户端生效。

Vcenter MCP 收费吗?

本站不代收费用,也没有标注具体价格。是否收费取决于服务本身和背后的接口额度,正式使用前按官方说明确认。

Vcenter MCP 需要 API Key 吗?

资料标注需要会话登录认证,使用前准备好对应凭据,并按最小权限配置。

Vcenter MCP 能提供哪些能力?

资料显示约 5 个工具;能力标签包括 云计算、Python、只读访问、API集成。具体工具清单以官方文档为准。

Vcenter MCP 需要什么运行环境?

运行时为 Python;属于本地进程,需要在本机装好运行环境。

Vcenter MCP 是本地还是远程?

它是本地进程(stdio),由客户端在本机拉起。传输方式为stdio · 本地进程。

热门专题

按标签挑服务器
全部专题 →

服务器信息以作者仓库与官方文档为准;分类、传输方式与鉴权方式的中文说明为中文整理,最近核验 2026-05-17。