dsh-ikuai-mcp: Read-Only Query of iKuai Soft Router via MCP in DSH

Introduction

When performing LAN operations and maintenance in DeepSeek Harness (DSH), models often need to check router status, online terminals, DHCP, and port mappings, rather than just receiving instructions to “log in to the Web admin panel”. iKuai provides a JSON API, but to encapsulate the interface into model-callable tools, manage credentials, and restrict write operations by default, a layer of host integration is required. The following introduces the community plugin dsh-ikuai-mcp (maintainer MingShi350), which mounts the iKuai API as an MCP stdio service and stores connection parameters in the DSH Credential Center.

What is this

dsh-ikuai-mcp is a “networking tools” class plugin for DSH: a pure Node, zero-dependency MCP stdio server, plus a few tools on the DSH host side. The model side sees 11 read-only mcp__ikuai__* tools and a general-purpose read/write entry ikuai_api_call (write operations are disabled by default); the host side also has ikuai_credentials_status, ikuai_set_credentials, and ikuai_ping for configuration and connectivity checks. Connection parameters are not hardcoded in the conversation but are routed through the DSH Credential Center (or environment variables), so changing the IP or password generally does not require restarting DSH.

Compared to “only clicking the iKuai admin panel in a browser”, its value lies in: within the same DSH session, you can directly query CPU, interfaces, online devices, DNS, routes, VLANs, DDNS, port mappings, etc., and only make changes via general API calls after explicitly enabling write permissions and confirming each time.

Core Features

Read-only Tools (11 MCP Tools)

The plugin encapsulates common queries from the iKuai JSON API into fixed tools. The correspondence in the README is as follows (Tool Name → iKuai func_name):

Tool Description
ikuai_status System status: CPU, memory, temperature, number of online terminals, connection count, uptime, WAN lines, etc.
ikuai_interfaces LAN/WAN physical ports, up/down status, internal/external IP/gateway, VLAN failure items
ikuai_online_devices Online terminals: IP/MAC/name/traffic/connection count, supports pagination and sorting
ikuai_dhcp_pools Address pools for each LAN/VLAN, lease time, gateway, DNS
ikuai_dhcp_bindings Static bindings and dynamic leases (static_status: 1 indicates static)
ikuai_dns_config Local DNS switch, upstream DNS, proxy rules, cache
ikuai_static_routes User static route rules and effective routing table
ikuai_vlan_config VLAN ID, name, member ports, tag
ikuai_ddns_config DDNS configuration and recent resolved IPs (sensitive fields are masked)
ikuai_port_mapping Port mappings, 1:1 mappings, UPnP leases
ikuai_api_call General call for any func_name, used for ACL, QoS, flow control, and other modules not individually encapsulated

Write Permissions and Security Defaults

  • Non-show/get/list/query/search type calls are denied by default; to enable writes, you must set IKUAI_ALLOW_WRITES=1 (in the Credential Center or environment variables), and every write call must pass confirm: true.
  • The plugin does not provide a tool to “let the model enable write permissions itself”.
  • iKuai commonly uses self-signed certificates, so the client will relax certificate verification; the documentation requires using it only in trusted internal networks and not pointing it at public network devices.
  • Passwords are stored in plaintext in ~/.dsh/.credentials.yaml (permissions 0600), and the results attempt to mask common sensitive field names.

Version and Runtime Environment

  • npm package version 0.1.1 (see repository package.json).
  • Requires Node >= 18; peer dependency @deepseek-ai/cordis ^4.0.2.
  • License: MIT. For API usage, refer to beck-8/ikuai-mcp; this repository is an independent Node implementation.

Installation and Activation

The official README suggests handing the repository or installation instructions to the AI in DSH to execute step-by-step; below are the commands consistent with the documentation (using web as the profile example, please replace it with the profile you actually use).

  1. Install into profile (choose one of three, replace placeholders with actual values):
dsh plugin --profile web add /absolute/path/dsh-ikuai-mcp       # Local directory (must be an absolute path)
dsh plugin --profile web add github:MingShi350/dsh-ikuai-mcp  # GitHub
dsh plugin --profile web add dsh-ikuai-mcp                 # npm
  1. Confirm bundle is written (the output should contain a bundle name including ikuai):
node -e 'const p=require(process.env.HOME+"/.dsh/profiles/web/package.json");console.log(p.dsh.profile.bundles.filter(b=>b.includes("ikuai")))'
  1. Restart dsh web. The documentation states that the user should restart it themselves to avoid the agent directly killing the host process and interrupting the current session; if dshmarket is installed, you can use the one-click restart next to “Pending Restart” in the interface.

  2. Configure connection parameters (see next section). Do not guess IP and password; confirm with the device administrator.

  3. Verify: First call ikuai_credentials_status, then call ikuai_ping.

How to Self-Check After Installation

Symptom Meaning
11 mcp__ikuai__* appear in the tool list MCP side is ready, proceed to configure credentials
Only ikuai_credentials_status / ikuai_set_credentials / ikuai_ping Host side is half up, MCP subprocess is not up: check the capability panel mcp-server:ikuai, whether the bundle includes the plugin, and whether it has been restarted
None of the above Go back to installation step 1

Configuring Connection Parameters

Value priority: Environment Variables > DSH Credential Center > Default Values.

Key Default Value Description
IKUAI_URL https://192.168.1.1 iKuai Web management address; entering only 192.168.1.1 will automatically prepend https://
IKUAI_USERNAME admin Web login username
IKUAI_PASSWORD Empty Must be configured, otherwise tools report “IKUAI_PASSWORD not configured”

Recommended: Add the above three items in DSH “Settings → Credential Center” so the password does not enter conversation records. You can also let the agent call ikuai_set_credentials (it will try to connect first and only write on success; the password will appear in the session record, so the GUI is safer).

Changes in the Credential Center take effect within about 5 seconds, generally no restart needed; if a same-named environment variable is set, the environment variable takes precedence and overrides the Credential Center.

Verification examples (in DSH tool calls):

ikuai_credentials_status   →  View the effective values and sources of the four items (env / Credential Center / Default Value)
ikuai_ping                 →  Login probe
mcp__ikuai__ikuai_status   →  Read CPU / memory / number of online terminals, etc.

Common results of ikuai_ping: login successful; code=1005 indicates wrong account or password; ECONNREFUSED indicates wrong address or port; a non-JSON response usually indicates that the port is not the iKuai management page.

Typical Usage

Daily Read-Only Inspection

After credentials are configured and ikuai_ping succeeds, the model can directly call, for example:

  • mcp__ikuai__ikuai_status: Overview of device load and WAN.
  • mcp__ikuai__ikuai_online_devices: Check if a certain IP/MAC is online, traffic and connection count (default can be large, adjust limit down as needed).
  • mcp__ikuai__ikuai_dhcp_bindings / mcp__ikuai__ikuai_port_mapping: Verify if static bindings and mappings are consistent with documentation.

When Configuration Changes are Needed

  1. Set IKUAI_ALLOW_WRITES = 1 in the Credential Center (or environment variable, the latter requires restarting DSH).
  2. Before writing, use read-only or show to get the original record (including id/uuid).
  3. Call the corresponding func_name via ikuai_api_call and pass "confirm": true. iKuai V4 module names differ from V3, and the plugin will perform candidate fallback for some old names; sorting parameters require uppercase ORDER_BY and ORDER.

Write operations can affect DHCP, routes, port mappings, etc.; be sure to use them in a controlled environment with clear intentions.

Suitable Scenarios and Precautions

Suitable for: Users who are already developing or doing operations and maintenance in DSH, have an iKuai software router on the internal network (the documentation states full testing was done on iKuai V4 4.0.311 x64, V3 relies on module name fallback), and want to use conversation to check status or perform a small number of API write operations through a gate.

Must be aware:

  • The plugin runs with the current dsh process permissions; before installation, review the GitHub source code and MIT license yourself.
  • The session re-logs in approximately every 10 minutes; iKuai concurrent logins will kick each other out, avoid performing write operations simultaneously with the Web UI.
  • Modules such as Docker, QEMU, and behavior auditing are not individually encapsulated; use ikuai_api_call for pass-through when needed.
  • The DSH community directory SkillHub Plugin Page is an independent ecosystem site, with no official affiliation with DeepSeek / High-Flyer; star counts and other metadata are subject to the directory and repository.

Conclusion

dsh-ikuai-mcp wraps the iKuai JSON API into a set of MCP read-only tools within DSH, stores credentials in the DSH Credential Center, and disables write operations by default requiring explicit confirmation. If you are doing internal network router operations and maintenance in the Harness, you can install it into a profile according to the README, configure IKUAI_*, and then verify with ikuai_ping and ikuai_status.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye