Nornir MCP Server
A FastMCP server that provides network automation tools by exposing Nornir and NAPALM operations as MCP tools, allowing users to manage and interact with network devices through compatible MCP clients.
README
🌐 Nornir MCP Server
A FastMCP server providing network automation tools powered by Nornir and NAPALM.
This server acts as a bridge, exposing Nornir/NAPALM network operations as MCP (Massively Concurrent Processing) tools, making them easily accessible from compatible MCP clients (like the FastMCP Web UI).
✨ Key Features
- Leverages Nornir for inventory management and concurrent task execution against network devices.
- Uses NAPALM for multi-vendor device interaction (information gathering, command execution).
- Built with FastMCP for seamless integration with MCP clients using various transports (SSE in this configuration).
- Containerized with Docker 🐳 for easy setup and deployment.
- Uses
uvfor fast Python dependency management within the container ⚡.
🔧 Prerequisites
Before you begin, ensure you have the following installed:
- Docker
- Docker Compose (Usually included with Docker Desktop)
⚙️ Configuration
Before running the server, you must configure your network inventory and device credentials:
- Navigate to the
conf/directory in the project. - Edit
hosts.yaml: Define your network devices. Specify their management IP/hostname, platform (e.g.,ios,junos,eos), credentials (if not using defaults), and assign them to groups if desired. - Edit
groups.yaml: Define device groups with shared properties (like platform or connection options). Settings here can override defaults. - Edit
defaults.yaml: Set default credentials (username,password) and connection options (like NAPALMsecretfor enable passwords or defaultplatform).- ⚠️ Important Security Note: The default configuration uses plaintext credentials in YAML files. This is suitable for testing/lab environments. For production, strongly consider using Nornir's built-in secrets management features (e.g., environment variables, HashiCorp Vault plugin) to avoid storing sensitive information directly in configuration files. Modify
nornir_ops.pyand your configuration if you implement a secrets provider.
- ⚠️ Important Security Note: The default configuration uses plaintext credentials in YAML files. This is suitable for testing/lab environments. For production, strongly consider using Nornir's built-in secrets management features (e.g., environment variables, HashiCorp Vault plugin) to avoid storing sensitive information directly in configuration files. Modify
- Review
config.yaml: Ensure the inventory file paths (host_file,group_file,defaults_file) point correctly to the files within theconf/directory (they should by default). Adjust runner options (num_workers) if needed.
▶️ Running the Server
Once configured, you can easily run the server using Docker Compose:
- Ensure you have configured the
conf/directory as described above. - Open a terminal or command prompt in the project's root directory (the same directory as the
Dockerfileanddocker-compose.ymlfiles). - Run the following command:
docker-compose up --build -d- The
--buildflag tells Docker Compose to build the image based on theDockerfilethe first time or if any project files (like.pyfiles orpyproject.toml) have changed. - This command will start the Nornir MCP server in a Docker container.
- The
- The server logs will be displayed in your terminal. By default, it should be accessible on port
8000of your host machine (localhost). - To stop the server, press
Ctrl+Cin the terminal wheredocker-composeis running. To remove the container afterwards, rundocker-compose down.
🔌 Adding to MCP Client
To use the tools provided by this server in an MCP client (like the official FastMCP Web UI or other compatible clients):
- Make sure the Nornir MCP server is running (using
docker-compose up). - Open your MCP client application.
- Find the option to add or manage MCP Server connections.
- Add a new connection with the following details:
- Server URL: Since this server uses the SSE (Server-Sent Events) transport and runs on port 8000 by default, the URL will be:
sse://localhost:8000- (If your Docker host has a different IP address accessible by the client, replace
localhostwith that IP, e.g.,sse://192.168.1.100:8000)
- Connection Name: Give it a descriptive name, for example,
Nornir Lab Server.
- Server URL: Since this server uses the SSE (Server-Sent Events) transport and runs on port 8000 by default, the URL will be:
- Save and connect to the newly added server.
- The MCP client should discover the
Nornir_MCPservice and list all the available tools (likeget_facts,send_command, etc.). You can now use these tools via the client interface! 🎉
🛠️ Available Tools & Resources
Once connected via an MCP client, the following tools (under the "Nornir_MCP" service name) should typically be available:
- Inventory:
list_all_hosts: Lists devices configured in your Nornir inventory (conf/hosts.yaml).
- NAPALM Getters: (Retrieve information)
get_factsget_interfacesget_interfaces_ipget_interfaces_countersget_config(withretrieveoption: running, startup, candidate)get_arp_tableget_mac_address_tableget_usersget_vlansget_snmp_informationget_bgp_neighbors- (Availability depends on device platform and NAPALM driver support)
- Execution:
send_command: Send a single, read-only command to a device and get the output.
- Streaming Resource:
sse://updates: Provides a simple heartbeat event stream. (Can be subscribed to by clients supporting SSE resources).
📄 License
This project is licensed under the MIT License.
🙌 Contributing
Contributions, issues, and feature requests are welcome! Please feel free to submit them via the project's repository.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.