nornir-mcp-server
Allows interaction with Cisco network devices (IOS, NX-OS, XR) for configuration management, monitoring, and backup.
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., "@nornir-mcp-server show interfaces on all Cisco devices"
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.
Nornir MCP Server
An enterprise-ready Model Context Protocol (MCP) server that brings the power of Nornir to LLMs like Claude. It seamlessly integrates NAPALM for structured data retrieval and Netmiko for flexible CLI execution, enabling natural language orchestration of complex network infrastructure.
🚀 Overview
The Nornir MCP Server provides a specialized set of tools for network engineers and AI agents to interact with multi-vendor environments safely and efficiently.
Multi-Vendor Support: Standardized interaction for Cisco (IOS, NX-OS, XR), Arista (EOS), Juniper (Junos), and 100+ others.
Dual-Engine Architecture: Combines NAPALM's normalized getters with Netmiko's robust SSH command execution.
Intelligent Filtering: Schema-agnostic device selection by hostname, group, or platform.
Security First: Built-in command blacklisting, input validation (Pydantic), and backup path restrictions.
Per-Call Inventory Reloading: Every MCP tool invocation reloads
config.yamland inventory data from disk.Production Ready: Comprehensive logging and asynchronous execution.
Related MCP server: Packet Tracer MCP
📋 Table of Contents
🛠 Installation
Using uv (Recommended)
# Install as a global tool
uv tool install git+https://github.com/sydasif/nornir-mcp-server.git
# Upgrade to latest
uv tool upgrade nornir-mcp-serverUsing pip
pip install git+https://github.com/sydasif/nornir-mcp-server.git⚡ Quick Start
Initialize Configuration:
Create a
config.yamland basic inventory files in your working directory. See Minimal Inventory Example below.Launch the Server:
nornir-mcpVerify Inventory:
The server will look for
config.yamlin the current directory to load your Nornir inventory.
📦 Minimal Inventory Example
To get started quickly, create these three files in your project root:
hosts.yaml
R1:
hostname: 192.168.1.1
platform: ios
groups:
- cisco_iosgroups.yaml
cisco_ios:
platform: ios
username: admin
password: passworddefaults.yaml
# Global defaults
data:
site: NYCconfig.yaml
inventory:
plugin: SimpleInventory
options:
host_file: "hosts.yaml"
group_file: "groups.yaml"
defaults_file: "defaults.yaml"🧪 Lab Environment
For a ready-to-use Containerlab lab with Cisco CSR1000v and Arista cEOS devices, see the companion repository: nornir-mcp-lab
Prerequisites: Containerlab, Docker, Python 3.12+
🧰 Available Tools
The server exposes 5 tools categorized by operational intent. All tools support individual filter parameters for device selection.
Filter Parameters:
filter_name: Filter by device name in inventoryfilter_hostname: Filter by specific hostname or IP addressfilter_group: Filter by group membership (e.g., "cisco", "arista")filter_platform: Filter by platform (e.g., "eos", "ios", "junos")
All filter parameters are optional. When multiple filters are provided, they are combined with AND logic.
Category | Tool | Description |
Inventory |
| List hosts, groups, and metadata. |
Monitoring |
| Generic access to any NAPALM getter (ARP, VLAN, etc.). |
| Execute arbitrary show commands safely. | |
Management |
| Deploy configuration changes with validation. |
| Securely save configurations to local disk. |
⚙️ Configuration
Every MCP tool call reloads config.yaml from the current working directory. The server does not cache a long-lived Nornir instance between requests.
Nornir Setup (config.yaml)
inventory:
plugin: SimpleInventory
options:
host_file: "hosts.yaml"
group_file: "groups.yaml"
defaults_file: "defaults.yaml"
runner:
plugin: threaded
options:
num_workers: 100
logging:
enabled: true
level: INFOCommand Security
The server includes a built-in security engine that validates all CLI commands against a multi-stage validation system before execution. This prevents accidental or malicious use of destructive commands while minimizing false positives for read-only operations.
Security Features:
Read-Only Enforcement: Tools like
show_commandsenforce an allowlist prefix (e.g.,show,display,get,ping,traceroute).Smart Denylist: Destructive keywords (
erase,format,delete,reload) are blocked only when they appear as the first token of a command. This allows legitimate commands likeshow reload historywhile blocking a barereload.Chaining & Redirection Protection: Prevents the use of
;,&&,>, and<to ensure single-command integrity.Path Sandboxing: Configuration backups are protected against directory traversal attacks (
..).
🤖 CLI Integration
Add the following to your claude config:
{
"mcpServers": {
"nornir": {
"command": "nornir-mcp"
}
}
}Add the following to your opencode config:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"nornir": {
"type": "local",
"command": ["nornir-mcp"]
}
}
}Try these prompts:
"Show me all core routers in the US-West region."
"Are there any BGP neighbors down on R1?"
"Backup the running configuration of all Arista switches."
"Check if there are any errors on the interfaces of the edge-group."
🔒 Security
Command Validation: All CLI inputs pass through a multi-stage built-in denylist filter (Keywords and Patterns).
Path Sandboxing: Configuration backups are restricted to the defined root directory to prevent traversal.
👨💻 Development
# Clone and setup
git clone https://github.com/sydasif/nornir-mcp-server.git
cd nornir-mcp-server
uv sync
# Run tests
uv run pytest
# Lint and Format
uv run ruff check . --fix
uv run ruff format .If uv run is unstable in the local environment, use .venv/bin/pytest and .venv/bin/ruff directly.
Relevant internal paths:
src/nornir_mcp/services/runner.py: shared async task execution. Mandatory entry point for all network tasks; accepts filter kwargs (name,hostname,group,platform).src/nornir_mcp/services/inventory.py: shared inventory loading and filtering helper. Reloadsconfig.yamlfrom disk on every call. Accepts filter kwargs directly.src/nornir_mcp/services/napalm.py: shared NAPALM getter execution helper used by monitoring and backup tools. Accepts filter kwargs directly.src/nornir_mcp/tools/monitoring.py: monitoring tools for NAPALM getters and Netmiko show commands.src/nornir_mcp/tools/management.py: management tools for configuration deployment and backups.
✅ Testing
The repository includes a pytest suite under tests/ covering filters, inventory loading, inventory tools, monitoring tools, NAPALM helper behavior, security validation, runner error handling, and backup behavior.
# Run the full test suite
uv run pytest
# Fallback if uv run is unstable
.venv/bin/pytest📄 License
This project is licensed under the MIT License. See LICENSE for details.
Available Tools
5 toolsapply_configADestructive
Send configuration commands to network devices.
Args: commands: List of configuration commands filter_name: Filter by device name in inventory filter_hostname: Filter by specific hostname or IP filter_group: Filter by group membership filter_platform: Filter by platform (e.g., 'cisco_ios', 'arista_eos')
Returns: Dictionary with 'hosts' key mapping hostname -> task result (success or error).
Inputs: commands (required), filter_name, filter_group, filter_hostname, +1 more. Returns: object
backup_configsAIdempotent
Save device configuration to the local disk.
Args: path: Directory path to save backup files filter_name: Filter by device name in inventory filter_hostname: Filter by specific hostname or IP filter_group: Filter by group membership filter_platform: Filter by platform (e.g., 'cisco_ios', 'arista_eos')
Returns: Summary of saved file paths.
Inputs: path, filter_name, filter_group, filter_hostname, +1 more. Returns: object
fetch_dataARead-only
Execute one or more NAPALM getters to retrieve structured data from network devices.
Common available getters:
"facts": Basic device information (vendor, model, uptime).
"interfaces": Interface status, speed, and error statistics.
"interfaces_ip": IP address assignments per interface.
"bgp_neighbors": BGP session states and neighbors.
"config": Retrieve Running/Startup/Candidate configs.
Args: getters: List of NAPALM getter names (e.g., ['facts', 'interfaces']) getters_options: Optional getter-specific options filter_name: Filter by device name in inventory filter_hostname: Filter by specific hostname or IP filter_group: Filter by group membership filter_platform: Filter by platform (e.g., 'cisco_ios', 'arista_eos')
Returns: Structured data per host mapping hostname -> result
Inputs: getters (required), filter_name, filter_group, filter_hostname, +2 more. Returns: object
list_devicesBRead-only
List network devices and inventory information.
Consolidated tool that provides flexible access to inventory data including devices, groups, or both. Use 'details=true' for full device attributes.
Args: query_type: Type of inventory data to return ("devices", "groups", "all") details: Whether to return full inventory attributes (for devices query) filter_name: Filter by device name in inventory filter_hostname: Filter by specific hostname or IP filter_group: Filter by group membership filter_platform: Filter by platform (e.g., 'cisco_ios', 'arista_eos')
Returns: Dictionary containing inventory data based on query_type
Inputs: details, query_type, filter_name, filter_group, +2 more. Returns: object
show_commandsARead-only
Execute raw CLI show commands via SSH.
Args: commands: List of show commands to execute filter_name: Filter by device name in inventory filter_hostname: Filter by specific hostname or IP filter_group: Filter by group membership filter_platform: Filter by platform (e.g., 'cisco_ios', 'arista_eos')
Returns: Dictionary with 'hosts' key mapping hostname -> task result (success or error).
Inputs: commands (required), filter_name, filter_group, filter_hostname, +1 more. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
The tools are mostly distinct: list_devices handles inventory, apply_config pushes configs, backup_configs saves configs, while fetch_data and show_commands both retrieve device data but via different methods (structured NAPALM getters vs raw CLI). This slight overlap prevented a perfect score, but descriptions clarify the distinction.
All tool names follow a consistent verb_noun pattern (list_devices, apply_config, backup_configs, fetch_data, show_commands) using snake_case and imperative verbs. There are no naming deviations or mixed conventions.
The server provides 5 tools, which is well-scaled for a network automation MCP server. Each tool covers a core function—inventory, config push, backup, data collection, and CLI commands—without unnecessary bloat.
The tool surface covers the primary network operations: inventory access, configuration management (apply and backup), structured data retrieval, and raw command execution. Minor gaps exist (e.g., no explicit config comparison or device reboot), but most workflows can be accomplished via the existing tools, such as using fetch_data with the 'config' getter.
Related MCP Connectors
An MCP server that provides an API to LLMs to manage their JumpCloud resources.
MCP server unifying ERPs, CRMs, APIs and knowledge base for Claude, ChatGPT and Gemini.
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
MCP server connecting AI agents to non-custodial staking data across 130+ networks.
Related MCP Servers
- AlicenseAqualityDmaintenanceAn MCP server that enables LLMs to retrieve structured network information, including routing, interfaces, MPLS, and topology, from devices using gNMI and OpenConfig models. It facilitates real-time network analysis, log filtering, and status monitoring through a standardized interface.1014BSD 3-Clause
- AlicenseNot gradedqualityAmaintenanceAn MCP server that allows LLMs to create, configure, validate, and explain Cisco Packet Tracer network topologies. It provides a comprehensive suite of tools for generating deployment scripts, CLI configurations, and automated network troubleshooting.2,699 PyPI405MIT

Itential MCP Serverofficial
AlicenseBqualityBmaintenanceMCP server for connecting LLMs to Itential Platform, enabling network automation, workflow orchestration, and platform monitoring.7940 PyPI36GPL 3.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