vcf-ops-mcp
vcf-ops-mcp
这是一个将 VCF Operations (vROps) 的 suite-api REST API 封装起来的 MCP server,把资源、指标和告警暴露为 MCP 工具,让 LLM 客户端可以直接查询受监控的基础设施。
设置
python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
cp .env.example .env # then fill in your VCF Operations details所需配置(通过 .env 或真实环境变量提供):
变量 | 说明 |
| VCF Operations 实例的基础 URL,例如 |
| 用于认证的用户 |
| 该用户的密码 |
| 认证源名称(默认 |
| 设为 |
| 每次请求的超时时间(秒)(默认 |
服务器在首次使用时从 /suite-api/api/auth/token/acquire 获取一个 token,进行缓存,并在 token 接近过期或收到 401 拒绝时自动透明地重新获取。
服务器 transport/auth 配置(同样通过 .env 或真实环境变量提供):
变量 | 说明 |
|
|
| streamable-http 的绑定主机(默认 |
| streamable-http 的绑定端口(默认 |
| streamable-http 必需。客户端必须发送 |
| 逗号分隔的 Host 头白名单,用于 DNS-rebinding 防护(见下文) |
运行
默认情况下,它作为独立 远程服务器 通过 streamable-http 运行,绑定 127.0.0.1:8000,每个请求都需要一个 bearer token:
export VCFOPS_MCP_BEARER_TOKEN="$(openssl rand -hex 32)"
vcf-ops-mcp
# or
python -m vcf_ops_mcpGET /healthz 无需认证(用于负载均衡器/编排器的存活检查);其余一切请求都需要 bearer token。127.0.0.1 只监听本地——要从其他主机真正访问它,就需要绑定 VCFOPS_MCP_HOST=0.0.0.0(或者放在反向代理后面运行),并确保 bearer token 是网络与可查询整个受监控环境的凭据之间唯一的屏障。请像对待任何其他机密一样对待它,并优先在它前面使用 TLS 终止(例如反向代理),而不是在不受信任的网络上以明文 HTTP 传输。
当 VCFOPS_MCP_HOST 不是 127.0.0.1/localhost 时,FastMCP 自带的 DNS-rebinding 防护(针对传入请求 Host 头的检查)默认没有可加入白名单的内容,因为它只会为回环主机自动配置该白名单。如果保持未设置,则不会强制执行 Host 头检查,bearer token 是你唯一的关卡——在信任的网络上没问题,但在共享或不受信任的网络上,要把 VCFOPS_MCP_ALLOWED_HOSTS 设置为客户端实际连接的 hostname(s)/IP:port(逗号分隔),以实现纵深防御。
将 MCP 客户端指向它,把它当作一个 streamable-http 服务器,例如在 Claude Code 中:
claude mcp add --transport http vcf-operations http://<host>:8000/mcp \
--header "Authorization: Bearer <your-token>"改用 stdio 运行
对于本地使用场景,MCP 客户端自己把服务器作为子进程启动(无需暴露网络),设置 VCFOPS_MCP_TRANSPORT=stdio 即可——此模式不需要 bearer token。Claude Desktop 配置示例:
{
"mcpServers": {
"vcf-operations": {
"command": "/absolute/path/to/.venv/bin/vcf-ops-mcp",
"env": {
"VCFOPS_MCP_TRANSPORT": "stdio",
"VCFOPS_BASE_URL": "https://ops.example.com",
"VCFOPS_USERNAME": "admin",
"VCFOPS_PASSWORD": "changeme"
}
}
}
}工具
资源
list_resources— 按名称/适配器类型/资源类型/运行状态搜索受监控对象get_resource— 单个资源的完整详情get_resource_properties— 已采集的配置属性get_resource_relationships— 父/子对象
指标
list_metric_keys— 适配器/资源类型组合可用的 statKeysget_latest_stats— 某个资源的最新指标值(一个或多个)query_stats— 跨资源的历史时间序列,支持 rollup 与 interval
告警
list_alerts— 活动/全部告警,可选按资源或严重性范围过滤get_alert— 单个告警的完整详情list_alert_definitions— 告警背后的规则定义
测试
pip install -e ".[dev]"
pytest测试使用 respx mock VCF Operations HTTP API —— 无需真实实例。
备注
锁定到
mcp<2.0.0:MCP Python SDK 的 2.x 版本把FastMCP重命名为MCPServer,并移动到了mcp.server.mcpserver。本项目采用成熟稳定的 1.xmcp.server.fastmcp.FastMCPAPI。
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
MCP server exposing the Backtest360 engine API as tools for AI agents.
MCP server for Pentest-Tools.com: run scans, manage findings and reports via your preffered LLM.
MCP server providing access to the Scorecard API to evaluate and optimize LLM systems.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/mdegrasse/vcf-ops-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server