Network AIops

io.github.AIops-tools由 GitHub 账号 AIops-tools 发布v0.15.0更新于 Oct 30, 2026

Governed network device ops (NAPALM) — 33 MCP tools with audit/undo.

概览

AI 生成的概览

基于 NAPALM 的多厂商网络设备运维:33 个 MCP 工具,可读取设备状态、诊断故障并执行带审计的配置变更。

可以做什么
  • 读取设备信息、接口、计数器、IP、BGP/LLDP 邻居、ARP/MAC 表、VLAN、路由、硬件环境、光模块、NTP、用户、SNMP 信息与 VRF,以及汇总的设备健康状态
  • 运行只读根因诊断,检查接口与 BGP 邻居异常,每条结论都引用触发它的实测数值
  • 备份运行配置,并对候选配置做差异预演
  • 合并、整体替换或回滚设备配置,保留变更前状态并记录撤销令牌
  • 在 NetBox 中查询设备与接口的预期状态
  • 列出并应用已记录的可逆写入,所有调用都写入本地审计数据库
适用场景
适合让助手检查、排查或修改 Cisco IOS/IOS-XE、NX-OS、IOS-XR、Arista EOS 与 Juniper Junos 设备,并且需要为每次读写留下可审计记录的场景。由于测试套件基于模拟、尚未在真实设备上验证,更适合实验环境或自行验证过的环境。
运行要求
以本地 Python 包运行(uv tool install,插件方式则用 uvx),需要一份列出设备、驱动与主机的配置文件。设备凭据与可选的 NetBox API 令牌存放在加密密钥库中,由环境变量 NETWORK_AIOPS_MASTER_PASSWORD 解锁。需能通过网络访问设备,使用 SSH、HTTPS/eAPI、NX-API 或 NETCONF。
安装前请注意
写入类工具会改动线上设备配置:config_merge 与 config_rollback 为中风险,config_replace 为高风险,undo_apply 会应用已记录的逆向操作。没有只读开关或审批闸门,工具只做记录与风险标注,因此应使用只读权限的设备账号与 NetBox 令牌来限制写入。主密码可解锁加密密钥库,旧版明文密码环境变量属于已弃用的回退方式。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Network AIops,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

network-aiops

Audit availability: Real writes require a committed pending audit row and stop before contacting the platform if storage is unavailable. Reads and previews may continue with a warning; new audit rows store outcome summaries rather than full responses.

Disclaimer: This is a community-maintained open-source project and is not affiliated with, endorsed by, or sponsored by Cisco, Arista, Juniper, NetBox Labs, or any network vendor. Vendor and product names are trademarks of their respective owners. Source code is publicly auditable at github.com/AIops-tools/Network-AIops under the MIT license.

Governed multi-vendor network device operations for AI agents — 33 MCP tools, every one wrapped with the bundled @governed_tool harness: a local unified audit log under ~/.network-aiops/, token/runaway budget guard, undo-token recording, and descriptive risk-tier labels. Credentials (device passwords + the NetBox token) are kept in an encrypted store (secrets.enc), never plaintext on disk.

Devices are reached over NAPALM; an optional NetBox block adds source-of-truth lookups.

Standalone: the governance harness is bundled in the package (network_aiops.governance) — network-aiops has no external skill-family dependency. Coverage focuses on common device operations and is not yet exhaustive.

Verification status: the test suite is mock-based; not yet validated against live devices — self-testable with cEOS / vMX / containerlab. See docs/VERIFICATION.md.

What works

Read device facts, interfaces (+ counters/IP), BGP/LLDP neighbors (summary and detail), ARP/MAC tables, VLANs, route lookups, hardware environment, optics, NTP, users, SNMP info, VRFs, and an aggregated device_health; run read-only RCA diagnostics that flag down/erroring/flapping interfaces and unhealthy BGP neighbors — each finding citing the measured number that tripped it; back up the running config, dry-run a config diff, and merge/replace/rollback config — across the five core NAPALM platforms below. Optional NetBox lookups (devices + interfaces) confirm intended state before a change.

NAPALM does not implement every getter on every platform; an unsupported getter returns a teaching error ("not supported by the <driver> driver") rather than crashing. Secrets are never returned — get_users redacts password hashes and get_snmp_information redacts community strings.

Supported devices

PlatformNAPALM driverTransport
Cisco IOS / IOS-XEiosSSH
Cisco Nexus NX-OSnxos (NX-API) / nxos_ssh (SSH)HTTPS / SSH
Cisco IOS-XRiosxrSSH (XML agent)
Arista EOSeoseAPI (HTTPS)
Juniper JunosjunosNETCONF (SSH)

Additional platforms (Nokia SR OS / SR Linux, Huawei VRP, etc.) are reachable via NAPALM community drivers but are not officially tested here. Need one? See Contributing.

Supported actions

ActionToolR/WRisk
Device facts (hostname/vendor/model/OS/serial/uptime)device_factsRlow
Interfaces (up/down, speed, description)get_interfacesRlow
Interface traffic + error countersget_interfaces_countersRlow
Interface IP addressesget_interfaces_ipRlow
BGP neighbors (summary / detail)get_bgp_neighbors / get_bgp_neighbors_detailRlow
LLDP neighbors (summary / detail)get_lldp_neighbors / get_lldp_neighbors_detailRlow
ARP tableget_arp_tableRlow
MAC address tableget_mac_address_tableRlow
VLANsget_vlansRlow
Route lookupget_route_toRlow
Hardware environment (fans/temp/power/CPU/mem)get_environmentRlow
Optical transceiver levelsget_opticsRlow
NTP servers / sync statsget_ntp_servers / get_ntp_statsRlow
Local users (hashes redacted)get_usersRlow
SNMP info (communities redacted)get_snmp_informationRlow
Network instances (VRFs)get_network_instancesRlow
Aggregated device healthdevice_healthRlow
Interface health RCA (down / errors / discards / flaps)interface_health_rcaRlow
BGP neighbor RCA (down / shut / reset / route-less)bgp_neighbor_rcaRlow
Back up running configconfig_backupRlow
Diff a candidate (dry-run)config_diffRlow
Merge config + commitconfig_mergeWmedium
Replace full config + commitconfig_replaceWhigh
Roll back last commitconfig_rollbackWmedium
NetBox list devicesnetbox_list_devicesRlow
NetBox get devicenetbox_get_deviceRlow
NetBox device interfacesnetbox_device_interfacesRlow
List recorded reversible writesundo_listRlow
Apply a recorded inverse (governed, single-use, dry-run capable)undo_applyWmedium

What this tool does, and does not, decide

It delivers multi-vendor network device (NAPALM) + NetBox operations — reads and writes — accurately and efficiently, and records every one of them. It does not decide whether a write is allowed to happen. That is the agent's judgement, or the permission of the account you connect it with: log in with a device account at a read-only privilege level (and give NetBox a read-only API token), and the writes fail at the server — the place that actually owns the permission.

So there is no read-only switch, no policy file, no approval gate to configure. The one thing the tool guarantees is that nothing is silent: every call, over MCP and over the CLI alike, lands an audit row in ~/.network-aiops/audit.db, and destructive writes still capture their before-state and record an inverse where one exists.

Each tool declares a risk_level, carried into the audit row as a descriptive tier (none/confirm/review) — so a reviewer can see at a glance that a row was a high-risk delete. It is a label, not a gate.

Running a smaller / local model? See agent-guardrails.md — it lists the guardrails this tool enforces for you (so you don't spend prompt budget restating them) and gives a ready-made system prompt for what's left.

Quick Start

As a Claude Code plugin

One install gives an agent both the skill and the MCP server:

/plugin marketplace add AIops-tools/marketplace/plugin install network-aiops@aiops-tools

The MCP server is fetched with uv and pinned to the package version this plugin declares, so an audit row can be traced back to the code that wrote it. Credentials are still configured with network-aiops init — see below.

As an OpenClaw plugin

The same bundle is published on ClawHub, where one install delivers the skill and its MCP server together:

bash
openclaw plugins install clawhub:@zw008/network-aiopsopenclaw skills info network-aiops          # expect: Visible to model: yes

Restart the OpenClaw gateway afterwards so it loads the plugin. The MCP server is fetched with uv, pinned to this exact release, so uvx has to be on PATH — without it the skill still installs but reports Visible to model: no. Credentials are configured exactly as below.

As a CLI or standalone MCP server

bash
uv tool install network-aiopsnetwork-aiops init                                  # wizard: device + driver + host + encrypted passwordnetwork-aiops doctornetwork-aiops device facts -t core-sw1network-aiops device health -t core-sw1network-aiops diagnose interface-health -t core-sw1   # worst-first interface RCAnetwork-aiops diagnose bgp -t core-sw1                # worst-first BGP-neighbor RCAnetwork-aiops config backup -t core-sw1 -o core-sw1.cfg

Playbook: triage a flaky uplink before touching config

bash
# 1. Ask the device what's actually wrong — findings are ranked worst-first and#    each cites the measured value (error count, last-flap seconds, uptime).network-aiops diagnose interface-health -t core-sw1network-aiops diagnose bgp -t core-sw1
# 2. If interface-health flags a link admin-up/oper-down with climbing errors and#    BGP shows the peer on that path recently reset, you have your root cause: a#    physical-layer fault (cable/optic) resetting the session — not routing.
# 3. Confirm intended state, then remediate with the governed, audited path.network-aiops device counters -t core-sw1network-aiops config diff -t core-sw1 -f fix.cfg      # dry-run the change first

Create ~/.network-aiops/config.yaml:

yaml
devices:  - name: core-sw1            # used as -t core-sw1    driver: eos               # ios | nxos | nxos_ssh | iosxr | eos | junos    host: 10.0.0.1    username: admin    optional_args:            # passed verbatim to NAPALM (optional)      secret: enable-pw       # enable/secret      port: 443# Optional source-of-truth:netbox:  url: https://netbox.example.com

Secrets are stored encrypted in ~/.network-aiops/secrets.enc (Fernet/AES + scrypt-derived key; chmod 600) — never in config.yaml or a plaintext .env. Device passwords are keyed by device name; the NetBox token uses the reserved name netbox-token:

bash
network-aiops init                     # interactive wizard (recommended)network-aiops secret set core-sw1      # store a device password (hidden prompt)network-aiops secret set netbox-token  # store the NetBox API tokennetwork-aiops secret list              # names only — values are never printednetwork-aiops secret migrate           # import a legacy plaintext .env, then delete it

Export NETWORK_AIOPS_MASTER_PASSWORD to unlock the store non-interactively (MCP server / cron). Legacy plaintext env vars (NETWORK_<TARGET_UPPER>_PASSWORD, NETWORK_NETBOX_TOKEN) remain a deprecated fallback. An empty device password is allowed for key-based SSH auth.

MCP

jsonc
{  "command": "network-aiops",  "args": ["mcp"],  "env": {    "NETWORK_AIOPS_CONFIG": "~/.network-aiops/config.yaml",    "NETWORK_AIOPS_MASTER_PASSWORD": "…"   // unlocks the encrypted secret store  }}

Audit & Safety

  • Every tool call is logged to ~/.network-aiops/audit.db (local SQLite; relocate with NETWORK_AIOPS_HOME).
  • config_merge / config_replace capture the pre-change running config and record an inverse config_replace-to-backup undo descriptor.
  • config_replace is risk_level=high; CLI destructive commands (config merge/replace/rollback) require double confirmation and support --dry-run (which prints the diff without committing).
  • All device text passes through sanitize() (output hygiene: control/format-char stripping + truncation).
  • Device passwords and the NetBox token live only in the encrypted secrets.enc (chmod 600); tools never return passwords, SNMP community strings, or hashes.

See skills/network-aiops/SKILL.md and SECURITY.md for details.

Companion Skills

If you want…Use
Network device config / facts (Cisco/Arista/Juniper)network-aiops (this)
Kubernetes cluster operationsa cluster ops skill
Hypervisor VM lifecyclea hypervisor ops skill

Contributing & feature requests

Coverage is intentionally focused. Need a device or action that isn't here yet? Open an issue or pull request at github.com/AIops-tools/Network-AIops — contributions, feature requests, and comments are all welcome.

License

MIT — github.com/AIops-tools/Network-AIops

来源:README.md,提交 959f819

工具

0
SourceWeft 曾在隔离沙箱中以无凭据方式启动该软件包一次,以列出其工具,但未能完成:服务器未能启动。

版本历史

4
  1. v0.15.0最新Oct 30, 2026
  2. v0.14.0Oct 15, 2026
  3. v0.13.0Oct 15, 2026
  4. v0.12.3Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分