Skip to main content
Glama
Nokia SR OS gNMI MCP Server

Nokia SR OS gNMI MCP Server

by coolexer

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-mcp

To 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

sros_connect / sros_disconnect

Open or close a named gNMI session

sros_get_config / sros_get_state

Read YANG paths with JSON IETF encoding

sros_set_update / sros_set_replace / sros_set_delete

Change configuration; replace removes unspecified nodes in its subtree

sros_capabilities

Read gNMI version, encodings, and model summary

sros_list_sessions

Show in-memory sessions without passwords

yang_search

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 -v

The 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 tools
sros_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).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 10 tools

    Disambiguation5/5

    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.

    Naming Consistency4/5

    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.

    Tool Count5/5

    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.

    Completeness4/5

    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

    ActivitySlowing
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers