Introduction¶
The plugin-based architecture of DeepSeek Harness (DSH) enables agents to access local services. When a proxy is needed, developers must wrap operations such as subscription configuration, node listing, and rule switching into tool commands. If the kernel doesn’t expose an API, these capabilities can only be left out.
dsh-clash exposes 8 operational capabilities of the local Clash (mihomo) kernel as DSH tools through mihomo’s REST API. The plugin does not own the kernel process, nor does it touch system proxy toggles. It communicates solely via HTTP with mihomo, reading real-time state and executing switches.
What It Is¶
dsh-clash is a DSH plugin maintained by forkgo430, categorized as a network tool. Through the mihomo REST API, it allows DSH to list nodes and policy groups, switch nodes, test latency, toggle between rule/global/direct modes, and inspect rules and live connections. The plugin does not start or stop the kernel, nor does it modify the system proxy.
Core Capabilities¶
The plugin provides 8 tools, each corresponding to a specific operation:
clash_status: View version, mode, ports, TUN status, global exit node, and counts of groups and nodesclash_groups: List all policy groups and their currently selected nodes, with filtering supportclash_nodes: List members of a given group, including the last measured latencyclash_select: Switch a group to a specified nodeclash_delay: Test latency of a single node or an entire group, sorted by speedclash_mode: Read or set the rule / global / direct modeclash_rules: Search routing rules, or temporarily disable/enable a specific ruleclash_connections: View live connections and traffic, close individual or all connections
These operations are direct calls to the mihomo kernel, not guesses or simulations.
Installation & Setup¶
Clash Verge does not enable the external controller API by default. dsh-clash requires the API to be available on TCP port 9097.
- Open the configuration file:
%APPDATA%\io.github.clash-verge-rev.clash-verge-rev\verge.yaml
- Enable the external controller:
enable_external_controller: true
-
Completely quit Clash Verge (including the tray icon) and restart it.
-
Verify the port is accessible:
Test-NetConnection -ComputerName 127.0.0.1 -Port 9097
If TcpTestSucceeded : True, the configuration is successful.
- Install the plugin:
dsh plugin --profile desktop add github:forkgo430/dsh-clash
- Restart DSH; the tool list is built at the start of each session.
The plugin defaults to using the secret set-your-secret. If you have already changed the secret in Clash Verge, you must keep it consistent in the plugin configuration.
Typical Usage¶
Problem: A site fails to load
clash_status # Confirm the kernel is running and check the current mode
clash_delay <group> # If all nodes time out, the subscription may have expired
clash_connections # Check the matched rule and node used for that domain
Need: Switch to a new node immediately
Node switching only takes effect for new connections; already-established connections continue on the old node:
clash_select <group> <node>
clash_connections closeAll=true
Need: Bypass proxy for a specific domain temporarily
clash_rules filter=example.com # Find the rule index for that domain
clash_rules disableIndex=12 disable=true
Use Cases & Cautions¶
This plugin is suited for developers who need agents to directly control proxy behavior, such as automatically switching nodes, running batch latency tests, or dynamically adjusting routing based on rules.
Notes:
- The plugin runs with the privileges of the current DSH process. Review the source code and license (MIT) before installing.
- The plugin does not start or stop the Clash Verge kernel, nor does it toggle the system proxy or TUN mode.
- Operations such as node switching and rule disabling revert to configured defaults after a kernel restart. Persistent changes must be made through Clash Verge’s configuration or subscription.
Ecosystem Context¶
DSH’s philosophy is “everything is a plugin.” The community directory provides a plugin index. There is no official affiliation with DeepSeek or High-Flyer (幻方). This article solely introduces the plugin itself and does not constitute an official recommendation.
References¶
- Plugin directory: https://www.skillhub.cn/plugins/forkgo430/dsh-clash
- GitHub repository: https://github.com/forkgo430/dsh-clash