dsh-zcode-cua: Integrating ZCode Computer Control into DeepSeek Harness on Windows

Introduction

When performing desktop automation in DeepSeek Harness (DSH), the built-in dsh-cua-bundle on Windows throws an unsupported-platform error, preventing the model from clicking, typing, or reading native application interfaces using the same set of tools. If you are already using ZCode’s Computer Use (CUA) capabilities, a more natural approach is to reuse its official runtime rather than maintaining a separate set of Windows native helper processes within DSH. Below is an introduction to the community plugin dsh-zcode-cua published by maintainer wkylnj. Categorized as a workflow, it hooks ZCode’s computer control into DSH as a single MCP js tool, and includes a session-level switch and on-screen prompts to prevent accidental triggering of global permissions.

What is this

dsh-zcode-cua (package name must remain scope-less dsh-zcode-cua, displayed as ZCode computer control in DSH) is a bridge layer: it parses the ZCode installation directory layout and converts between MCP 1.x and newer protocols. The actual clicking, accessibility tree reading, and screenshots are still executed by ZCode’s built-in node-repl-host and native cua-helper (ax_native.node), behaving consistently with ZCode. The current version in the repository package.json is 1.3.0 with the MIT license.

Core Features

Single MCP Tool

The plugin exposes one tool externally: mcp__zcode-cua__js. Each call executes top-level await in a brand new Node.js kernel, allowing the model to drive the desktop via code. A typical flow is to first getAXState() to read the accessibility tree, locate element indices by role and name, and then click / typeText; coordinates are only a fallback when accessibility is invisible (e.g., canvas or Electron). The complete API can be pulled at runtime using agent.documentation.get("computer-use").

agent.computerUse provides getState, getApp, listApps, requestAccess, stop, and fourteen underlying computer.* tools. The upstream js tool only accepts code, timeout_ms, and title parameters; this plugin passes them through unchanged without adding fields.

Session-level “Computer Control” Switch

New sessions are not allowed to operate the desktop by default. The tool is still visible in the list, but every call is rejected until the user opens it, prompting to open the “Computer Control” switch in the input box and try again. The switch is displayed in pill style on the right side of the line below the message box: 电脑控制 · 已关闭 / 电脑控制 · 已开启; it can only toggle the current session. Authorization is stored in memory; sessions revert to closed after restarting DSH; calls without an attached session are rejected; the guard only affects mcp__zcode-cua__js, not other MCP tools. If the host route is unreachable, it will show 电脑控制 · 状态未知, distinct from “Closed”.

On-screen Indication During Execution

When the js call is in progress, there is a click-through overlay: blue glow at the screen edges, a banner, and a soft pointer halo. The first line of the banner is fixed as “DSH is controlling the computer”, and the second line comes from the mandatory tool parameter title (the same sentence the model writes to the user). This layer is invisible to model screenshots (window flag WDA_EXCLUDEFROMCAPTURE), does not steal focus, and does not occupy the taskbar. It can be disabled using the environment variable DSH_ZCODE_CUA_NO_OVERLAY=1; if the indicator layer fails, the tool call proceeds as usual.

Architecture Overview

DSH ──MCP stdio──▶ 本插件 server/index.js
                     ├─ 注入 ZCODE_CUA_PERMISSION_BROKER_SOCKET 等
                     └──▶ node-repl-host(ZCode 官方 MCP,一个 js 工具)
                             └──▶ cua-helper(Windows 原生,UI Automation / 输入注入)

Installation and Activation

Prerequisites

  1. Windows
  2. ZCode installed and launched at least once (the plugin reuses native helpers from the ZCode installation directory and does not distribute binaries with the package)
  3. DeepSeek Harness (this repository is the DSH bundle)

Loading into DSH

Method 1 (Recommended): In DSH Plugins → Add plugin, select this plugin directory; DSH will associate it as a link, and changes to the source code take effect immediately.

Method 2: Run the verified command in the plugin checkout directory found in the README:

cd "D:\path\to\dsh-zcode-cua"
dsh plugin --profile desktop add "link:$PWD"

After completion, restart DSH. The tool is named mcp__zcode-cua__js, and the plugin list row displays ZCode computer control. The registered dependency node_modules/dsh-zcode-cua/server/index.js uses a relative path, and the package directory name must be dsh-zcode-cua.

Optional Skill

The tool can be used alone, but the model may not be familiar with the Computer Use conventions. The repository’s skills/zcode-computer-use/SKILL.md suggests copying it to a skill directory scanned by DSH (DSH will not load skills automatically from the plugin directory):

# User-level (all projects)
Copy-Item -Recurse .\skills\zcode-computer-use "$env:USERPROFILE\.dsh\skills\zcode-computer-use"

# Or project-level
Copy-Item -Recurse .\skills\zcode-computer-use "D:\your-project\.dsh\skills\zcode-computer-use"

Restart DSH after copying.

Configuration

You can find the zcode-cua line in the profile’s cordis.patch.yml, for example:

- id: zcode-cua
  name: '@deepseek-ai/dsh-mcp-client'
  config:
    serverName: zcode-cua
    transport: stdio
    command: 'node'
    args: ['node_modules/dsh-zcode-cua/server/index.js']
    toolCallTimeoutMs: 180000

The default command is node, requiring Node 18.17+ in PATH; it can also point to the absolute path of the Node built into the DSH desktop app. If ZCode is installed in a non-standard path, you can override the layout parsing via environment variables mentioned in the README (see the Configuration section of the repository for details).

Typical Usage

Initialize the runtime and operate on the target application within the code passed to the js tool (example from README, PID needs to be changed to the actual process):

const root =
  process.env.ZCODE_CUA_PLUGIN_ROOT ??
  process.env.ZCODE_PLUGIN_ROOT ??
  process.env.CLAUDE_PLUGIN_ROOT;
const { join } = await import("node:path");
const { pathToFileURL } = await import("node:url");
const { setupComputerUseRuntime } = await import(
  pathToFileURL(join(root, "scripts", "computer-use-client.mjs")).href
);
await setupComputerUseRuntime({ globals: globalThis });

const app = await agent.computerUse.getApp({ pid: 1234 });
await app.getAXState();
await app.click(12);
await app.typeText("hello");
await app.getScreenshot();

Before actual operation, open “Computer Control · Enabled” in the corresponding session and fill in a clear title for this call to facilitate the on-screen banner and post-call verification.

Use Cases and Notes

  • Suitable: Already using DSH on Windows and want the agent to operate native desktop applications (accessibility tree + screenshot + input), and ZCode is installed on the machine.
  • Not Suitable: Non-Windows environments; machines unwilling to install or run ZCode.
  • Security: The plugin drives the keyboard and mouse with the current DSH process permissions and injects input into the focused application. Please read the source code and MIT license before installing, enable only in trusted profiles, and get into the habit of manually toggling the switch per session.
  • Ecosystem: DSH follows the “everything is a plugin” philosophy; community directory sites (like SkillHub) have no official affiliation with DeepSeek or Hypersphere; this article is based on the repository README and package.json.

Conclusion

dsh-zcode-cua connects ZCode’s proven Computer Use runtime to DSH, filling in the desktop automation path when the bundle is unavailable on Windows, and reducing the risk of misuse with session switches and on-screen indicators. For further details, refer to the directory page and source code repository for installation specifics and the Changelog.

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

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

Xiaoye