Introduction

When building agents with DeepSeek Harness (DSH), accessing external models usually relies on API keys. However, some quotas provided by the ZCode (Z.ai) desktop application (for example, 300,000,000 GLM-5.3-Flash tokens in Weekend Build) are declared as account-bound in the client’s own catalog ("access": { "type": "zhipu-account", "mode": "start-plan" }), with no extractable API key. Attempting to use the platform route directly may fail due to CAPTCHA issues or return “Insufficient balance.”

This plugin drives the ZCode desktop application GUI through the Chrome DevTools Protocol (CDP), allowing the client to complete request signing and authentication itself. This enables DSH to use these account-bound quotas through a local OpenAI-compatible endpoint.

Plugin Info

  • Name: DSH ZCode Connector
  • Owner: ZhaoAndy821
  • Category: Model Inference
  • License: MIT

Core Features

  1. GUI-driven: Drives the ZCode desktop application GUI via CDP and simulates real user actions such as clicks, input, and reading.
  2. OpenAI-compatible endpoint: Provides a local service that accepts POST /v1/chat/completions requests, sends the prompt into the ZCode window, waits for the response, and returns the result.
  3. MCP server: Provides an MCP stdio server that exposes status, background execution, question, and configuration tools for MCP clients such as DSH.
  4. State reading: Reads client state from the ZCode file system (for example, agent settings, tool calls, and subagent runs) and displays it in a panel.

Working Principle and Behavior

The plugin does not obtain quotas by forging API keys; instead, it lets the ZCode client perform the actual work.

  1. Client-side signing: The ZCode renderer generates a signature for each request, using the same path as when a user manually clicks send.
  2. Real control operations: The bridge layer triggers real control events (clicks and text input) through CDP and does not rely on hidden internal interfaces.
  3. Credential security: The account token is used only to read the plan API for displaying remaining quota. It never leaves the system or is written to logs.
  4. Session model: It is designed for one conversation per session to avoid concurrent calls or retry storms.
  5. Window state: The window does not need to be visible, focused, or topmost; it only needs to run in the background. The plugin interacts with the renderer process through CDP, not the OS window stack.

Status Monitoring and Panel

The plugin provides an HTML panel in the right sidebar of DSH, showing real-time information such as:
* Account and plan information
* Real-time quota
* Loaded capabilities
* Running subagents (Role, task, tool call path, duration, and token consumption)
* Completed subagent results (status, duration, and number of tools)
* Generation indicator and automated scheduling tasks

Through the MCP stdio server, this status information can also be read by other MCP clients.

Installation and Enablement

This plugin is hosted in a community directory. When installing it, make sure to obtain it from a trusted source and verify the source code and license (MIT).

Use Cases and Notes

  • Use cases: Developers who need to use ZCode account-bound quotas (such as a specific plan or promotional credits) for development or testing, and do not want to rely on unreliable third-party proxy services.
  • Important notes:
    • Credentials are display-only: The token read by the plugin is used only to display quotas and never leaves the local system.
    • One conversation at a time: The current design is limited to one conversation per session and does not support multi-round parallelism.
    • Passive reading: Status monitoring is implemented by reading files, without actively polling the GUI or consuming additional quota.