mcp netmiko服务器
使LLM能够与您的网络设备交互的MCP服务器
通过SSH(网络麦克风)。
| 工具 | 说明 |
|---|---|
| get_network_device_list | 返回TOML文件中定义的网络设备名称和类型的列表。 |
| send_command_and_get_output | 向设备发送命令并返回其输出。 |
| set_config commands_and_commit_or_save | 向设备发送配置命令并自动提交或保存。 |
如何使用
- 安装```console
git clone https://github.com/upa/mcp-netmiko-server
cd mcp-netmiko-server
Write your toml file that lists your devices
vim my-devices.network.toml
Run via stdio
uv run --with "mcp[cli]" --with netmiko main.py my-devices.network.toml
Run as an SSE server: URL is http://localhost:10000/sse in this case
uv run --with "mcp[cli]" --with netmiko main.py my-devices.network.toml --sse
- 配置
在toml文件中列出您的网络设备,如 网络样本:```toml
[default]
username = "rouser"
password = "rouserpassword"
[qfx1]
hostname = "172.16.0.40"
device_type = "juniper_junos"
[nexus1]
hostname = "nexus1.lab"
device_type = "cisco_nxos"
[default] 是一个定义默认值的特殊部分,例如
像 username 和 password。如果满足以下条件,则设备将继承默认值
未在其章节中定义。
对于 device_type 值,请参见 netmiko支持
平台.
- claude桌面配置json:
json { "mcpServers": { "netmiko server": { "command": "uv", "args": [ "run", "--with", "mcp[cli]", "--with", "netmiko", "[PATH TO]/mcp-netmiko-server/main.py", "[PATH TO]/YOUR-DEVICE.toml" ] } } }
