eNSP MCP
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| ENSP_MCP_LOG_DIR | No | Directory used for command trace logs. By default, logs are written under %USERPROFILE%\.ensp-mcp. |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| list_modelsA | 列出 eNSP 支持的设备型号,以及每种型号的接口清单。 搭拓扑前先调这个,就知道有哪些型号可选、每个型号有几个口、口叫什么名字。 连线时 fromPort / toPort 填的就是这里的接口名。 Args: category: 只看某一类,可选 AR(路由器)、LSW(交换机)、WLAN(无线)、 FW(防火墙)、CLIENT(终端)、OTHER(其它)。留空看全部。 model: 只看某一个型号,例如 "S5700"。填了会连完整接口列表一起返回。 topo_path: 可选。给一份现成 .topo,会顺带核对内置型号表和这份文件 里实际写出的接口布局是否一致,用于确认 eNSP 版本差异。 |
| topo_createB | 新建一个空的 .topo 文件。 Args: path: 要写到哪,例如 "D:/work/campus.topo"。 overwrite: 目标已存在时是否覆盖,默认不覆盖。 |
| topo_inspectA | 读一份 .topo,返回设备清单、链路清单和每台设备的空闲接口。 每台设备会带上 consolePort,那就是 device_* 工具要用的端口号。 |
| topo_add_devicesA | 往拓扑里批量加设备。 Args: path: .topo 文件路径。 devices: 设备列表,每项支持这些字段: console 端口会自动从 2000 起顺序分配,不会和已有设备冲突。 |
| topo_connectA | 批量连线。 Args: path: .topo 文件路径。 links: 链路列表,每项支持: 一个接口只能连一条线,重复占用会直接报错并指出是哪个口。 |
| topo_removeA | 删设备或删连线。 Args: path: .topo 文件路径。 devices: 要删的设备名列表,删设备会连带删掉它身上所有的线。 links: 要断开的链路,每项 {"from": "A", "to": "B"}。 |
| topo_layoutA | 自动排布设备坐标,不用手工填 x/y。 Args: path: .topo 文件路径。 mode: 布局方式。 |
| topo_validateA | 检查拓扑有没有问题,建议在交给 eNSP 打开之前跑一次。 errors 会让 eNSP 打开异常或链路失效,必须改;warnings 只是提醒。 查的内容包括:设备重名、接口序号越界、一个口接了多条线、 console 端口冲突、孤立设备、图标/文字/背景框重叠,以及条件型号风险。 |
| topo_renderA | 可选:把拓扑画成辅助 PNG,不用开 eNSP 就能粗看布局。 PNG 不是 eNSP 原生界面,也不能证明 VirtualBox、镜像或设备能启动; 正常建图和验收流程不依赖它。 Args: path: .topo 文件路径。 out_path: 图片输出路径,省略则和 .topo 同名同目录,扩展名换成 .png。 scale: 缩放比例,设备多、连线挤的时候调大到 1.5 左右。 show_ports: 是否在连线两端标出接口名,默认标。 |
| environment_checkA | 只读检查 eNSP、VirtualBox、模板机和设备镜像,不启动或修改任何虚拟机。 检查结果的 readyForTopology=true 才表示这份拓扑的已知前置条件 已满足。检查会识别 VirtualBox 版本、Hyper-V/VBS 冲突、Host-Only 网卡、 AR/WLAN 基机、SVRP 镜像和 USG6000V 镜像/注册状态。 Args: path: 可选的 .topo。给出后按其中实际型号判断 readyForTopology。 models: 可选的计划型号列表;还没创建拓扑时可先检查,例如 ["AR2220", "USG5500"]。与 path 同时给出时合并检查。 ensp_home: 可选的 eNSP 安装目录;省略时从环境、注册表和常见目录查找。 |
| topo_exportA | 把拓扑导成写文档用得上的格式。 Args: path: .topo 文件路径。 format: mermaid(流程图源码)、drawio(可导入 draw.io)、 csv(设备表 + 接口连接表)。 out_path: 输出文件路径,省略则只把内容返回、不落盘。 csv 会写成两个文件,分别加 _devices / _links 后缀。 |
| device_execA | 在已启动的 eNSP 设备 console 上逐条执行命令。 target 为设备名(配 topo_path)或端口号。view 为 keep/user/system。 username/password 用于需要登录的 console,只有密码的 console 可只给 password。 new_password 仅在设备要求初次设置或修改密码时使用;不主动修改已有密码。 stop_on_error 默认遇错停止;失败时不 save。confirm 为 Y/N/YES/NO。 返回 ok、逐条 results、errorCount、stoppedEarly 和 saveStatus;超时断线不会重试命令。 |
| device_push_configA | 从文本或 UTF-8 .cfg 下发配置,config/config_file 必须且只能选一个。 自动进入系统视图,支持带 # 分段的 display current-configuration 配置文本, 分段时退出子视图再进入系统视图。默认遇错停止且不保存;不会自动回滚已生效配置。 username/password/new_password 与 device_exec 相同。save 默认 true。 CE 提示符标记存在未提交改动时,保存前先 commit;任何保存异常都返回失败状态。 |
| device_fetch_configA | 读回运行配置;save_to 可保存 UTF-8 文件,compare_with 可与基线文件比较。 diff 同时提供 identical、onlyOnDevice、onlyInFile 和带上下文的 unifiedDiff, 保留行顺序及重复行。命令失败或超时不写出配置文件。登录参数与 device_exec 相同。 |
| device_probeA | 设备连通性和状态查询。action: ping/tracert/interfaces/arp/mac/route/vlan/ospf。 ping/tracert 需要 destination;ping count 为 1–100。ping 返回统计和 reachable, 无法解析时 reachable 为 null;其他查询返回 output 原文。ok 表示命令执行状态, ping 是否连通看 parsed.reachable。登录参数与 device_exec 相同。 |
| device_sessionsA | 查看或关闭 console 会话。action 为 list/close/close_all。 close 时 target 为端口号。后台每 30 秒回收空闲超过 5 分钟的连接; 服务退出时关闭所有连接。关闭操作等待该连接正在执行的命令结束。 |
| device_batchA | 对多台设备并发执行命令或下发配置,单台失败不影响其他设备。 两种模式,commands 和 configs 必须且只能给一个:
devices 省略表示拓扑里所有带 console 的设备;也可以给设备名、设备类别 (AR / LSW / FW / WLAN / CLIENT)或 "all" 混合使用,例如 ["FW1", "FW2", "LSW"]。 concurrency 是同时连几台,默认 4,范围 1–16。eNSP 的 console 端口本身能 承受并发,但一次开太多会拖慢设备启动较慢的那些,建议 4–8。 save 省略时按模式决定:commands 模式不保存(查询命令不需要), configs 模式保存。返回每台设备的 ok、执行条数、错误数和失败命令, 默认不回传全部回显;要看完整 results 就设 include_results=true。 所有命令同样会自动留痕,这次调用的命令在报告里归为同一个 batch。 |
| lab_verifyA | 按规则验证实验是否真的做对了,给出 PASS / FAIL 判定。 检查项 = 某台设备上跑一条命令 + 对回显的判定规则。两种给法:
expect 可组合的规则:contains / notContains(字符串或列表)、regex、 notRegex、minCount{"pattern","atLeast"}、reachable(布尔,ping 是否通)、 maxLoss(丢包率上限)。留空表示“命令跑通就算过”。 内置套件:
devices 可限定范围。检查项并发执行,concurrency 默认 4、最大 16。 返回 verdict(PASS / FAIL)、passed / failed / skipped 计数和每条检查的 状态、未满足的条件、回显片段。save_report 可把结果另存为 JSON。 验收跑过的命令同样自动留痕,tool 记为 lab_verify。 |
| command_traceA | 把“哪条命令打到了哪台设备”整理成可交互的 HTML 可视化报告。 报告分两块:左边是按 .topo 真实坐标画的拓扑,每台设备角标写着它收到多少条命令、 有几条失败,点设备会跳到右边对应的命令明细;右边按设备列出每条命令的时间、 来自哪个工具(下发 / 执行 / 探测 / 读回)、执行状态和可展开的回显。 所有设备操作都会自动留痕,不需要额外开关。日志在 %USERPROFILE%.ensp-mcp\commands.jsonl,可用 ENSP_MCP_LOG_DIR 改目录。 Args: path: .topo 路径。给了就只看这份拓扑上的记录,并按它的坐标画图; 省略则用最近一次 topo_* 用过的拓扑,再没有就把日志里的设备平铺成网格。 device: 只看某一台设备,例如 "Core1"。省略看全部。 out_path: 报告输出路径,省略则写到拓扑同目录的 <拓扑名>-commands.html。 limit: 最多取最近多少条命令记录,默认 2000,范围 1–20000。 show_output: 明细里是否附带命令回显,默认带。 open_browser: 生成后是否自动用默认浏览器打开,默认不打开。 返回 report(HTML 绝对路径)、commandCount、failedCommands、byDevice 等统计。 |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 19 tools
Most tools target clearly distinct operations: topology editing (topo_*), device interaction (device_*), verification (lab_verify), and reporting (command_trace). The only mild overlap is among device_exec, device_push_config, and device_batch, but their descriptions make the boundaries clear (arbitrary commands vs. config push vs. multi-device fan-out).
The set largely follows a predictable prefix_action convention (topo_validate, device_exec, list_models, lab_verify). A couple of names such as environment_check and command_trace use noun_verb ordering rather than the dominant verb/prefix style, but the overall pattern remains easy to read and predict.
19 tools is slightly above the typical ideal range but is justified by the breadth of the domain: topology CRUD, layout/export, environment checks, device operations, batch execution, lab verification, and tracing. Each tool earns its place, with no obvious redundant entries.
The surface covers the full lifecycle: model discovery, topology creation/edit/validate/layout/export/render, environment readiness, device command execution, config push/fetch/probe, session management, batch operations, lab verification, and command tracing. There are no obvious dead ends for the stated purpose.