keenetic-mcp
keenetic-mcp lets an AI agent inspect and change a Keenetic or Netcraze router over its local RCI API — reading state, editing devices, routing policies and network segments, with every change live-only until you explicitly save.
Inspect the router: system info (model, firmware, uptime, CPU/memory, installed components), config state (unsaved changes, fail-safe timer), and Wi-Fi radios by band with client counts.
See the network: list devices (filter by active/wired/wireless/blocked, sort by traffic, name, signal or last seen), interfaces (WAN, LAN, Wi-Fi, VPN, bridges), routing policies, routes, and segments with whether the web UI actually lists them.
Diagnose problems: check internet status (gateway, DNS, captive portal), run
pingandtraceroutefrom the router itself, optionally through a chosen source interface or address — good for "is it the router or the provider?"Manage devices: rename, block or permit internet access, assign a routing policy (e.g. send some devices through a VPN), attach a schedule, or set traffic priority by MAC.
Build separate networks: create an isolated guest/IoT segment in one call — VLAN trunked over switch ports, bridge, address, NAT, DHCP pool, optional Wi-Fi SSID and policy — verified and rolled back on failure; delete a segment and everything it created (home segment refused).
Control interfaces: bring an interface up or down, with a warning that this can cut off router access.
Reach anything else:
rci_callfor raw GET/POST against any RCI path (e.g. new WireGuard tunnels, domain-based routing), with a response size cap.Stay safe: take a config backup to an owner-only local folder, and
save_configto persist changes only when the user confirms — nothing else in the server saves.Read-only mode: with
--read-onlythe write tools aren't registered at all andrci_callrefuses anything but reads.
Allows AI agents to control and monitor Keenetic routers, including querying device status, traffic, interfaces, Wi-Fi, routes, policies, and making configuration changes with safety features.
Click on "Deploy 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., "@keenetic-mcp who is using the most bandwidth right now?"
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.
Sending two devices through a VPN on a Keenetic means a connection policy, the right interfaces permitted in it, and every device assigned to it by hand. A separate network for smart home devices means a VLAN on every switch port, a bridge, addressing, DHCP, NAT, Wi-Fi and isolation, and missing any one of them gives you a network that half works. keenetic-mcp gives your AI agent the router's own API and the knowledge of where it bites, so you describe the result and the agent builds it.
One sentence, not twelve pages
VPN for some devices and not others, a guest or smart home network the web interface actually lists, a device on a schedule. The agent finds the policies, devices and free addresses itself.
Nothing breaks for good
The built-in tools take a backup first and read every change back from the router before reporting it, and nothing is saved until you say so. If something is off, a reboot puts everything back.
Nothing on the router
It runs on your computer and talks to the router's own API over your LAN. No Entware, no USB drive, no firmware modification, no cloud. The password stays in your system keychain.
Install
Claude Code
/plugin marketplace add salatmaster/keenetic-mcp
/plugin install keenetic@keenetic
npx -y keenetic-mcp initCodex
codex plugin marketplace add salatmaster/keenetic-mcp
codex plugin add keenetic@keenetic
npx -y keenetic-mcp initCursor, Claude Desktop and any other MCP client
{
"mcpServers": {
"keenetic": { "command": "npx", "args": ["-y", "keenetic-mcp"] }
}
}then run npx -y keenetic-mcp init once.
The wizard finds the router from your default gateway, checks that it really is a Keenetic or Netcraze,
tries the password against it and puts the password in the operating system keychain. The plugins also
bring four skills that teach the agent how the router really behaves. In a container, set
KEENETIC_HOST, KEENETIC_USER and KEENETIC_PASSWORD instead.
Several routers. Home, your parents' and the office can all sit at 192.168.1.1 with the login
admin. Give each one a name with npx -y keenetic-mcp init --profile parents, and choose which one a
session talks to with KEENETIC_PROFILE. For one Claude Code project, that is a line in its
.claude/settings.local.json:
{ "env": { "KEENETIC_PROFILE": "parents" } }Without a profile the server uses the router init set up without one. Other clients can pass
--profile parents in the server's args, or set KEENETIC_PROFILE in its env.
Related MCP server: keenetic-mcp
What to ask
Routing
Put the TV and my work laptop on the WireGuard VPN, everything else stays direct.
Which devices go through the VPN right now?
Move the phone to the VPN as well.
Separate networks
Give the smart home stuff its own Wi-Fi that can't see my home network.
Make a guest network that goes out through the VPN.
Remove the IoT network and everything that came with it.
Devices
Who is using the most bandwidth right now?
Block the camera until I say otherwise.
Put the kids' tablet on the bedtime schedule.
When something is wrong
The internet is down. Why?
Is it the router or the provider? Trace the route to github.com from the router.
What changed on the router today, and is any of it unsaved?
Anything the built-in tools do not cover, such as a new WireGuard tunnel or routing by domain, goes
through rci_call, the router's full API. The keenetic-rci skill shows the agent how to find the exact
command in the router's own configuration instead of guessing it, and those changes are not saved until
you say so either.
Why changes are safe
Backup first. Before the first change of a session, the configuration is downloaded into the backups folder, readable by you only.
Checked on the router. A Keenetic answers a wrong command with HTTP 200 and changes nothing, so every change the built-in tools make is read back and compared before the agent hears it worked. Creating a segment takes about twenty commands; if one fails, all of them are rolled back.
Nothing permanent until you say so. Changes go to the running configuration only, so a reboot undoes them. The server never calls
save_configon its own.Read-only when you want it. With
--read-onlythe write tools are not registered at all, so the agent never sees them, andrci_callrefuses anything but reads.Your password stays yours. It lives in the system keychain, never in a config file, a log or a tool response.
Where the password is stored on each platform, and how to report something privately, are in SECURITY.md.
Tools
Change
Tool | |
| rename, block or allow, put on a routing policy, a schedule or a priority |
| a guest or IoT network the web interface lists, with its own Wi-Fi, DHCP, isolation and optional VPN routing |
| remove a segment and everything created with it |
| bring an interface up or down |
| make pending changes survive a reboot |
Read
Tool | |
| every device, by traffic, signal or name; one device in full |
| routing policies and the links each one allows |
| every network, and whether the web interface lists it |
| WAN links, bridges, access points, VPN tunnels with their peers |
| radios by band, with client counts |
| whether the router is online, and which check failed if not |
| run on the router itself, optionally through a given interface |
| the routing table, or just the default route |
| model, firmware, CPU, memory, installed components |
| unsaved changes, who changed what and when |
| download the configuration into the backups folder |
Everything else
Tool | |
| any path of the router's API |
Skills
The plugins for Claude Code and Codex share four skills:
keenetic-rci: the API tree, which paths return 100 KB, and how to recover a command's exact syntax from the router's own configuration.
keenetic-safe-changes: what the router's own fail-safe does and does not cover, and the order of changes that does not cut off your own access.
keenetic-segments: why the obvious way to build a guest network gives one the web interface never lists, and the VLAN it is missing.
keenetic-troubleshoot: an ordered playbook for "the internet is down", "Wi-Fi is bad" and "one device cannot connect".
Supported routers
Keenetic and Netcraze routers run the same firmware, and its API is part of every model rather than of expensive ones. The tool set adapts to what each router actually has. Tried so far:
Router | Firmware | What was checked |
Keenetic Ultra (KN-1811) | 5.1.3 | everything, the router it was built against |
Keenetic Hopper DSL (KN-3610) | 5.1.8 | backups |
Keenetic Sprinter (KN-3710) | 5.2 Beta 3 |
|
Keenetic Hopper (KN-3810) | 5.2 Beta 4 | the 5.2 login, everyday use |
Netcraze Speedster (NC-3013) | 5.2 Beta 1 | setup, system info, internet status, devices |
Other models on 5.1: 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-1812). If yours works, or does not, an issue saying so helps the next person.
On 5.2, use Node 24.7 or later. Newer 5.2 builds accept only the ndw4 login, which needs it. On older Node the server falls back to the previous login, which 5.1 accepts and 5.2 may not.
FAQ
keenetic-mcp itself connects to nothing but your router: no cloud, no telemetry. What the tools return does go to your agent's model, the same as anything else you show it. The answers are trimmed to what the question needs, and the password is never in them.
Every change is in the running configuration only, so a reboot brings back the saved one. The router
also has its own fail-safe that reverts a change when it loses the management session. The
keenetic-safe-changes skill tells the agent which changes can cut off your own access, such as the
interface you are connected through, and to ask before them.
Start the server with --read-only. The write tools are then not registered at all, and rci_call
refuses anything but reads.
They show one setting per page. Here the agent reads everything it needs at once, so "why is the internet slow" or "put these two on the VPN" is one question instead of a walk through five pages, and the agent knows the traps those pages hide, such as the guest network that never appears in the list.
How it works
Keenetic and Netcraze routers expose RCI, a JSON mirror of their command-line tree, over HTTP. keenetic-mcp logs in with the router's challenge-response scheme, keeps one session alive across the agent's questions, and shapes the answers to fit 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 collects what was learned building this: the login, the paths that exist, the traps, and how to recover a command's syntax from the router itself.
Contributing
npm install
npm test # no router requiredBug reports and pull requests are welcome, and reports from models nobody has tried yet most of all. CONTRIBUTING.md covers testing against a real router, fixtures, releases and the one rule that matters most here.
License
MIT. Not affiliated with Keenetic or Netcraze.
Available Tools
20 toolsbackup_configDownload a configuration backupARead-only
Saves the router startup configuration into this tool's backups directory (KEENETIC_STATE_DIR/backups) with owner-only file permissions. Take one before any sequence of changes so there is a known-good state to return to. Reading the configuration changes nothing on the router.
Inputs: no named parameters.
create_segmentCreate a network segmentADestructive
Creates an isolated network that the web interface actually lists as a segment: a VLAN subinterface trunked over every switch port, a bridge, an address, NAT, a DHCP pool, and optionally a Wi-Fi network and a routing policy. Free identifiers are chosen automatically. The result is verified against the router-computed iseg block, and a failure anywhere rolls the whole thing back. Nothing is saved; call save_config once the user confirms.
Inputs: name (required), psk, ssid, subnet, +2 more.
delete_segmentDelete a network segmentADestructive
Removes a segment and everything created with it: the Wi-Fi networks bound to it, its policy, its DHCP pool, NAT, the bridge, and the VLAN on every switch port. Removing the bridge alone leaves the VLAN trunked over the whole switch. Devices on the segment lose their connection. Refuses the home segment.
Inputs: bridge (required).
get_config_stateConfiguration stateARead-only
Whether the running configuration has unsaved changes, who last changed it and when, and the state of the router fail-safe timer. Unsaved changes are lost on reboot. unsavedChanges is null when the saved checksum could not be read - treat that as unknown, not as saved.
Inputs: no named parameters.
get_deviceGet one device in fullARead-only
Every field the router holds for a single device: DHCP lease, Wi-Fi rate and mode, access policy, traffic shaping, first and last seen. Identify it by MAC, IP or name.
Inputs: ip, mac, name.
get_interfaceGet one interface in fullARead-only
Every field for a single interface, including protocol-specific detail such as WireGuard peers or PPPoE session state. Get the exact name from list_interfaces first.
Inputs: name (required).
get_internet_statusInternet connectivityARead-only
Whether the router currently reaches the internet, and which check failed if not: gateway reachability, DNS resolution, and captive-portal detection. Start here when the user reports the internet is down.
Inputs: no named parameters.
get_system_infoRouter system informationARead-only
Model, firmware version, uptime, CPU and memory load, and the list of installed KeeneticOS components. Call this first when you need to know what the router supports: the component list tells you which features exist on this device. Judge memory pressure by memoryAvailableKb, not memoryFreeKb: free excludes the page cache the kernel releases on demand, so it is always low on a healthy router.
Inputs: no named parameters.
get_wifi_statusWi-Fi statusARead-only
Wi-Fi radios grouped by band, each with its access points, SSIDs, link state and the number of connected clients. Use this rather than list_interfaces when the question is about Wi-Fi coverage or which network a device should be on.
Inputs: no named parameters.
list_devicesList devices on the networkARead-only
Every device the router knows about, with IP, name, how it is connected, signal strength and traffic counters. Use filter to narrow to active, wired, wireless or blocked devices, and sort to rank by traffic, name, signal or last seen.
Inputs: sort, limit, filter.
list_interfacesList network interfacesBRead-only
Every interface on the router - WAN links, bridges, Wi-Fi access points and VPN tunnels - with link state, address and whether it carries the default route. Summary detail is the default because the full listing is very large.
Inputs: kind, limit, detail.
list_policiesList routing policiesARead-only
Connection policies, which decide that a given device leaves through a given link - typically used to send some devices through a VPN tunnel and the rest direct. The names returned here are what a device is assigned to.
Inputs: no named parameters.
list_routesList IP routesARead-only
The routing table: destination, gateway, outgoing interface and metric. Use kind=default to see only the default route, which tells you which link traffic leaves through.
Inputs: kind, limit.
list_segmentsList network segmentsARead-only
Every bridge on the router, and whether the web interface lists it as a segment. A bridge that carries an address but has no VLAN behind it works for traffic and never appears under /access-points, so uiVisible is the field that matters.
Inputs: no named parameters.
pingPingBRead-only
Send ICMP echo requests to a hostname or IPv4 address through the router. Supports a configurable packet count and source interface, and returns the collected ping output.
Inputs: host (required), count, source_interface.
rci_callCall the router API directlyADestructive
Sends a raw request to the router RCI interface, for anything the other tools do not cover. GET reads a path such as "show/version" or "interface/Bridge0"; POST sends a command object mirroring the CLI tree. The response is capped, so ask for a narrow path rather than a broad one: show/ip/nat alone is over 100 KB.
Inputs: method (required), body, path, max_bytes.
save_configSave the configurationADestructiveIdempotent
Writes the running configuration to the startup configuration, so pending changes survive a reboot. Nothing else in this server saves, so call this only once the user has confirmed the changes are what they want.
Inputs: no named parameters.
set_interface_stateBring an interface up or downADestructiveIdempotent
Enables or disables a network interface. Taking down a bridge or the WAN link can cut off access to the router itself, including this connection. Confirm what the interface carries with get_interface before calling this.
Inputs: name (required), state (required).
tracerouteTracerouteARead-only
Trace the network path to a hostname or IPv4 address using ICMP probes. Supports selecting the source interface, source IPv4 address, and maximum number of hops (default: 30). Returns the collected hop-by-hop traceroute output.
Inputs: host (required), max_hops, source_address, source_interface.
update_deviceChange a deviceADestructiveIdempotent
Rename a device, allow or block its internet access, put it on a routing policy or a schedule, or set its traffic priority. Changes apply immediately but are NOT saved: a reboot discards them until save_config is called.
Inputs: mac (required), name, access, policy, +2 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 20 tools
Each tool has a distinct resource+action target (routes vs policies vs segments vs interfaces vs devices), and the descriptions explicitly resolve the few naturally overlapping cases — e.g. 'use get_wifi_status rather than list_interfaces', 'uiVisible is the field that matters' for list_segments, and rci_call is documented as the deliberate fallback for everything else. The list_/get_ pairings (list_devices/get_device, list_interfaces/get_interface) are unambiguous summary-vs-detail splits rather than duplicates.
The dominant convention is verb_noun snake_case (get_system_info, list_segments, create_segment, delete_segment, update_device, save_config, backup_config) and it is applied consistently. Minor deviations exist: set_interface_state uses 'set_' where update_device uses 'update_', and ping/traceroute/rci_call are bare verbs or single tokens, though these read naturally as conventional command names.
20 tools is on the heavy side of the 3-15 sweet spot, but for a router administration surface spanning system, routing, Wi-Fi, segments, devices, interfaces, diagnostics and config persistence, each tool maps to a real capability and none looks like filler. Slightly over-scoped rather than bloated.
Strong lifecycle coverage for segments (create/list/delete with rollback and verification) plus a coherent config-safety story (backup_config, save_config, get_config_state) and network diagnostics. Gaps remain: no direct Wi-Fi/SSID credential editing, no interface or tunnel creation, no policy creation, and no reboot/firmware tool — all reachable only via raw rci_call, which is a workable but less safe escape hatch.
Maintenance
Related MCP Connectors
Remote MCP access to user-authorized Linux, Windows and Intel Mac devices for AI assistants.
MCP gateway and cloud hosting for MCP servers, agents and apps like RAG, managed from your agent.
Secure and manage MCP servers through the Speakeasy AI Control Plane from your agent.
MCP server enabling AI agents to manage Bitrix24 features via standardized protocol
Related MCP Servers
- AlicenseAqualityBmaintenanceAn MCP server that lets an AI assistant manage your Keenetic router in plain language — list connected devices, pin static DHCP leases, rename devices, check WAN status, and reboot.10MIT
- AlicenseNot gradedqualityCmaintenanceMCP server that bridges AI assistants like Claude Code to Keenetic routers, enabling natural language control of Wi-Fi, devices, VPN, and network segmentation via the router's RCI interface.MIT
- AlicenseBqualityCmaintenanceEnables AI agents to manage Keenetic routers through the same RCI API used by the router's web interface, working directly over the local network without cloud involvement. It supports reading device statuses and executing configuration changes, with confirm, dry-run, and destructive-action safeguards.23PolyForm Noncommercial 1.0.0
- AlicenseAqualityBmaintenanceEnables AI clients to perform controlled diagnostics and configuration of Keenetic and Netcraze routers over LAN RCI or remote KeenDNS HTTPS, with read-only mode, guarded writes, and centralized secret masking.19MIT