
Keenetic Mcp
io.github.salatmaster由 GitHub 账号 salatmaster 发布v0.3.2更新于 Nov 1, 2026
Control a Keenetic router: devices, Wi-Fi, VPN routing, segments, safe verified writes.
概览
让助手通过局域网查看和修改 Keenetic 路由器:设备、Wi-Fi、接口、VPN 路由与网段,写入操作会回读校验。
- 可以做什么
- 列出并查看设备,可按在线、有线、无线或已封禁筛选,并按流量或信号排序
- 查看接口、Wi-Fi 射频、外网连通性、路由表、连接策略、网段与系统信息
- 修改设备:重命名、封禁或放行、指定路由策略、时间表或优先级
- 启用或关闭接口,创建或删除网段,并保存待生效的配置
- 通过通用 API 调用兜底处理其他路径,并把配置备份到本地文件
- 适用场景
- 适合用自然语言了解家庭或办公网络状况,例如哪台设备占用带宽最多、Wi-Fi 为何偏弱、外网是否可达,也适合做封禁设备、创建访客网络等小幅路由器调整。
- 运行要求
- 以 stdio 本地进程方式通过 npx 在桌面电脑上运行。需要能通过局域网访问路由器的 HTTP API,并提供路由器地址(KEENETIC_HOST,可由 init 向导自动发现)、登录名(KEENETIC_USER,默认 admin)和路由器密码(KEENETIC_PASSWORD,或由向导存入系统钥匙串)。
安装
在 SourceWeft 中
- 打开 控制台中的 Keenetic Mcp,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
keenetic-mcp
Control your Keenetic router from Claude, Codex, Cursor, or any MCP agent.
[npm] [license] [MCP] [KeeneticOS]
Ask your agent about your network in plain language. No USB stick, no Entware, nothing installed on the router.
Why
- Nothing on the router. It talks to the router's own HTTP API over your LAN. No USB drive, no Entware, no firmware modification.
- Works on any Keenetic. The tool set adapts to what your specific model and firmware actually support.
- Safe by construction. Changes are never saved unless you ask, a backup is taken before the first one, and every change is read back and verified before it is reported as done.
- Read-only if you want it. One flag and the agent physically cannot change anything.
Install
Claude Code
Then run the setup wizard in your terminal:
Codex
This brings the skills along with the server. For the server on its own:
Anything else
The wizard finds your router from the default gateway, confirms it really is a Keenetic, checks the password against it, and stores the password in your operating system keychain. Only the address and login go in a settings file.
Prefer environment variables? KEENETIC_HOST, KEENETIC_USER and
KEENETIC_PASSWORD override everything, which is what you want in a container.
What it can do
Read
Change
Escape hatch
Skills included
The plugin ships four skills, so the agent knows how your router behaves rather than guessing. One plugin directory serves both Claude Code and Codex: they read different manifests but share the same skills and the same server definition.
- keenetic-rci teaches the router's API tree: which paths exist, which ones return 100 KB, and how to recover the exact syntax of a command from the router's own configuration.
- keenetic-safe-changes teaches the change workflow: what the router's fail-safe does and does not protect against, and which interfaces will cut off your own access.
- keenetic-segments covers building an isolated network the router will admit exists. The obvious way produces a guest network that carries traffic perfectly and never appears in the web interface, because a segment is VLAN-backed and the VLAN is the part everyone leaves out.
- keenetic-troubleshoot is an ordered diagnostic playbook for "the internet is down", "Wi-Fi is bad" and "one device cannot connect".
Safety
- Nothing is saved unless you ask. Changes apply to the running
configuration and are discarded on reboot until
save_configis called. The server never calls it on its own. - A backup is taken automatically before the first change of a session.
- Every change is verified. The router accepts some wrong commands silently and changes nothing, so each write is read back and compared before it is reported as successful.
- Read-only mode really is read-only. With
--read-only, the write tools are not registered at all rather than registered and refusing, so the agent never sees them. - Your password goes in the system keychain, not in a config file, and never in a log or a tool response.
- LAN only. No cloud, no telemetry, no outbound connection to anything but your router.
Where the password is stored on each platform, and how to report something privately, are in SECURITY.md.
Supported routers
RCI, the API this uses, is a standard part of KeeneticOS rather than a feature of expensive models, so this works across the range. Verified against a Keenetic Ultra (KN-1811) on KeeneticOS 5.1.3.
Models on the current 5.1 branch: Giga (KN-1010), Hero (KN-1011, KN-1012), Start and Starter (KN-1111, KN-1112, KN-1121), Air and Explorer (KN-1613, KN-1621), Extra and Carrier (KN-1713, KN-1714, KN-1721), Ultra and Titan (KN-1810, KN-1811, KN-1812). Older hardware on 4.x and earlier has RCI too; the tool set adapts to the components each router actually has.
Netcraze routers run the same firmware under their own brand and answer the same RCI. Verified read-only against a Netcraze Speedster (NC-3013) on 5.2 Beta 1: the setup wizard, system info, internet status and the device list.
How it works
Keenetic routers expose RCI, a JSON mirror of their command-line tree, over HTTP. This server authenticates with the router's challenge-response scheme, keeps one session alive across the agent's questions, and shapes the answers so they fit in a model's context: the raw interface listing alone is 32 KB, and the NAT table is over 100 KB.
There is no coherent public documentation for RCI, so docs/rci-api.md is the notes taken while building this: the authentication handshake, the paths that exist, the traps, and how to recover a command's syntax from the router itself.
Development
A checkout reports its version as 0.0.0-dev, because there is no version
written down anywhere in the sources. Put KEENETIC_MCP_VERSION in a .env at
the repository root to say otherwise; the same file can hold KEENETIC_HOST
and KEENETIC_PASSWORD so you do not have to export them. A real environment
variable always wins over that file, and an installed copy never reads one.
Tests run against sanitized fixtures captured from a real router. To refresh them, and to run a read-only smoke test against your own:
Fixtures are anonymized deterministically and a test scans the whole repository for anything that looks like a real MAC address, private IP or key.
The setup wizard reads a password from the terminal, which no unit test can reach: piped input takes a different code path entirely. That part is checked with a script that drives a real pty, so it needs a terminal and cannot run in CI:
Releasing
A release is a tag and nothing else. There is no version commit to write,
because there is no version in the repository to change: package.json carries
0.0.0-dev, the plugin manifests carry none at all, and the release workflow
stamps the tag into package.json immediately before publishing without
committing it.
The workflow refuses a tag that does not name a version, and a test refuses a
tree that has a version written into it, so the two can never disagree. The
plugins pin keenetic-mcp@^0, which tracks the major only and is meant to be
edited once, at 1.0.
License
MIT
来源:README.md,提交 d8b4585
工具
0版本历史
2- v0.3.2最新Nov 1, 2026
- v0.3.1Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分