Netmiko MCP Server
Enables management of network devices via SSH using Netmiko, supporting command execution, configuration management, and concurrent operations across multiple vendors.
README
Netmiko MCP Server
An MCP (Model Context Protocol) server for managing network devices via SSH using Netmiko. Features connection pooling, multi-vendor support, and concurrent operations.
Features
- Command Execution: Run CLI commands on single or multiple devices
- Configuration Management: Push configuration changes with optional save/rollback
- Device Inventory: YAML-based device inventory with groups and tags
- Connection Pooling: Efficient connection reuse with health checks
- Multi-Vendor Support: Works with any device type supported by Netmiko
- Concurrent Operations: Execute commands on multiple devices in parallel
- TextFSM Parsing: Optional structured output parsing
Installation
From Source
git clone https://github.com/ntunes/netmiko-mcp-server.git
cd netmiko-mcp-server
pip install -e .
With Docker
docker build -t netmiko-mcp .
Configuration
Device Inventory
Create a config/devices.yaml file with your device inventory:
defaults:
timeout: 30
fast_cli: true
credentials:
production:
username: "${NETMIKO_USERNAME}"
password: "${NETMIKO_PASSWORD}"
secret: "${NETMIKO_SECRET}"
groups:
core_routers:
- core-rtr-01
- core-rtr-02
devices:
core-rtr-01:
host: "192.168.1.1"
device_type: "cisco_ios"
credential_profile: "production"
tags:
- core
- production
core-rtr-02:
host: "192.168.1.2"
device_type: "cisco_ios"
credential_profile: "production"
tags:
- core
- production
pool_settings:
max_connections_per_device: 3
connection_timeout: 300
health_check_interval: 60
Environment Variables
Set credentials via environment variables:
export NETMIKO_USERNAME="admin"
export NETMIKO_PASSWORD="your_password"
export NETMIKO_SECRET="enable_secret"
Optionally set config file location:
export NETMIKO_MCP_CONFIG="/path/to/devices.yaml"
Usage
Running the Server
Stdio transport (for Claude Desktop):
python -m netmiko_mcp
Streamable HTTP transport:
python -m netmiko_mcp --transport streamable-http --port 8339
With Docker:
docker run -p 8339:8339 \
-e NETMIKO_USERNAME=admin \
-e NETMIKO_PASSWORD=secret \
-v ./config/devices.yaml:/app/config/devices.yaml:ro \
netmiko-mcp
With Docker Compose:
# Set credentials in .env or environment
export NETMIKO_USERNAME=admin
export NETMIKO_PASSWORD=secret
docker-compose up -d
Claude Desktop Configuration
Add to your Claude Desktop configuration:
For stdio transport:
{
"mcpServers": {
"netmiko": {
"command": "python",
"args": ["-m", "netmiko_mcp", "--config", "/path/to/devices.yaml"]
}
}
}
For HTTP transport:
{
"mcpServers": {
"netmiko": {
"url": "http://localhost:8339/mcp"
}
}
}
MCP Tools
Command Execution
| Tool | Description |
|---|---|
send_command |
Execute a single command on one device |
send_command_parallel |
Execute the same command on multiple devices concurrently |
send_commands_sequence |
Execute multiple commands sequentially on one device |
Configuration
| Tool | Description |
|---|---|
send_config |
Push configuration commands to one device |
send_config_parallel |
Push configuration to multiple devices concurrently |
Inventory & Discovery
| Tool | Description |
|---|---|
list_devices |
List all devices with optional tag/type filtering |
get_device_info |
Get detailed device information and connection status |
list_groups |
List all device groups and their members |
test_connection |
Test connectivity to a device |
get_pool_status |
Get connection pool statistics |
get_device_types |
List all device types in inventory |
get_tags |
List all tags used across devices |
Examples
Execute a command:
Use send_command on device "core-rtr-01" with command "show version"
Execute on multiple devices:
Use send_command_parallel on devices ["@core_routers"] with command "show ip interface brief"
Push configuration:
Use send_config on device "core-rtr-01" with config_commands ["interface Loopback0", "description Test"] and save_config true
Supported Device Types
Any device type supported by Netmiko, including:
cisco_ios- Cisco IOScisco_xe- Cisco IOS-XEcisco_xr- Cisco IOS-XRcisco_nxos- Cisco NX-OSarista_eos- Arista EOSjuniper_junos- Juniper JunOSpaloalto_panos- Palo Alto PAN-OShp_procurve- HP ProCurvelinux- Linux SSH
See Netmiko supported platforms for the full list.
Development
Install Development Dependencies
pip install -e ".[dev]"
Run Tests
pytest
Run Linting
ruff check src/ tests/
mypy src/
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。