Skip to main content

multivendor-netconf-mcp

An MCP server that lets an AI agent read and change routers over NETCONF, with the same tools on every platform. A change is checked by the router before it is committed, the agent is shown what would change as a list of configuration paths, and a commit is one the router undoes by itself unless it is confirmed.

Platform Tried on Notes
Juniper Junos vSRX, Junos 20.4R3 docs/junos.md
Cisco IOS XE Catalyst 8000V, IOS XE 17.13.1 docs/cisco.md
Cisco IOS XR IOS XRv 9000, IOS XR 7.11.1 docs/cisco.md

Status: early. Each platform was tried on one release, on virtual routers, and on nothing else. It is not a server for any NETCONF device: every vendor's NETCONF differs enough to need code of its own, and a fourth platform means writing that code. The server applies no rules of its own: it commits whatever it is given. Whoever puts it in front of real routers is responsible for validating it there first, with their own tests. Not affiliated with Juniper or Cisco.

Why this exists

The MCP servers that exist for routers are mostly one per vendor, and return what the command line prints. Juniper publishes junos-mcp-server, and for a person steering an agent it does the job: it runs commands, loads configuration, has a dry run and a confirmed commit. This project started from building a change firewall, Holddown, in front of it. A program that has to judge an agent's change, and not only a person reading along, ran into four limits there. They were seen at commit 2fb721a of junos-mcp-server, against vSRX on Junos 20.4.

junos-mcp-server multivendor-netconf-mcp
What a dry run returns The text of show | compare. A program has to parse indentation, braces and quoted names to know what changed. One line per changed leaf, as its path with list keys: + interfaces interface[ge-0/0/0] description = to vsrx1. The same lines whether the change was written as XML or as set commands.
Pipes in a show command Passed to the router, which honours display and compare and drops match, except, count, last and the rest without saying so. The agent gets the whole output. (PyEZ's cli() documents this.) Refused, with the reason. The server filters the output itself: include, exclude, head, tail and count parameters, the same on every platform.
A confirmed commit that is still pending Told by <commit-confirmed> in the commit history, which Junos 20.4 does not have. On that release a pending commit is not seen without a patch. Told the same way, with a documented fallback for releases without the element ("legacy_pending": true).
Vendors Junos. Junos, Cisco IOS XE and Cisco IOS XR, with the same tools and the same change lines.

Where this server differs by design (on Junos; the Cisco platforms are in docs/cisco.md):

  • The change list is worked out from the configuration, not from text. The server loads the change into the candidate, has the router check it (commit check), then compares the candidate with the committed configuration as XML.
  • List keys come from the router's own YANG modules, read over NETCONF, so an entry is named by all of its keys: security policies policy[trust,untrust].
  • A statement that is switched off shows (deactivate): a line ending in inactive.
  • Somebody else's work is left alone. The candidate on Junos is shared. If it already holds uncommitted changes, the server loads nothing and says so.
  • A commit while a confirmed commit is pending is refused. On Junos any later commit makes the pending one permanent.
  • One login. Show commands go over the NETCONF session too.

What junos-mcp-server has and this does not: Jinja2 templates, PFE commands, a tool that adds a router while it runs, pooled connections, and Juniper behind it. Templates and PFE commands are left out on purpose: a template is a second way to write a change, and a PFE command runs in the forwarding plane's shell. Here a router is added by editing the device list, which the agent cannot do.

Install and run

Needs Python 3.11 or later and uv. NETCONF has to be on: set system services netconf ssh on Junos, and see docs/cisco.md for IOS XE and IOS XR.

Write a devices.json that lists your routers (below), then:

uvx multivendor-netconf-mcp -f devices.json --models
uvx multivendor-netconf-mcp -f devices.json

uvx fetches the server from PyPI and runs it; pip install multivendor-netconf-mcp installs the same command.

The first command reads the routers' YANG modules once, for the keys of their lists. It takes about a minute per software release and is kept under ~/.local/state/multivendor-netconf-mcp (or $NETCONF_MCP_STATE). Run it again after a software upgrade. The second command is the MCP server, on stdio. For an MCP client:

{"mcpServers": {"netconf": {
  "command": "uvx",
  "args": ["multivendor-netconf-mcp==0.3.2", "-f", "/path/to/devices.json"]}}}

Name a version there, as above: the server logs in to your routers, and without one uvx runs whatever release is newest.

devices.json:

{"vsrx1": {"host": "192.0.2.11", "platform": "junos", "username": "netconf"},
 "xe1":   {"host": "192.0.2.21", "platform": "iosxe", "username": "netconf",
           "password_env": "XE1_PASSWORD"}}
Field Meaning
host, username where and as whom to log in
platform junos, iosxe or iosxr
password_env the name of an environment variable that holds the password, so that it is not in the file
password the password itself. Prefer password_env, or keys
key_file a private key to log in with. With neither a password nor this, the login uses your SSH agent and your own keys
ssh_config an OpenSSH configuration file to read for this router (HostName, User, IdentityFile, ProxyCommand)
known_hosts the file the router's host key is looked up in, instead of the known_hosts file in your .ssh folder
host_key_check false turns host key checking off. For labs only
port, ssh_port NETCONF port (830) and, on the Cisco platforms, the SSH port for show commands (22)
legacy_pending true for Junos releases whose commit history has no <commit-confirmed> element (20.4). Without it the server finds nothing pending there and refuses to confirm

On the Cisco platforms the server logs in twice, to NETCONF and to the SSH command line for show commands, with the same login. A key works for both on IOS XE; on IOS XR only a password was tried.

Host keys

The server connects only to a router whose host key is in the known_hosts file, and refuses one that shows a different key. A router you have never logged in to has to be added first: ssh-keyscan -p 830 192.0.2.11 prints its key; check it against the key the router itself shows on its console, then append it to the file. A key stored for the plain address, as ssh does for port 22, is accepted for the NETCONF port too.

A router can have keys of several types, and shows one of them. If the file holds only another type, the server says so and connects once that key is added: ssh-keyscan prints every type, so add all its lines. IOS XE has an RSA key only.

Read-only

uvx multivendor-netconf-mcp -f devices.json --read-only

offers no tool that changes a router and runs only commands that start with show. Use it where an agent should look and not touch. It is a convenience, not a guarantee: the routers' own login class is what limits a login.

The device list is read again

When devices.json changes, the server reads it again at the next call: a router can be added, changed or taken out without a restart. If the file is then not valid, the server says so on its standard error and keeps the list it had.

Over HTTP

export NETCONF_MCP_TOKEN=$(openssl rand -hex 32)
uvx multivendor-netconf-mcp -f devices.json --transport http

serves MCP at http://127.0.0.1:8000/mcp (streamable HTTP) instead of standard input and output, so that one server can be shared. Every request has to carry the token, as Authorization: Bearer <token>; the server does not start without one of at least 32 characters. For an MCP client:

{"mcpServers": {"netconf": {"type": "http", "url": "http://127.0.0.1:8000/mcp",
                            "headers": {"Authorization": "Bearer <token>"}}}}

--host and --port change where it listens. The server speaks plain HTTP: to reach it from another machine, keep it on 127.0.0.1 and put a TLS proxy in front, or the token and the configurations cross the network unencrypted. There is one token: everyone who has it can do everything the server can, and the routers' logs show the server's login, not who asked.

Tools

Tool What it does
get_router_list the routers in devices.json
get_config the configuration as XML, whole or limited by a subtree filter. On Junos also as set commands or in braces (format), or as the diff against a rollback (compare_rollback)
execute_command one exec command, for example show bgp summary, with the output filtered by the server. On Junos also as XML or JSON (format)
execute_command_batch the same command on several routers at once, each router's output under its name
get_facts what a router is: hostname, model, software version, serial number, uptime
get_state operational state as XML over NETCONF, on IOS XE and IOS XR
load_and_commit_config a dry run, a commit, or a commit the router undoes unless confirmed
confirm_commit makes a pending confirmed commit permanent

On Junos a change is <configuration> XML as get_config returns it, the configuration in braces (which is merged: it adds and changes, it does not remove), or lines of set commands. On the Cisco platforms it is XML in the router's own model.

set interfaces ge-0/0/0 description "to vsrx1"
delete protocols bgp group EBGP neighbor 10.0.1.1 shutdown
deactivate interfaces lo0 unit 0 family inet address 10.255.0.2/32

A command may not hold a pipe. In its place:

execute_command(router_name="vsrx1", command="show bgp summary", include="establ")
execute_command(router_name="vsrx1", command="show interfaces terse", exclude="down", count=true)
execute_command(router_name="vsrx1", command="show log messages", tail=20)

include and exclude are regular expressions and ignore case; then head or tail keep that many lines, or count gives their number. The router sends the whole output and the server cuts it down, so a filter saves the agent's reading, not the router's work.

For a change:

  • dry_run=true loads it, has the router check it, returns what would change and discards it.
  • confirm_timeout_secs makes it a confirmed commit. Junos counts in minutes, so give whole minutes (120); anything else is rounded up.
  • comment goes into the router's commit log.

get_config, get_state and the two command tools take a timeout, the seconds a router is given to answer: 60 unless the call says otherwise, up to 600. A router that does not answer in time gives Error on <router>: no answer within N seconds; the request may still be running there.

Limits

  • No rules. Any change the login may make is committed, and any exec command without a pipe is passed to the router as it comes, request system reboot included. Give the login a Junos class that fits, and put a policy in front: Holddown has adapters for this server (junos_netconf, iosxe, iosxr).
  • One session per call. Every call logs in again. That took under a second on the lab routers; what takes long on IOS XR (about ten seconds for a dry run) is the router working on the candidate configuration.
  • One release per platform, on virtual routers. Nothing else was tried.
  • Groups are compared as written. What a group changes where it is applied does not show under the places it applies to.
  • Secrets are returned. get_config gives the configuration as the router holds it, password hashes included, and a dry run prints the hash of a secret it sets.
  • Element names are printed without their module.

Development

git clone https://github.com/Jitter00/multivendor-netconf-mcp
cd multivendor-netconf-mcp
uv sync
uv run ruff check
uv run pytest

The tests need no router. Branches and pull requests only.

Licence

MIT. See LICENSE.

Metadata

Release files for multivendor-netconf-mcp 0.3.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for multivendor-netconf-mcp 0.3.2
File Size Uploaded Provenance Actions
multivendor_netconf_mcp-0.3.2.tar.gz 47.6 kB With provenance Details for multivendor_netconf_mcp-0.3.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for multivendor-netconf-mcp 0.3.2
File Interpreter ABI Platform Actions
multivendor_netconf_mcp-0.3.2-py3-none-any.whl Python 3 none any Details for multivendor_netconf_mcp-0.3.2-py3-none-any.whl

Total release size: 82.4 kB

Release files / multivendor_netconf_mcp-0.3.2.tar.gz

Download URL multivendor_netconf_mcp-0.3.2.tar.gz
Size 47.6 kB
Tags Source
SHA-256 checksum
How to use checksums
cbe2191c5022199c206400aaff4f6b62fac4c272ad1ef3d1f87ef78daaae3783
BLAKE2b-256 checksum
How to use checksums
e8a526a5c31fb6442caf3839bcf438b6e6c2e66812d47cd5a7231173fb233b28
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 4, 2026.

Transparency log

Release files / multivendor_netconf_mcp-0.3.2-py3-none-any.whl

Download URL multivendor_netconf_mcp-0.3.2-py3-none-any.whl
Size 34.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
733cd9161dfb5789d1ec8c8af9c661a7251ee2c7a1b67238ab9ba04c8e05bd33
BLAKE2b-256 checksum
How to use checksums
3cae8e5ee44a29f3b771666dedf537085e5687f25ff41e0a2cff739585a4ce82
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 4, 2026.

Transparency log

Security for multivendor-netconf-mcp 0.3.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for multivendor_netconf_mcp-0.3.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 4, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.3.2 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page