๐งช gNMIBuddy
An over-engineered and opinionated tool that retrieves essential network information from devices using gNMI and OpenConfig models. Designed primarily for LLMs with Model Context Protocol (MCP) integration, it also provides a full CLI for direct use.
Opinionated by design, over-engineered by passion. gNMI and YANG expose overwhelming amounts of data with countless parameters. This tool provides what I consider the most relevant information for LLMs. And who doesn't enjoy building complicated solutions.
๐ฏ What It Does
Retrieve structured network data in JSON format:
- ๐ Routing: BGP, ISIS protocols and neighbor states
- ๐ Interfaces: Status, configuration, and statistics
- ๐ท๏ธ MPLS: Labels, forwarding tables, and segment routing
- ๐ VPN/VRF: L3VPN configuration and route targets
- ๐ Logs: Filtered device logs with keyword search
- ๐ Topology: Device neighbors and network-wide topology analysis
See the API definition for all available APIs and options.
โก Prerequisites
- Python
3.13+ uv, see the docs to install it.brewis recommended for macOS users
- Network devices with gNMI enabled.
Windows users: The repo require a Unix-like environment. Use WSL.
Device Compatibility
Tested on:
- Cisco XRd Control Plane (
24.4.1.26I,25.3.1)
[!NOTE] The
get_logs()function only works on IOS-XR.
Devices must support gNMI and OpenConfig models listed below:
OpenConfig Models dependencies
openconfig-system >= 0.17.1openconfig-interfaces >= 3.0.0openconfig-network-instance >= 1.3.0
[!NOTE] If the required model for a function is not found, gNMIBuddy will return an error. If the model version is older than required, it will continue execution but warn the user about potential errors.
You can use the capabilities command to verify the supported models on a specific device. If you have many devices you can use the --device option.
uvx --from git+https://github.com/jillesca/gNMIBuddy.git \
gnmibuddy device capabilities --all-devices
Device Inventory file
gNMIBuddy identifies devices by hostname and looks up their corresponding IP addresses and credentials from the inventory file.
[!CAUTION] Without a device inventory file, gNMIBuddy cannot operate.
Provide device inventory via --inventory PATH or set NETWORK_INVENTORY env var.
[!TIP] Store environment variables in a
.envfile.
The inventory must be a JSON list of Device objects with these required fields:
name: Device hostnameip_address: IP for gNMI connectionsnos: Network OS identifieriosxronly for now, use it even if you have other NOS. More will be added later.
Authentication (choose one method):
- Username/Password: Requires both
usernameandpasswordfields - Certificate-based: Requires both
path_certandpath_keyfields
Schema: `src/schemas/models.py` | Example: `xrd_sandbox.json`
[
{
"name": "xrd-1",
"ip_address": "10.10.20.101",
"nos": "iosxr",
"username": "cisco",
"password": "C1sco12345"
},
{
"name": "xrd-2",
"ip_address": "10.10.20.102",
"nos": "iosxr",
"path_cert": "/opt/certs/device.pem",
"path_key": "/opt/certs/device.key"
}
]
[!TIP] Validate your inventory: Use
gnmibuddy inventory validateto check your inventory file for proper format, valid IP addresses, required fields, and authentication configuration before running network commands.
๐ Quick Start
๐ฏ Instant Testing with MCP Inspector
Fastest way to try gNMIBuddy:
# Replace `xrd_sandbox.json` with your actual inventory file
echo '#!/usr/bin/env bash' > /tmp/gnmibuddy-mcp-wrapper \
&& echo 'exec uvx --from git+https://github.com/jillesca/gNMIBuddy.git gnmibuddy-mcp "$@"' >> /tmp/gnmibuddy-mcp-wrapper \
&& chmod +x /tmp/gnmibuddy-mcp-wrapper \
&& NETWORK_INVENTORY=xrd_sandbox.json npx @modelcontextprotocol/inspector /tmp/gnmibuddy-mcp-wrapper
[!TIP] No repo cloning, no MCP client setup required! If you don't have XRd, see Testing with DevNet Sandbox.
๐ Have an MCP Client? (VSCode, Cursor, Claude Desktop)
Recommended: No installation required - runs directly from GitHub using uvx:
| MCP Client | Configuration |
|---|---|
| VSCode | ๐ Copy config |
| Standard MCP Clients | ๐ Copy config |
For Development - when you need to test local changes:
| MCP Client | **Co
Tools 5
get_routingRetrieve BGP and ISIS protocol and neighbor states.get_interfacesRetrieve status, configuration, and statistics for network interfaces.get_mplsRetrieve MPLS labels, forwarding tables, and segment routing information.get_logsFilter device logs with keyword search (IOS-XR only).get_topologyAnalyze device neighbors and network-wide topology.Environment Variables
NETWORK_INVENTORYrequiredPath to the JSON file containing device inventory and credentials.