Nokia SR OS gNMI MCP Server
Manages Nokia SR OS devices via gNMI, enabling configuration retrieval, modification, and operational state queries using YANG paths, as well as MD-CLI command execution.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Nokia SR OS gNMI MCP Server Show me the router interfaces config on pe1"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Nokia SR OS gNMI MCP server
A local stdio MCP server for Nokia SR OS gNMI. It exposes configuration and state reads, configuration update/replace/delete, capabilities, device sessions, and optional YANG path search.
Requirements
Python 3.11 or newer and a gNMI-enabled Nokia SR OS device. The server uses the official MCP Python SDK 2.x and pyGNMI. MCP 2.x serves both current and older MCP clients over stdio.
Related MCP server: io.github.shigechika/junos-mcp
Install
uv sync --python 3.13
uv run nokia-gnmi-mcpTo install the command independently of the checkout, run uv tool install --python 3.13 ..
For Codex, configure ~/.codex/config.toml with an absolute path to the environment executable:
[mcp_servers.nokia-gnmi-mcp]
command = 'C:\path\to\gNMI-MCP-server\.venv\Scripts\nokia-gnmi-mcp.exe'
args = []Restart Codex after changing the configuration. A typical first call is sros_connect with a session name, host, username, and password. Credentials are kept in process memory for that session; they are never written to the configuration file.
TLS certificate verification is enabled by default. For a lab with a self-signed certificate, explicitly set skip_verify=true; for a plaintext lab endpoint, explicitly set insecure=true. The server never retries a failed TLS connection over plaintext.
Nokia YANG workflow
For reliable SR OS paths, use nokia-yang-mcp to find and check a path for the target platform. Then connect with sros_connect, read the current value with sros_get_config or sros_get_state, and pass the checked path to a Set tool if a change is needed. yang_search below is a local fallback for discovery when that separate server is unavailable.
Tools
Tool | Purpose |
| Open or close a named gNMI session |
| Read YANG paths with JSON IETF encoding |
| Change configuration; replace removes unspecified nodes in its subtree |
| Read gNMI version, encodings, and model summary |
| Show in-memory sessions without passwords |
| Search local Nokia YANG paths |
yang_search requires Nokia YANG submodule files under a yang directory. Set NOKIA_GNMI_YANG_DIR to the absolute path of that directory. The server creates cache/configure-paths.txt and cache/state-paths.txt within it. You can also place prebuilt files there, one path per line. The directory must be writable to build the cache.
The previous sros_cli_command tool was removed: pyGNMI's get() does not accept the vendor extension argument used by that tool. Use gNMI paths for reads or a separate CLI transport for MD-CLI commands.
Check
uv run python -m unittest discover -s tests -vThe test suite checks MCP tool discovery, argument validation, and that a TLS failure never triggers a plaintext retry. Device operations require a live Nokia endpoint and are not exercised by the local tests.
Available Tools
10 toolssros_capabilitiesB
Get gNMI capabilities from Nokia SR OS device. Returns supported encodings, YANG models, and gNMI version.
Inputs: name (required).
sros_connectA
Connect to a Nokia SR OS device via gNMI (gRPC). Registers a named session with credentials for subsequent operations. Default port is 57400. TLS certificate verification is enabled by default.
Inputs: host (required), name (required), password (required), username (required), +4 more.
sros_disconnectC
Close a gNMI session to a Nokia SR OS device.
Inputs: name (required).
sros_get_configA
Get configuration from Nokia SR OS via gNMI Get (datatype=config). Provide one or more YANG paths. Uses json_ietf encoding.
Nokia SROS YANG path examples: /configure/router[router-name=Base]/interface /configure/port[port-id=1/1/c2/1] /configure/service/vprn[service-name=CUST-1] /configure/router[router-name=Base]/bgp /configure/card[slot-number=1] /configure (entire config)
Inputs: name (required), paths (required).
sros_get_stateA
Get operational state from Nokia SR OS via gNMI Get (datatype=state). Provide one or more YANG paths. Uses json_ietf encoding.
Nokia SROS state path examples: /state/router[router-name=Base]/interface[interface-name=to-pe2] /state/port[port-id=1/1/c2/1] /state/router[router-name=Base]/bgp/neighbor /state/card[slot-number=1] /state/system/information
Inputs: name (required), paths (required).
sros_list_sessionsB
List all active Nokia SR OS gNMI sessions.
Inputs: no named parameters.
sros_set_deleteA
Delete configuration on Nokia SR OS via gNMI Set. Removes the config subtree at the given path(s).
Example: paths: ['/configure/router[router-name=Base]/interface[interface-name=test]']
Inputs: name (required), paths (required).
sros_set_replaceA
Replace configuration on Nokia SR OS via gNMI Set. Replaces the entire subtree at the given path with the provided value. WARNING: This removes any existing config under the path that is not in the new value.
Inputs: name (required), path (required), value (required).
sros_set_updateA
Update (merge) configuration on Nokia SR OS via gNMI Set. Provide a YANG path and JSON value to merge.
Example — create interface: path: /configure/router[router-name=Base]/interface[interface-name=lo0] value: {"ipv4": {"primary": {"address": "10.0.0.1", "prefix-length": 32}}}
Example — enable port: path: /configure/port[port-id=1/1/c2/1] value: {"admin-state": "enable"}
Inputs: name (required), path (required), value (required).
yang_searchA
Search Nokia SR OS YANG paths by keyword. Use this to find the correct gNMI path before using sros_get_config/sros_get_state/sros_set_update.
Examples: yang_search('fpe', 'configure') → find FPE paths yang_search('end-dt2', 'configure') → find SRv6 EVPN function paths yang_search('bgp-evpn', 'configure') → find EVPN BGP paths yang_search('pxc', 'configure') → find Port Cross-Connect paths yang_search('neighbor', 'state') → find BGP neighbor state paths
Requires YANG models in yang/sros-25.10/YANG/ or pre-built cache in yang/cache/.
Inputs: keyword (required), tree, max_results.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 10 tools
Each tool has a clearly distinct purpose: session lifecycle, YANG path discovery, config/state retrieval, set variants, and capabilities. The get_config vs get_state and set_update/replace/delete distinctions are explicit in both names and descriptions. No meaningful overlap or ambiguous boundaries exist.
Nine of ten tools use the consistent sros_ prefix with verb_or_noun naming, making the set mostly predictable. The exception is yang_search, which breaks the sros_ pattern but remains clear. This is a minor deviation rather than a pattern failure.
Ten tools is well-scoped for a gNMI configuration and state management server. Each tool earns its place, covering connection handling, path discovery, retrieval, mutation, and capabilities without bloat. The count is neither thin nor excessive.
The surface covers gNMI Capabilities, Get (config and state), Set (update, replace, delete), session lifecycle, and YANG path discovery. The major missing operation is gNMI Subscribe for streaming telemetry, which is a core gNMI RPC. This is a notable but not fatal gap for configuration-focused workflows.
Maintenance
Related MCP Connectors
An MCP server that provides an API to LLMs to manage their JumpCloud resources.
MCP server for Product Management
Related MCP Servers
- AlicenseAqualityAmaintenanceProduction-grade MCP server for MikroTik RouterOS with secure AI-native network automation.133278 npm106MIT
- AlicenseAqualityBmaintenanceMCP server for Juniper networks, enabling AI assistants to execute CLI commands, manage configuration, perform upgrades, and run diagnostics on Junos devices via STDIO transport.28304 PyPI1Apache 2.0
- AlicenseBqualityDmaintenanceAn MCP server that gives Claude and other LLM agents programmatic access to EVE-NG network labs, enabling creation, configuration, and management of virtual network topologies through natural language.142Apache 2.0
- AlicenseNot gradedqualityDmaintenanceMCP 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