Network MCP Server
Provides tools for interacting with Cisco IOS-XE network devices over SSH, enabling AI agents to read device information, interface status, routing tables, ARP tables, and running configurations, as well as write interface descriptions and save configurations.
Click on "Install 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., "@Network MCP Servershow me the current routing table"
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.
Network MCP Server
A Model Context Protocol (MCP) server that lets an AI agent interact with a Cisco IOS-XE network device over SSH. Built in Python with FastMCP and Netmiko.
The server exposes 7 tools (5 read + 2 write), each with strict input validation and clear descriptions so an LLM agent can discover and use them autonomously.
Course: Agent AI & Automation — Sheridan College Author: Ahmed Instructor: Sebastian
Table of contents
Lab environment
This project targets Cisco's Always-On IOS-XE DevNet Sandbox. It is free, publicly reachable, requires no reservation, and is always up.
Setting | Value |
Host |
|
Port |
|
Username |
|
Password |
|
Device type | Cisco IOS-XE (Catalyst 8000v) |
Reference: Cisco DevNet — Always-On Sandboxes.
Quick connectivity check from your machine:
ssh admin@sandbox-iosxe-latest-1.cisco.com
# password: C1sco12345You should land at Router# (or similar) prompt. If this works, the MCP
server will work too.
The sandbox is shared. Please keep changes small and non-disruptive (e.g. only edit interface descriptions, don't shut interfaces or change IPs).
Install
Requires Python 3.10+.
# 1. Clone / copy the project
cd network-mcp-server
# 2. Create and activate a virtual environment (recommended)
python -m venv .venv
source .venv/bin/activate # on Windows: .venv\Scripts\activate
# 3. Install dependencies
pip install -r requirements.txtDependencies:
mcp[cli]— MCP Python SDK (providesFastMCP)netmiko— multi-vendor SSH/CLI librarypython-dotenv— loads.envfor local dev
Run the server
Option A — standalone (for local testing)
cp .env.example .env
# edit .env if your lab uses different credentials
python server.pyThe server runs over stdio, so it waits on stdin for MCP JSON-RPC
messages. In practice you won't invoke it by hand — you'll connect Claude
Desktop (see below) or the mcp dev CLI.
Option B — interactive dev inspector
mcp dev server.pyThis opens the MCP Inspector in your browser where you can list tools and call them manually.
Tools
Read tools
Tool | Description |
| Hostname, model, software version, uptime, serial. Parses |
| All interfaces with status, IP, description. Parses |
| IPv4 routing table. Parses |
| IP-to-MAC mappings. Parses |
| Full running config, or a single section (e.g. |
Write tools
Tool | Description |
| Sets a description on an interface and verifies the change was applied by reading it back. Args: |
| Runs |
All tool outputs are JSON strings so the LLM can reason over structured
data. When Netmiko's TextFSM parsers can't handle an output, the server
falls back to raw CLI text inside a {"raw": "..."} wrapper.
Connect to Claude Desktop
Locate Claude Desktop's config file:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.jsonLinux:
~/.config/Claude/claude_desktop_config.json
Merge the block below into the file (use the full absolute path to your
server.py):
{
"mcpServers": {
"network-mcp-server": {
"command": "python",
"args": ["/ABSOLUTE/PATH/TO/network-mcp-server/server.py"],
"env": {
"DEVICE_HOST": "sandbox-iosxe-latest-1.cisco.com",
"DEVICE_PORT": "22",
"DEVICE_USERNAME": "admin",
"DEVICE_PASSWORD": "C1sco12345",
"DEVICE_TYPE": "cisco_xe"
}
}
}
}A ready-to-copy version lives in claude_desktop_config.example.json.
Fully quit and reopen Claude Desktop. (Just closing the window is not enough — it keeps the MCP process alive.)
In a new chat, click the 🛠️ / tools icon. You should see
network-mcp-serverlisted with 7 tools.
Example interactions
Once connected, try these prompts:
"What device am I connected to? Give me its hostname, model, and IOS version." The agent will call
get_device_info.
"List all interfaces that currently have an IP address assigned." The agent will call
get_interfacesand filter the results.
"Show me the default route." The agent will call
get_routesand pick the entry with network0.0.0.0.
"Set the description on GigabitEthernet2 to 'managed by MCP demo', then confirm the change was applied." The agent will call
configure_interface_description, then (optionally)get_running_configwithsection='interface GigabitEthernet2'to double-check.
"Save the running config to startup." The agent will call
save_config.
Permissions required
The MCP server needs:
Network egress from the host machine to the device's SSH port (TCP/22 by default). On corporate networks you may need a VPN or proxy.
A device account with privileged exec rights — the DevNet sandbox's
adminaccount is already enable-level. If you use your own device, the account must be able to enterconfig tand issuewrite memory.Local read access to the
.envfile or equivalent environment variables set by Claude Desktop.
The server does not need root/admin on your workstation.
Security notes
Credentials are never hardcoded. They come from environment variables (
DEVICE_USERNAME,DEVICE_PASSWORD). If any required env var is missing the server refuses to connect and returns a clear error..envis git-ignored. A.env.example(with safe-to-share DevNet sandbox values) is provided instead.Input validation on every tool. Interface names, descriptions, and config-section filters are all regex-validated before reaching the device CLI. Shell metacharacters (
;,|, backtick, newline, null byte) are rejected.Credentials are never exposed as tool arguments. The LLM cannot read, log, or exfiltrate them — it only sees tool outputs.
Write tools include verification.
configure_interface_descriptionreads the config back after applying the change and reportsapplied: true/false.Scope is narrow. The two write tools can only change interface descriptions and save the config. Destructive operations (shutdown, IP-address change, VLAN delete,
erase startup-config) are deliberately not exposed.
Troubleshooting
"Missing required environment variable(s)"
You forgot to set DEVICE_HOST / DEVICE_USERNAME / DEVICE_PASSWORD.
Copy .env.example to .env or set them in Claude Desktop's env block.
"Authentication to failed" Double-check the password. If you changed the sandbox or use a different device, make sure SSH is enabled and the account has privileged-exec access.
"Connection to timed out"
Network egress is blocked. Try ssh admin@sandbox-iosxe-latest-1.cisco.com
from the same machine. If that hangs too, your firewall/VPN is the issue.
Claude Desktop doesn't show the server after editing the config
Fully quit Claude Desktop (not just close the window) and reopen it. On
macOS: Cmd+Q. On Windows: right-click tray icon → Quit.
Tool call returns raw text instead of parsed JSON
This means Netmiko's TextFSM template didn't match the device output
(different IOS version, different platform). The server falls back to raw
CLI text in {"raw": "..."}. The agent can still reason over it; it's
just not structured.
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/i-Nihal/network-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server