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.
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).
uv
for fast Python dependency management within the container ⚡.Before you begin, ensure you have the following installed:
Before running the server, you must configure your network inventory and device credentials:
conf/
directory in the project.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.groups.yaml
: Define device groups with shared properties (like platform or connection options). Settings here can override defaults.defaults.yaml
: Set default credentials (username
, password
) and connection options (like NAPALM secret
for enable passwords or default platform
).
nornir_ops.py
and your configuration if you implement a secrets provider.config.yaml
: Ensure the inventory file paths (host_file
, group_file
, defaults_file
) point correctly to the files within the conf/
directory (they should by default). Adjust runner options (num_workers
) if needed.Once configured, you can easily run the server using Docker Compose:
conf/
directory as described above.Dockerfile
and docker-compose.yml
files).docker-compose up --build -d
--build
flag tells Docker Compose to build the image based on the Dockerfile
the first time or if any project files (like .py
files or pyproject.toml
) have changed.8000
of your host machine (localhost).Ctrl+C
in the terminal where docker-compose
is running. To remove the container afterwards, run docker-compose down
.To use the tools provided by this server in an MCP client (like the official FastMCP Web UI or other compatible clients):
docker-compose up
).http://localhost:8000/sse
localhost
with that IP, e.g., http://192.168.1.100:8000/sse
)Nornir Lab Server
.Nornir_MCP
service and list all the available tools (like get_facts
, send_command
, etc.). You can now use these tools via the client interface! 🎉Once connected via an MCP client, the following tools (under the "Nornir_MCP" service name) should typically be available:
list_all_hosts
: Lists devices configured in your Nornir inventory (conf/hosts.yaml
).get_facts
get_interfaces
get_interfaces_ip
get_interfaces_counters
get_config
(with retrieve
option: running, startup, candidate)get_arp_table
get_mac_address_table
get_users
get_vlans
get_snmp_information
get_bgp_neighbors
send_command
: Send a single, read-only command to a device and get the output.sse://updates
: Provides a simple heartbeat event stream. (Can be subscribed to by clients supporting SSE resources).This project is licensed under the MIT License.
Contributions, issues, and feature requests are welcome! Please feel free to submit them via the project's repository.
Discover shared experiences
Shared threads will appear here, showcasing real-world applications and insights from the community. Check back soon for updates!