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.

概覽

AI 產生的概覽

讓助理透過區域網路檢視與修改 Keenetic 路由器:裝置、Wi-Fi、介面、VPN 路由與網段,寫入操作會回讀驗證。

可以做什麼
  • 列出並檢視裝置,可依使用中、有線、無線或已封鎖篩選,並依流量或訊號排序
  • 檢視介面、Wi-Fi 無線電、外網連線狀態、路由表、連線原則、網段與系統資訊
  • 修改裝置:重新命名、封鎖或允許、指定路由原則、排程或優先順序
  • 啟用或關閉介面,建立或刪除網段,並儲存待生效的設定
  • 透過通用 API 呼叫處理其他路徑,並將設定備份到本機檔案
適用情境
適合用自然語言了解家用或辦公網路狀況,例如哪台裝置占用最多頻寬、Wi-Fi 為何偏弱、外網是否可連,也適合封鎖裝置、建立訪客網路等小幅路由器調整。
執行需求
以 stdio 本機程序方式透過 npx 在桌上型電腦執行。需要能經由區域網路存取路由器的 HTTP API,並提供路由器位址(KEENETIC_HOST,可由 init 精靈自動探索)、登入名稱(KEENETIC_USER,預設 admin)與路由器密碼(KEENETIC_PASSWORD,或由精靈存入作業系統鑰匙圈)。
安裝前請注意
此伺服器可修改路由器設定:封鎖或重新命名裝置、開關介面、建立與刪除網段。變更只套用於執行中的設定,未呼叫 save_config 前重新開機即失效;第一次變更前會自動備份。路由器密碼屬於憑證,建議使用鑰匙圈,並注意環境變數會覆寫其他設定。rci_call 可存取任意路由器 API 路徑。唯讀模式會完全移除寫入工具。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Keenetic Mcp,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

[keenetic-mcp, the Keenetic MCP server: secure automation and control for Keenetic routers via the Model Context Protocol. Your AI client talks to the MCP server, which talks to the router. Works natively with Claude and Codex, and with Cursor over MCP. Secure and private, all operations run locally in your network. No installation, nothing installed on your Keenetic. Manage settings, users, Wi-Fi and firewall. You decide what to automate and when.]

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.

> who is using the most bandwidth right now?
  Three devices are active. Sorted by traffic:
  work-laptop      wifi:HomeNet   -46 dBm    7.7 GB down  living-room-tv   wired:Home                3.2 GB down  hallway-camera   wifi:HomeNet   -48 dBm    5.4 MB down
  The laptop is on the 2.4 GHz radio at -46 dBm, which is a strong  signal, so the throughput is not a coverage problem.
> block the camera until tomorrow morning
  Blocked hallway-camera (02:00:00:00:00:14).
  Applied to the running configuration and verified, but NOT saved.  A reboot discards it. Backup taken before the change:  ~/Library/Application Support/keenetic-mcp/backups/…txt
  Say the word and I will make it permanent, or leave it and it  reverts on the next restart.

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

/plugin marketplace add salatmaster/keenetic-mcp/plugin install keenetic@keenetic

Then run the setup wizard in your terminal:

npx -y keenetic-mcp init

Codex

codex plugin marketplace add salatmaster/keenetic-mcpcodex plugin add keenetic@keeneticnpx -y keenetic-mcp init

This brings the skills along with the server. For the server on its own:

codex mcp add keenetic -- npx -y keenetic-mcp

Anything else

json
{  "mcpServers": {    "keenetic": { "command": "npx", "args": ["-y", "keenetic-mcp"] }  }}

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

Tool
list_devicesevery device, filtered by active, wired, wireless or blocked, sorted by traffic or signal
get_deviceone device in full: lease, Wi-Fi rate, policy, schedule, traffic
list_interfacesWAN links, bridges, access points, VPN tunnels
get_interfaceone interface in full, including WireGuard peers
get_wifi_statusradios by band, with client counts
get_internet_statusreachability, and which check failed
list_routesrouting table, or just the default route
list_policiesconnection policies for selective routing
get_system_infomodel, firmware, CPU, memory, installed components
get_config_stateunsaved changes, who changed what and when
list_segmentsevery bridge, and whether the web interface lists it as a segment
backup_configdownload the configuration to a local file

Change

Tool
update_devicerename, block or allow, assign a routing policy, schedule or priority
set_interface_statebring an interface up or down
create_segmenta guest or IoT network the web interface actually lists, with Wi-Fi, DHCP and optional VPN routing
delete_segmentremove a segment and everything created with it
save_configmake pending changes survive a reboot

Escape hatch

Tool
rci_callany router API path at all, for whatever the tools above do not cover

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_config is 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

npm installnpm test          # no router requirednpm run typechecknpm run build

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:

KEENETIC_HOST=… KEENETIC_PASSWORD=… npm run capture:fixturesKEENETIC_TEST_HOST=… KEENETIC_TEST_PASSWORD=… npm run smoke

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:

KEENETIC_TEST_PASSWORD=… ./scripts/verify-wizard.exp

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.

git tag v0.2.2 && git push origin v0.2.2

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
SourceWeft 曾在隔離沙箱中以無憑證方式啟動該軟體包一次,以列出其工具,但未能完成:伺服器未能啟動。

版本歷史

2
  1. v0.3.2最新Nov 1, 2026
  2. v0.3.1Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分