netmiko-mcp
Provides SSH/telnet command execution on Linux servers via sudo, enabling remote administration and configuration tasks.
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., "@netmiko-mcpRun 'display version' on core-switch"
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.
netmiko-mcp
一个极简的 MCP 服务器,为编码智能体(Claude / DSH / Codex)提供对华三 Comware 网络设备与Linux 服务器的 SSH/telnet 命令执行能力。
两个工具:
list_devices(枚举设备)与run_command(执行命令)。完全读写委托,无确认门禁、无命令白名单。
每次调用独立连接,无跨调用会话状态。
唯一的护栏是本地审计日志(事后复盘,非事前拦截)。
依赖管理
本项目使用 uv 管理依赖,.python-version 固定 Python 3.12。
uv sync # 安装依赖到 .venv
uv run pytest # 运行测试
uv run python main.py # 以 stdio 启动 MCP 服务器Related MCP server: H3C CLI MCP Server
清单文件
默认读取当前目录下的 hosts.yaml(可用环境变量 NETMKO_MCP_INVENTORY 覆盖)。参见 hosts.example.yaml 的完整示例:
- id: core-switch # 唯一标识,run_command 用它对目标寻址
platform: network # network | linux
host: 192.168.1.1
protocol: ssh # ssh | telnet
port: 22 # 可选
device_type: hp_comware # netmiko 类型;telnet 会自动补 _telnet 后缀
username: admin
password: "CHANGE_ME"
secret: "CHANGE_ME" # 特权(super)密码,可选
- id: jump-host
platform: linux
host: 192.168.1.10
username: ops
password: "CHANGE_ME"
sudo_password: "CHANGE_ME" # linux 必填,经 sudo -S 使用工具
list_devices
返回清单中所有设备的公开元数据(id、platform、host、port、protocol、device_type、username),不返回 password、secret、sudo_password。
run_command(target, mode, command)
target:清单中的id。mode:read(只读命令)或config(配置下发)。command:命令字符串;config模式按换行拆分为多条配置命令。
行为:
网络设备:
read走send_command,config走send_config_set(自动进/出系统视图);连接后自动关闭分页,连接时自动进入特权视图(secret)。Linux:命令以
sudo -S执行,使用清单中的sudo_password。每次调用独立连接,执行后断开。
输出完整返回,不截断。
配置下发不自动保存:持久化需由智能体显式执行
save(华三)等命令。
环境变量
变量 | 默认值 | 说明 |
|
| 清单文件路径 |
|
| 审计日志路径 |
审计日志
每次 run_command 都会向审计日志追加一行 JSON,字段含时间戳、目标、模式、命令、成功与否与输出:
{"timestamp":"...","target":"core-switch","mode":"read","command":"display version","success":true,"output":"..."}客户端接入示例
以 stdio 方式接入 MCP 客户端时,启动命令为:
{ "command": "uv", "args": ["run", "python", "main.py"], "cwd": "/path/to/netmiko-mcp" }安全警告(必读)
本工具默认完全委托、不做拦截,叠加以下设计后风险很高,请务必知悉:
凭证明文内联:
hosts.yaml直接存放所有设备的密码、特权密码与 sudo 密码,且已加入.gitignore。一旦该文件泄露,攻击者即获得所有设备的完全控制权。切勿提交到版本库,并严格控制文件权限。支持 telnet:telnet 为明文传输,登录凭证会在链路上明文暴露。仅应在隔离网络中使用。
完全读写、无确认:智能体可直接下发真实配置,无二次确认、无命令白名单、无干跑。
无提示注入防护:若智能体被不可信内容(网页、邮件、设备回显)诱导,命令会以完全权限执行。
不自动保存:配置下发后不会自动持久化,重启可能丢失,需智能体显式保存。
审计日志只能事后复盘,不能事前拦截。
请在完全理解并接受上述风险后再部署到生产环境。
Available Tools
2 toolslist_devicesA
枚举清单中的目标设备(不含密码/secret/sudo 密码)。
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Even though annotations are absent, the description explicitly discloses that passwords, secrets, and sudo passwords are excluded from results. This is a valuable behavioral caveat for a list operation and goes beyond what the name alone suggests.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single compact sentence with the key privacy caveat parenthesized. There is no filler, redundancy, or unnecessary detail.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a zero-parameter, no-output-schema tool, the description adequately captures what the tool does and an important constraint on its results. It could additionally state that it is read-only or describe the result format, but these are non-critical for selecting and invoking the tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has zero parameters, so parameter documentation is not applicable. The baseline of 4 is appropriate because there is nothing for the description to clarify.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states a specific verb ('enumerate') and resource ('target devices in the inventory'). It is semantically distinct from the sibling run_command, but it does not explicitly name or differentiate from that sibling.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No explicit when-to-use or when-not-to-use guidance is provided. The sibling run_command is not mentioned, so the agent must infer the appropriate choice from tool names and intent rather than from explicit guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
run_commandA
对目标设备执行命令。mode 为 read(只读)或 config(配置下发)。
| Name | Required | Description | Default |
|---|---|---|---|
| mode | Yes | ||
| target | Yes | ||
| command | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden of behavioral disclosure. It does add meaningful context by explaining that mode can be read-only or config-push, which hints at safety differences. However, it does not disclose output format, side effects of config mode, permissions needed, or error behavior, leaving significant behavioral ambiguity.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two short sentences with no filler. The primary action is front-loaded and the mode clarification is useful and directly relevant. Every word earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a tool with three required parameters, no schema descriptions, no annotations, and no output schema, this description is too sparse. It fails to explain what target refers to, what format command should take, or what the tool returns. It is minimally viable but leaves important gaps for an agent to call it correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema provides no descriptions for any of the three required parameters, and the description only explains the meaning of mode (read/config). The target and command parameters are left entirely to inference. At 0% schema coverage, the description should compensate more heavily but does not.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool executes a command on a target device, which is a specific verb and resource. It also distinguishes itself from the sibling tool list_devices by focusing on command execution rather than device enumeration. The mode distinction adds further clarity to the purpose.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies when to use the tool—whenever a command needs to be executed on a device—and notes the read/config mode split. However, it provides no explicit guidance on when not to use it or when to prefer the sibling list_devices instead. The usage context is implied rather than explicit.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
2 tool updates
v0.0.1- First observed
list_devices - First observed
run_command
TDQS
list_devices handles inventory enumeration while run_command handles device execution. There is no overlap or ambiguity between the two operations.
Both tools follow the same verb_noun snake_case pattern: list_devices and run_command. The naming is consistent and predictable.
With only two tools, the server feels thin even though each tool serves a clear purpose. It is borderline for a focused SSH/network automation server.
The two tools cover the core workflow of enumerating devices and running commands in read or config mode. More advanced operations like inventory management or structured config retrieval are missing, but they are workable via run_command.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Run and manage H Company's Computer-Use Agents from any MCP client.
Run commands and read/write files on your servers over Termalin's keyless tunnels (hosted MCP).
MCP server for network documentation, generated by doc2mcp.
Unified gateway exposing 150+ tools across all NexGenData MCP servers via one endpoint.
Related MCP Servers
- AlicenseAqualityBmaintenanceA comprehensive MCP server for network device management via SSH/Telnet. Supports multiple vendors such as Cisco IOS and BDCOM, enabling AI assistants to execute commands and manage routers, switches, and firewalls.4MIT
- FlicenseNot gradedqualityDmaintenanceTelnet-based MCP server for H3C network device CLI, enabling connection, command execution, and device mode detection via natural language.14-
- FlicenseNot gradedqualityCmaintenanceEnables executing Cisco CLI commands on network devices over SSH through two MCP tools for exec and config commands, with security and automation features.-
- FlicenseNot gradedqualityBmaintenanceEnables management of multiple MikroTik RouterOS devices over SSH via two tools: device listing and command execution.-
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/sundev126/netmiko-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server