Read-only live Nexus Dashboard (ND) client library plus an MCP server. Log into a running ND and query fabric status/health, switches, interfaces, VRFs, networks, and the embedded template library — for AgenticOps, live validation, and tests.
Design & rationale: ../docs/ND_LIVE_MCP.md.
The core is a plain Python library (nd/); the MCP server (server.py) is a thin wrapper over it.
The same library is imported directly by tests/ and can be reused by CI / Ansible — MCP and CI
share the code, not the execution path.
nd/
config.py env/secrets, per-service base URLs, TLS + output settings
auth.py POST /api/v1/infra/login, JWT cache, refresh on 401
client.py httpx GET core (read-only), auth + single re-auth retry
render.py compact tables + hard output-size guard
tools/ fabrics, switches, interfaces, vrfs, networks, templates
server.py FastMCP server exposing the tools (stdio)
tests/ deterministic tests importing nd/ directly (no live ND, no LLM)
- Read-only (GET only) by design. No config-push/remediation in v1.
- Compact output by default; pass
detail=truefor full JSON on a specific item. - Every result is truncated to
ND_MAX_OUTPUT_CHARSto protect the model's context.
cd nd-live-mcp
uv venv --python 3.12
uv pip install -e ".[dev]"
cp .env.example .env # then fill in ND_HOST / ND_USERNAME / ND_PASSWORDCredentials are read from ND_* environment variables — never from tool arguments or chat. Prefer
an OS keychain that populates the environment over a plaintext .env.
uv run pytest -quv run server.py # stdio transport (default)Add to the workspace .vscode/mcp.json (Copilot) and/or .mcp.json (Claude Code) with
auto-start off, then Start it only when doing ND ops:
Set ND_PASSWORD via your shell/keychain, not in the JSON. Enable/disable per session from the
Tools picker, or Start/Stop the server to control its context cost.
| Tool | Purpose |
|---|---|
nd_list_fabrics / nd_get_fabric |
Fabric inventory (Manage) |
nd_fabric_health |
Health/anomaly summary (Analyze) |
nd_list_switches |
Switch inventory (Manage) |
nd_switch_interfaces |
Interfaces for a switch (Manage) |
nd_list_vrfs / nd_get_vrf |
VRFs (Manage) |
nd_list_networks / nd_get_network |
Networks (Manage) |
nd_list_templates / nd_get_template |
Embedded template library (Manage) |
- Per-service base paths default to the ND 4.2.1
serversblocks (/api/v1/manage,/api/v1/analyze,/api/v1/infra,/api/v1/oneManage); override viaND_*_BASEif your deployment differs. - Some per-item field names are parsed defensively; verify against your ND build and adjust the
first([...])key lists innd/tools/if a column shows-.
{ "servers": { "nd-live": { "type": "stdio", "command": "uv", "args": ["run", "server.py"], "cwd": "${workspaceFolder}/nd-live-mcp", "env": { "ND_HOST": "https://my-nd.example.com", "ND_DOMAIN": "local", "ND_USERNAME": "admin" } } } }