Skip to main content
Glama

ArubaOS-CX MCP 服务器(hpe-cx-mcp

一个模型上下文协议(MCP)服务器,将 Aruba CX(AOS-CX) 交换机开放给支持 MCP 的 AI 代理(Claude、VS Code Copilot 等)。它将交换机 REST API(/rest/v10.x)和 SSH CLI 转化为一组经过精心设计的、安全且结构化的工具,用于园区/数据中心网络的可观测性、故障排查和配置管理(VLAN、路由、BGP/OSPF、EVPN-VXLAN、VSX/VSF、端口接入/802.1X、NAE、ARC……)。

该服务器以 Docker 容器方式运行,通过 streamable HTTP 提供 MCP 服务,并附带可选的命名 Bearer 令牌认证JSON 审计日志


快速开始

cd cx-mcp

# 1) Provide credentials (git-ignored)
cp .env.example .env                 # then edit: set ARUBA_DEFAULT_PASSWORD (and any source tokens)

# 2) Provide the device list (git-ignored)
cp inventory/inventory.example.yaml inventory/inventory.yaml   # then edit: your switches & IPs

# 3) Build and start
docker compose up -d --build

# 4) Watch it come up
docker compose logs -f hpe-cx-mcp    # wait for "✅ hpe-cx-mcp server is up and running"

MCP 端点随后可通过 http://<docker-host>:8002/mcp 访问。将您的 MCP 客户端指向该地址(参见§9)。完整细节和平台说明见§3


Related MCP server: API-Central

目录

  1. 此服务器的作用

  2. 可用工具

  3. 安装(macOS / Linux / Windows)

  4. 环境变量

  5. 清单管理

  6. 安全:Bearer 认证与审计日志

  7. 令牌管理

  8. 连接 MCP 客户端


1. 此服务器的作用

  • 单一入口点,访问清单中描述的一组 AOS-CX 交换机。

  • 读取(观察):接口、VLAN、路由/ARP/MAC 表、BGP/OSPF/EVPN、VXLAN 隧道、VSX/VSF 堆叠状态、硬件健康、日志、802.1X / 端口接入、NAE 脚本、应用识别(ARC)、完整配置。

  • 写入(配置):VLAN 服务、环回接口、路由端口、VRF、BGP、OSPF、EVPN/VXLAN、端口认证、虚拟 MAC、ARC——每个都配有对应的 verify_* 回读工具。

  • 安全护栏

    • 每台设备的 access_mode(默认为 read-only;除非设备明确标记为 read-write,否则拒绝写入)。

    • 站点范围操作(site 参数),可对一组设备执行操作。

    • SSH 写入命令检测,阻止在只读设备上通过原始 CLI 进行配置更改。

  • 动态清单:将本地文件与 NetBox / Nautobot 事实来源合并,并可选使用 HashiCorp Vault 解析凭据。


2. 可用工具

工具按用途分组。读取工具要求设备可达;写入工具还要求设备为 read-write

清单与会话

工具

作用

list_devices

列出清单中的设备(可选 site 过滤器)。

list_sites

列出站点及其关联设备。

list_inventory_sources

列出已配置的来源及其优先级(probe 用于测试可达性)。

find_devices

按名称/站点/租户/标签/自定义字段跨来源搜索设备。

resolve_device

跨所有来源按名称或管理 IP 解析设备。

refresh_inventory

重新加载本地文件并重新拉取外部来源。

run_on_site

在站点的每台设备上运行只读诊断。

logout

关闭池化的 REST/SSH 会话(在工作流结束时调用)。

原始访问(逃生通道)

工具

作用

run_ssh_command / run_ssh_commands

主要 CLI 逃生通道:通过 SSH 运行任意 CLI 命令(REST 不暴露的输出)。

run_cli_command

通过 /cli(REST/443)执行 show 命令的备用方案——当 SSH/22 不可用时使用;/cli 功能有限且会拒绝许多命令。

get_cli_supported_commands

尝试列出 REST /cli 支持的 CLI 命令。

get_raw_api

对任意 REST 路径执行原始 GET 请求。

系统与硬件

get_system_infoget_hardware_healthget_boot_historyget_transceiversget_ssh_configget_logs

容器与许可

get_containers(交换机上的应用容器:状态、镜像、CPU/内存限制、VRF 网络)、get_feature_pack(许可/订阅状态:管理模式、有效性、到期时间、按功能的执行情况)。

云管理

get_aruba_central(HPE ANW Central / Aruba Central 连接状态:已连接、实例化、配置来源、位置、VRF/源 IP、Activate 连接)。

L2 / L3 状态

get_interfacesget_loopbacksget_routed_portsget_vlan_interfacesget_vlansget_lldp_neighborsget_mac_tableget_arp_tableget_routing_tableget_spanning_tree

路由协议

get_bgp_neighborsget_bgp_configget_bgp_routesget_ospf_overviewget_ospf_neighborsget_ospf_interfaces

EVPN / VXLAN

get_evpn_configget_evpn_routesget_evpn_multihomingget_vxlan_configget_vxlan_tunnelsget_vxlan_static_peersget_evpn_vtep_neighbors

高可用性(VSX / VSF)

get_vsx_statusget_vsx_configget_vsx_syncget_vsf_statusget_vsf_configget_maintenance_mode

NAE(网络分析引擎)

get_nae_scriptsget_nae_scriptget_nae_agentsget_nae_agent

端口接入 / AAA / 802.1X

get_port_access_clientsget_port_access_client_detailget_port_access_auth_configget_port_access_summaryget_port_access_policiesget_port_access_rolesget_port_access_gbpsget_gbp_role_mapsget_port_access_abpsget_radius_serversget_tacacs_serversget_aaa_authenticationget_aaa_accounting

应用识别与控制(ARC)

get_app_recognitionget_app_visibility

配置管理

list_configsget_configget_full_configcompare_configsmanage_config(保存 / 检查点 / 回滚)。

配置(写入)+ 验证配对

每个 configure_* 工具都有对应的 verify_* 回读工具:

配置

验证

范围

create_vlan_service / delete_vlan_service

VLAN + 可选 SVI

configure_loopback

verify_loopback

环回接口(router-id / VTEP 源)

configure_routed_port

verify_routed_port

L3 端口

configure_vxlan_interface

verify_vxlan_interface

VTEP

configure_evpn

verify_evpn

全局 EVPN

configure_ospf

verify_ospf

OSPF 实例

configure_bgp

verify_bgp

BGP 路由器

configure_vrf

verify_vrf

VRF + 路由目标

configure_port_auth

verify_port_auth

802.1X / MAC-Auth

configure_app_recognition

verify_app_recognition

ARC

configure_virtual_mac

verify_virtual_mac

全局 EVPN 虚拟 MAC

写入保护:对 read-only 设备调用 configure_* / create_* / delete_* / manage_config 将被拒绝。在清单中将设备标记为 access_mode: read-write 以允许更改。

工具暴露方式:扁平工具集(默认)与旧版原子工具

服务器可以通过两种互斥的方式暴露其能力,由 CX_FLAT_TOOLSET 标志选择(参见§5):

扁平工具集(CX_FLAT_TOOLSET=true——默认)。 上述约 101 个原子工具被合并为约 23 个扁平分发器,由 scope(写入操作还有 action)参数驱动。底层 REST 客户端代码不变——分发器仅负责路由到它,因此不存在行为回归。每个读取分发器还接受 device: str | listsitesource(外部事实来源查询)参数,并并行分发调用,返回一个信封结构 {scope, results, errors, summary}。可选的 limit 参数可限制响应中长列表字段的长度。

调度器

scope

get_system

info, inventory, environment, capacity, boot, maintenance, containers, feature_pack, central, ssh

get_interfaces

physical, transceivers, loopbacks, routed, svi, lag

get_switching

vlans, mac, lldp, spanning_tree

get_routing

bgp_summary, bgp_neighbors, bgp_config, bgp_routes, ospf_overview, ospf_neighbors, ospf_interfaces, route_table, arp

get_overlay

evpn_config, evpn_routes, evpn_multihoming, vtep_neighbors, vxlan_config, vxlan_tunnels, vxlan_static_peers

get_redundancy

vsx_status, vsx_config, vsx_sync, vsf_status, vsf_config

get_access

clients, client_detail, auth_config, summary, roles, gbp, gbp_maps, abp, policies, radius, tacacs, authentication, accounting

get_automation

nae_scripts, nae_script, nae_agents, nae_agent

get_apps

recognition, visibility

get_config

running, startup, full, list, compare, raw

manage_inventory

sources, resolve, refresh, find

configure_interface

loopback, routed_port, vxlan, virtual_macaction: plan/apply/verify

configure_routing

ospf, bgp, vrf, evpnaction: plan/apply/verify

configure_security

port_auth, aaa, user_roles, app_recognitionaction: plan/apply/verify

configure_service

vlanaction: plan/apply/delete/delete_plan/verify

diagnose

device, evpn, client(确定性多检查组合)

另有 7 个保持原子性的工具:list_deviceslist_sitesget_logsrun_ssh_commandsmanage_configlogoutrollback。写调度器保持 plan → apply → verify 生命周期和每设备只读保护。域字段通过 params 对象传递(键已在每个调度器的 docstring 中记录)。

旧版原子工具(CX_FLAT_TOOLSET=false)。 改为暴露上面完整的逐工具目录,并可通过下面三层进行可选调整。使用此模式可立即回滚到先前行为。

渐进式披露、功能前缀与写安全(仅旧版模式)

三个可选层(仅在 CX_FLAT_TOOLSET=false 时生效,每层由各自的环境标志控制——见 §5)决定旧版工具的暴露方式:

1. 渐进式披露(CX_DEFERRED_TOOLS —— 服务器不再公布完整目录(100+ 工具),而是只发布 ~27 个 Tier-1 工具(最常用的读取/诊断工具、逃生舱、编排器和元工具)。其余所有工具均为延迟(Tier-2),可通过两个元工具按需调用:

元工具

作用

search_tools

按关键字发现延迟工具。返回每个匹配项的名称、描述、标签、write 标志和 JSON-Schema 参数。

invoke_tool

按名称执行延迟工具,并使用与其 schema 匹配的 arguments 对象。返回 {ok, tool, result}

这样既能保持代理的工具列表精简且开销低,又能让整个工具面都可触达。

2. 功能前缀(CX_TOOL_PREFIXES —— 已公布的工具会重命名为 <domain>__<tool> 以按域分组,例如 routing__get_bgp_neighborsoverlay__configure_evpnservice__create_vlan_servicemeta__invoke_tool。域:inventoryexecsysteminterfaceswitchingroutingoverlayredundancysecurityappnaeconfigservicemetainvoke_tool 接受带前缀或不带前缀的名称。

3. 写安全(CX_WRITE_SAFETY —— 带回滚的 preview→apply 工作流:

元工具

作用

apply_plan

通过其 dry_run_token 应用已预览的写入。重新预览以确认计划未变(TOCTOU 保护),然后应用并在计划可逆时返回 rollback_id

rollback

通过其 rollback_id 撤销可逆的已应用写入(按后创建先执行的方式重放逆操作;目前用于 VLAN-service 工作流)。

工作流:以 apply=false(默认)调用任意写工具,获得一个计划 以及 dry_run_token;然后调用 apply_plan(dry_run_token=…) 来应用该确切计划。幂等的 configure_* 合并没有自动逆操作,会被 rollback 报告为 unsupported。当 CX_REQUIRE_DRY_RUN_TOKEN=true 时,通过 invoke_tool 直接应用(apply=true)会被拒绝——调用方必须走 preview→apply_plan 路径。


3. 安装(macOS / Linux / Windows)

前提条件

  • DockerDocker Compose v2docker compose …)。

    • macOS / Windows:Docker Desktop

    • Linux:Docker Engine + Compose 插件。

  • 从 Docker 主机到交换机管理 IP 的网络可达性(REST 使用 HTTPS/443,SSH 使用 TCP/22)。

  • 必须在目标设备上并在正确的 VRF 中配置 REST 访问:读写访问需要 Read-Write 模式,只读访问需要 Read-only 模式。

  • 对于需要 SSH 的工具,还必须在目标设备上配置 SSH 访问

配置(首次运行)

机密信息和部署相关设置位于 docker-compose.yml 之外,存放在 git 忽略 的文件中,因此永远不会被提交。随附两个模板——请分别复制并填写:

cd cx-mcp

# 1) Credentials & external source tokens  →  .env  (git-ignored)
cp .env.example .env
#    then edit .env and set at least ARUBA_DEFAULT_PASSWORD

# 2) Device inventory  →  inventory/inventory.yaml  (git-ignored)
cp inventory/inventory.example.yaml inventory/inventory.yaml
#    then edit it: list your switches, their IPs and per-device access_mode

.env 通过 docker-compose.yml 中的 env_file: 注入容器。最小内容(完整列表见 .env.example):

ARUBA_DEFAULT_USERNAME=admin
ARUBA_DEFAULT_PASSWORD=your-switch-password
ARUBA_API_VERSION=latest
# Optional external sources of truth (leave empty if unused):
NETBOX_URL=
NETBOX_TOKEN=
INFRAHUB_URL=
INFRAHUB_TOKEN=

切勿提交 .envinventory/inventory.yaml —— 它们包含真实凭据和设备 IP。只有 *.example 模板由 git 跟踪。

构建与启动(所有平台)

cd cx-mcp
docker compose up -d --build

服务器监听于 http://<host>:8002/mcp(主机端口 8002 → 容器 8000,见 docker-compose.yml)。镜像构建为 hpe-cx-mcp:latest,并以容器 hpe-cx-mcp 运行。

检查是否正在运行:

docker compose logs -f hpe-cx-mcp
# look for, in order:
#   "Uvicorn running on http://0.0.0.0:8000"
#   "✅ hpe-cx-mcp server is up and running on http://0.0.0.0:8000 — if your agent
#    already has an open MCP connection, reset it (MCP: Disconnect → Connect) …"

监听器就绪后会输出 ✅ … server is up and running 这一行。如果启动失败,服务器会记录 ❌ hpe-cx-mcp server failed to start,随后输出完整 traceback(然后以非零状态退出)。

注意: 每次执行 docker compose up -d --build 都会重建镜像并重启服务器,这会使任何现有 MCP 会话失效。重建后,请重新连接客户端(MCP: Disconnect → Connect)以获取当前工具。

平台说明

Linux

  • 绑定挂载的文件夹归你的宿主机用户所有。容器以 uid 1000 运行;如果你的宿主机用户不是 uid 1000,请将可写文件夹设为 uid 1000 可读写:

mkdir -p logs secrets
sudo chown -R 1000:1000 logs secrets
chmod 700 secrets
  • 要访问宿主机本地 L2 网络上的交换机,你可以在 docker-compose.yml 中取消注释 network_mode: host(仅限 Linux)。

macOS(Docker Desktop)

  • 文件共享由 VM 处理;绑定挂载开箱即用,uid 重映射自动完成——大多数情况下无需手动 chown

  • network_mode: host 支持与 Linux 相同的方式;请保留默认的 ports: 映射(8002:8000)。

Windows(Docker Desktop + WSL2)

  • WSL2 shell 或 PowerShell 运行命令。强烈建议将项目存储在 WSL2 文件系统内部(例如 \\wsl$\… / ~/cx-mcp),以获得正确的文件权限和性能。

  • docker-compose.yml 卷路径中使用正斜杠(./inventory:/app/inventory:ro)。

  • network_mode: host 不可用;请保留 ports: 映射。


4. 卷

将三个主机文件夹挂载到容器中:

主机路径

容器路径

模式

用途

./inventory

/app/inventory

只读:ro

设备清单(inventory.yaml)。只读,因此服务器永远无法更改它。

./logs

/app/logs

读写

启用审计时的审计日志输出(audit.jsonl)。

./secrets

/app/secrets

读写

命名 Bearer 令牌(.tokens,权限 0600)。

volumes:
  - ./inventory:/app/inventory:ro
  - ./logs:/app/logs
  - ./secrets:/app/secrets

应用程序代码已构建到镜像中——只挂载这些数据文件夹。修改任何 *.py 后,请使用 docker compose up -d --build 重建(仅重启是不够的)。

所有权(Linux):logs/secrets/ 必须可由容器 uid 1000 写入。secrets/ 应为 0700,其 .tokens 文件由服务器自身以 0600 权限写出。


5. 环境变量

机密信息和部署特定值(凭据、外部源令牌)通过 git 忽略的 .env 文件提供,docker-compose.yml 通过 env_file: 加载该文件(将 .env.example 复制为 .env,见 §3)。非机密操作标志(MCP_*CX_*INVENTORY_FILE)直接在 docker-compose.ymlenvironment: 下设置。布尔值接受 true/1/yes/on

传输

变量

默认值

描述

MCP_TRANSPORT

streamable-http

MCP 传输方式。

MCP_HOST

0.0.0.0

容器内的绑定地址。

MCP_PORT

8000

容器内的绑定端口(映射到宿主机 8002)。

CX_MCP_PATH

/mcp

由安全中间件保护的 URL 路径。

设备凭据与 API(在 .env 中设置;可在清单中按设备覆盖)

变量

默认值

描述

ARUBA_DEFAULT_USERNAME

admin

默认 REST/SSH 用户名。

ARUBA_DEFAULT_PASSWORD

(空)

默认密码。必填,除非按设备单独设置。

ARUBA_API_VERSION

v10.09

默认 REST API 版本(latest = 自动检测)。

ARUBA_SSH_PORT

22

默认 SSH 端口。

清单与外部数据源

变量

默认值

描述

INVENTORY_FILE

/app/inventory/inventory.yaml

清单文件路径(YAML/JSON/TOML)。

NETBOX_URL / NETBOX_TOKEN

NetBox 数据源连接(在 .env 中设置)。

NAUTOBOT_URL / NAUTOBOT_TOKEN

Nautobot 数据源连接(在 .env 中设置)。

INFRAHUB_URL / INFRAHUB_TOKEN

Infrahub 数据源连接(GraphQL API;在 .env 中设置)。

<NAME>_URL / <NAME>_TOKEN

通用按命名数据源的连接。

VAULT_ADDR / VAULT_TOKEN

用于凭据解析的 HashiCorp Vault。

Bearer 认证(可选,默认关闭)

变量

默认值

描述

CX_AUTH_ENABLED

false

要求每个请求都携带有效的 Bearer 令牌。如果启用但尚无令牌,服务器将以 LOCKED 模式启动,并以 HTTP 503 拒绝所有 MCP 请求,直到你创建第一个令牌并重启。

CX_TOKENS_FILE

/app/secrets/.tokens

令牌存储路径。

CX_TRUST_FORWARDED_FOR

false

信任 X-Forwarded-For(第一跳)作为客户端 IP。在受信任的反向代理后面设置为 true

审计日志(可选,默认关闭)

变量

默认值

描述

CX_AUDIT_ENABLED

false

每次工具调用输出一条 JSON 记录。

CX_AUDIT_FILE

/app/logs/audit.jsonl

输出文件(轮转,10 MB × 5)。

CX_AUDIT_LEVEL

all

all = 每次调用都记录;writes = 仅记录改变状态的工具。

CX_AUDIT_STDOUT

false

同时将记录镜像到标准输出(docker logs)。

渐进式工具暴露、前缀与写入安全(可选)

变量

默认值

描述

CX_FLAT_TOOLSET

true

将约 101 个原子工具折叠为约 23 个扁平的 scope/action 分发器。优先级最高:开启时,跳过下面三层。设为 false 可回到旧的原子工具模式。

CX_DEFERRED_TOOLS

false

(仅旧模式)只通告 Tier-1 工具;其余通过 search_tools / invoke_tool 访问。

CX_TOOL_PREFIXES

false

(仅旧模式)将通告的工具重命名为 <domain>__<tool>(例如 routing__get_bgp_neighbors)。

CX_INVOKE_WRITES

true

允许写工具通过 invoke_tool 运行。

CX_WRITE_SAFETY

false

启用 dry_run_token 预览以及 apply_plan / rollback 元工具。

CX_REQUIRE_DRY_RUN_TOKEN

false

拒绝通过 invoke_tool 直接 apply=true;强制走预览 → apply_plan 路径。

CX_DRY_RUN_TTL

900

dry_run_token 的有效期(秒)。

CX_SECRETS_DIR

<app>/secrets

写入安全存储(.dry_run_plans.json.rollback_journal.json)的目录。设置为可写且已挂载的目录(例如 /app/logs)。


6. 清单管理

清单文件(inventory/inventory.yaml)声明了设备及其访问方式。该文件被 git 忽略(其中包含真实的 IP 和凭据);请根据随附模板创建一次:

cp inventory/inventory.example.yaml inventory/inventory.yaml

文件中的值会覆盖环境变量。 支持的格式:YAML、JSON、TOML。

最小示例

defaults:
  username: admin
  password: "secret"
  api_version: latest        # auto-detect the newest REST version
  verify_ssl: false
  timeout: 30
  access_mode: read-only     # writes denied unless overridden per device

devices:
  Spine1:
    host: 192.0.2.21
    description: "Core switch"
    tags: [core, spine]
    site: campus-principal
    access_mode: read-write   # allow configuration changes on this device
  Access-01:
    host: 192.0.2.23
    site: campus-principal

按设备选项

host(必填)、usernamepasswordapi_versionverify_ssltimeouttagsdescriptionsitessh_portssh_usernamessh_passwordaccess_moderead-only | read-write)、vault(设为 true 可从 Vault 获取凭据)。

站点

site 概念是可选的,它让工具可以针对一组设备进行操作 (list_devices(site=…)run_on_site(site, …))。可以使用按设备的 site: 字段,也可以使用顶层的 sites: 块来分组设备。

清单数据源选项

有几种方式可以决定设备列表来自哪里

  1. 仅本地(默认) — 设备来自文件:

    source: local        # may be omitted
  2. 单一外部数据源 — 从事实来源拉取:

    source: netbox
    sources:
      netbox:
        type: netbox            # netbox | nautobot | infrahub
        url: https://netbox.example.com
        token: "<api-token>"    # or via NETBOX_TOKEN env var
        verify_ssl: false
  3. 带优先级的合并数据源 — 同时出现在多个数据源中的设备取自优先级更高的数据源:

    source: [local, netbox]
    source_priority: [local, netbox]   # local wins over netbox

凭据解析优先级(从高到低):

  1. 设备条目上设置的设备级凭据。

  2. HashiCorp Vault(当全局或按设备启用了 vault 时)。

  3. 环境变量 / 清单默认值。

编辑清单后,无需重建即可通过 refresh_inventory 工具应用更改,或重启容器。

启动校验(快速失败)

清单文件在启动时进行校验。如果无法解析(YAML/JSON/TOML 语法错误)或违反预期模式(例如 source: 键缩进错误,或 source 被设置为非字符串/列表值),服务器会记录一条具体的英文错误并拒绝启动,而不是在清单为空或不完整的情况下静默运行:

❌ Inventory file '/app/inventory/inventory.yaml' failed validation — the server will NOT start.
   YAML syntax error: expected '<document start>', but found '<block mapping start>'
     in "<unicode string>", line 22, column 1
   Fix the inventory file, then restart the container.

容器以非零状态码退出(可在 docker logs / docker compose ps 中查看)。修复报告的行后重启。注意:

  • 缺少清单文件仅产生警告(可以稍后挂载)——服务器仍会启动。

  • 外部数据源不可达(NetBox / Nautobot / Infrahub 宕机)不会导致致命错误:解析后的本地清单仍然可用,动态合并会优雅降级。

  • 运行时的 refresh_inventory 工具应用相同的校验,但绝不会使运行中的服务器崩溃:遇到错误文件时它会返回错误并保留先前加载的清单。


7. 安全:Bearer 认证与审计日志

这两个功能默认关闭,且完全向后兼容。

  • 认证CX_AUTH_ENABLED=true):对 /mcp 的每个请求都必须携带 Authorization: Bearer <token>。缺失或无效的令牌会收到 HTTP 401。令牌的名称会成为审计日志中记录的 actor,因此你始终知道谁做了什么。如果启用了认证但尚不存在令牌,服务器仍会启动,但处于 LOCKED 模式:每个 MCP 请求都会被 HTTP 503 拒绝(故障关闭),因此服务不可达。创建第一个令牌(见 §8)并重启容器以解锁——令牌存储在启动时加载一次。

  • 审计CX_AUDIT_ENABLED=true):每次工具调用在 logs/audit.jsonl 中输出一行 JSON,包括 actorsrc_iptoolcategory(读/写)、目标 device、脱敏后的 argumentsoutcome、HTTP status_codeduration_ms。机密信息(密码/令牌)会被掩码处理。

同时启用两者:

# docker-compose.yml
CX_AUTH_ENABLED:  "true"
CX_AUDIT_ENABLED: "true"
docker compose up -d --build

8. 令牌管理

令牌存储在 secrets/.tokens 中(权限 0600)。使用随附的 CLI 在运行中的容器内进行管理:

# Create a named token (prints the secret once — save it)
docker compose exec hpe-cx-mcp python cx_token_manager.py generate --name vscode-dev

# List tokens (names, descriptions, created — secret truncated)
docker compose exec hpe-cx-mcp python cx_token_manager.py list

# Show one token
docker compose exec hpe-cx-mcp python cx_token_manager.py show --name vscode-dev

# Revoke a token
docker compose exec hpe-cx-mcp python cx_token_manager.py revoke --name vscode-dev

生成的令牌以 cx_ 为前缀。为每个客户端/代理使用一个独立的令牌,以便在审计日志中获得按操作者(actor)的归因。

第一个令牌: 启用认证后,服务器以 LOCKED 状态启动(每个请求返回 HTTP 503),直到存在令牌为止。创建第一个令牌后,无需重启即可通过热重载应用它(见下文):

docker compose exec hpe-cx-mcp python cx_reload.py

(执行 docker compose restart hpe-cx-mcp 也可以)。

热重载(无需重建 / 无需重启)

令牌和清单文件在启动时加载到内存中。编辑 secrets/.tokens(通过上述 CLI)或 inventory/inventory.yaml 后,通过向运行中的服务器发送重载信号来应用更改:

docker compose exec hpe-cx-mcp python cx_reload.py

这会同时就地重载令牌和清单——添加/撤销令牌,或添加/更新设备,会在下一个请求时生效。该命令只发送信号;结果(数量、错误)会写入日志:

docker compose logs --tail=20 hpe-cx-mcp

重载是手动的且明确的——没有自动文件监视。

如果客户端通过共享中继连接,所有调用都会显示在中继的单一令牌下;如需按代理归因,请使用不同的令牌直接连接到 hpe-cx-mcp


9. 连接 MCP 客户端

将你的 MCP 客户端指向 streamable-HTTP 端点:

URL:  http://<docker-host>:8002/mcp

当启用身份验证时,添加以下标头:

Authorization: Bearer cx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

示例(VS Code mcp.json 风格):

{
  "servers": {
    "hpe-cx-mcp": {
      "type": "http",
      "url": "http://localhost:8002/mcp",
      "headers": { "Authorization": "Bearer cx_xxxxxxxxxxxxxxxxxxxx" }
    }
  }
}
F
license - not found
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    Provides AI assistants with direct access to multi-vendor network devices for tasks like configuration management, health checks, and topology discovery through 35 specialized tools. It enables natural language control over platforms including Cisco, Juniper, and Nokia using SSH, NETCONF, and SNMP protocols.
    11
    MIT
  • A
    license
    A
    quality
    A
    maintenance
    Enables conversational automation of HPE Aruba Central network operations through Claude Code. Provides 88 tools across monitoring, configuration, and operations domains for device migration, SSID management, switch provisioning, and GreenLake Platform integration.
    16
    2
    MIT
  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables AI agents to interact with Cisco IOS-XE network devices over SSH using structured tools. Provides read and write capabilities for network management with built-in validation and security.
  • A
    license
    Not graded
    quality
    C
    maintenance
    MCP server for network operations that lets AI assistants interact with Cisco/Juniper network devices through safe, well-defined tools like compliance audits and configuration backups.
    MIT

View all related MCP servers

Related MCP Connectors

  • Connect MCP clients to 2,000+ AI models without managing provider API keys.

  • Manage SRG+ hubs, channels, content, assets, users, and workspaces from any MCP-aware AI agent.

  • Let AI operate servers without SSH. Choose actions, approve risky changes, and audit every step.

View all MCP Connectors

Latest Blog Posts

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/legalla/hpe-cx-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server