ClaudeCallDSH: Enabling Claude Code to Launch Sessions, Dispatch Tasks, and Manage Automation in DSH

Introduction

DeepSeek Harness (DSH) is a project built on the philosophy of “everything is a plugin,” designed for building a local multi-agent, multi-session agent workspace. Many developers try to call DSH’s Web API directly from Claude Code, but the Web service of DSH Desktop sits behind a desktopBrowserAccess gateway — only the Electron renderer or explicitly whitelisted browsers can access it, and ordinary calls will likely hit a 403. If a plugin were to impersonate the renderer, it would silently widen the desktop’s security boundary, which is not safe.

The dsh-claude-call plugin by WoodSettler provides a more controlled bridging approach: it is a Host plugin that starts a dedicated loopback HTTP service on 127.0.0.1 with random token authentication; at the same time, it ships a zero-dependency MCP stdio server that wraps the bridge into 14 tools, enabling Claude Code to schedule across sessions, tasks, and automated jobs directly.

What It Is

This is a combination of a DSH plugin and a zero-dependency MCP server. Its core value is “letting Claude Code create sessions, dispatch tasks, read replies, and manage automated jobs within DSH.”

  • Maintainer: WoodSettler
  • Category: Workflow
  • Location: GitHub repository https://github.com/WoodSettler/dsh-claude-call

Core Capabilities

1. DSH Side: Host Plugin

When DSH Desktop starts, the plugin creates a local HTTP service (default port assigned by the kernel). After the plugin starts, it writes a discovery file to ~/.dsh/claude-call/endpoint.json, containing the service address, random token, pid, and update timestamp. Restarting the DSH process changes the port, but the MCP server re-reads this file on every call, so no Claude Code configuration changes are needed.

The plugin creates sessions via ctx.sessionController.create(), dispatches tasks with prompt(), and reads the reply from the session log by looking for turn/end and the last assistant/message. Automated jobs go through the host’s ctx.schedule service.

2. Claude Code Side: MCP Tools

The plugin provides 14 MCP tools, organized into several categories:

  • Sessions & Tasks: dsh_task, dsh_send, dsh_wait, dsh_status, dsh_cancel
  • Sessions & Workspaces: dsh_sessions, dsh_workspaces, dsh_models, dsh_turns
  • Automated Jobs: dsh_schedules, dsh_schedule_create, dsh_schedule_update, dsh_schedule_delete, dsh_schedule_history

Sessions & Tasks

  • dsh_task: Creates a new DSH session and dispatches a task, waiting for the reply by default. Required parameter: prompt. Optional parameters include cwd, title, agentPreset, workspaceId / workspacePath / workspaceTitle, createWorkspace, provider / model / reasoningEffort, wait (default true), timeoutSeconds (default 40).
  • dsh_send: Appends context to an existing session; the model can be changed. Required parameters: sessionId and prompt. Optional parameters include provider / model / reasoningEffort, wait, timeoutSeconds.
  • dsh_wait: Waits for the next turn to finish and returns the latest reply. Required parameters: sessionId and sinceSeq (required). Optional parameter: timeoutSeconds (default 45).
  • dsh_status: Reads the running state and the most recent reply without waiting. Required parameter: sessionId.
  • dsh_cancel: Cancels the current turn (preserves the queue). Required parameter: sessionId.

Sessions & Workspaces

  • dsh_sessions: Lists historical sessions, 20 by default (newest first). Parameters include sessionId (for a focused read), limit, workspace (filter by id / title / cwd).
  • dsh_workspaces: Lists registered workspaces, returning id, title, path, and session count.
  • dsh_models: Lists available models (grouped by provider) with their supported reasoningEffort levels, and shows the deployment default.
  • dsh_turns: Lists per-turn duration for a session (newest first), returning each turn’s duration, start/end timestamps, end reason, step count, and the prompt for that turn. Required parameter: sessionId. Optional parameter: limit (default 20).

Automated Jobs

  • dsh_schedules: Lists automated jobs. Without sessionId, it shows the machine-wide view (including completed inactive ones); with it, it shows active jobs for that session. Parameters include sessionId, includeInactive.
  • dsh_schedule_create: Creates an automated job. By default it creates a dedicated session to carry the dispatch; you can also explicitly bind an existing session. Required parameters include title (≤120 chars) and prompt. Time selectors (pick one): after_seconds / at / every_seconds / daily / weekly / cron. Optional parameters include sessionId, workspace / cwd / agentPreset, model fields.
  • dsh_schedule_update: Modifies name / prompt / time (active jobs only). Required parameters: id and sessionId. Optional parameters include title, prompt, time selectors (at / every_seconds / daily / weekly / cron).
  • dsh_schedule_delete: Deletes a job (along with saved dispatch records). Required parameters: id and sessionId.
  • dsh_schedule_history: Views the dispatch history of a job (newest first). Required parameters: id and sessionId. Optional parameters: limit (default 20) and before.

3. Sessions, Workspaces & Models

  • Listing sessions: dsh_sessions retrieves titles, cwd, associated workspace, and model selection via sessionController.list() + session projection. When projection data is missing, fields are null — no fabrication.
  • Specifying a workspace: Only effective at session creation time. dsh_task accepts workspaceId, workspacePath (with createWorkspace: true to register a new workspace in place), or workspaceTitle (must be a unique match). If a workspace is specified, a conflicting cwd is not allowed. Existing sessions cannot be re-attached to a different workspace.
  • Specifying model & reasoning level: Both dsh_task / dsh_send accept model, reasoningEffort (provider is only needed when it differs from the deployment default). If omitted, DSH defaults are used. When provided, the call invokes DSH’s native sessionController.selectModel() and stores this selection as the deployment default model.

4. Per-Turn Duration

dsh_turns answers “how long did this run take.” It returns two timing metrics:

  • Turn duration (durationMs): Derived from the time delta between turn/start and turn/end events in the session log — the actual time the model spent working. The last unfinished turn is returned with open: true, providing only elapsedMs, and is excluded from the average.
  • Bridge duration (in dsh_task / dsh_send / dsh_wait responses): Wall-clock time from when the bridge received the request to when this call returns. turnDurationMs is also included to show the turn’s own length.

Timestamps are taken from the events themselves, so whenever the bridge is woken up does not affect the statistics. Cold sessions (created before a DSH restart) first read the persisted log, and dsh_turns gives them a wider 60-second budget.

5. Automated Job Details

  • A job is bound to exactly one session; when due, the host injects the prompt into that session.
  • Default mode (mode: "new-session"): The bridge creates a session based on workspace / cwd / agentPreset, names it ⏰ <title>, binds the job to it, and returns sessionId.
  • Explicit binding mode (mode: "session"): Pass sessionId to inherit that session’s workspace, model, permission preset, and historical context — ideal for continuing a conversation.
  • Jobs outlive sessions: dsh_schedules uses a machine-wide catalog, so completed or archived-session jobs are still visible.
  • Periodic jobs expiring on the same session are merged into a single message.
  • Acknowledgment ≠ execution: A dispatch record only proves the reminder entered the session inbox, not that the model ran or finished.
  • Pause / immediate-run / new-session-per-run are not supported; after_seconds is only valid at creation time.
  • If the bound session fails to recover at dispatch time (deleted, moved), DSH retains the job and logs a warn — no automatic retry timer.
  • Automated jobs requiring manual approval will wait indefinitely for a human; the bridge does not alter permission presets on its behalf.
  • Write operations can be disabled entirely via the config option allowScheduleWrite: false; reads are unaffected.

Installation & Activation

1. Register the MCP Server in Claude Code

Run in PowerShell:

claude mcp add -s user dsh-call -- "D:\Scoop\apps\nodejs\current\node.exe" "E:\Repos\dsh-claude-call\mcp\server.mjs"
claude mcp list    # dsh-call should show connected

To remove:

claude mcp remove -s user dsh-call

2. Install the Plugin on the DSH Side

In DSH Desktop:

  1. Install dsh-claude-call from the “Plugins” page.
  2. After installation, the plugin writes a discovery file to ~/.dsh/claude-call/endpoint.json, containing the service address, random token, pid, and update timestamp.
  3. The plugin configures the port in the claude-call line of ~/.dsh/profiles/desktop/cordis.patch.yml (default port: 0, assigned by the kernel).

Typical Usage

  • “Fix the failing test in ~/repo-x and let DSH run it” → Call dsh_task with cwd pointing to the repo.
  • “Have DSH organize these three documents in the background, keep going for now” → dsh_task + wait: false, then dsh_wait later.
  • “Ask DSH how that session is progressing” → dsh_status.
  • “How much is left on that thing I asked DSH to do last time? Keep it going” → dsh_sessions to find the session and get sessionId, then dsh_send.
  • “Do this in the worktree-x workspace with glm-5.3 high reasoning” → Get the id from dsh_workspaces / dsh_models, then dsh_task + workspaceId + model + reasoningEffort.
  • “Every morning at 9, have DSH summarize yesterday’s meeting notes” → dsh_schedule_create (daily, default creates a dedicated session).
  • “What scheduled jobs are set up right now?” → dsh_schedules; “Change that one to 8:30” → dsh_schedule_update.

Use Cases & Notes

Ideal for developers building a local multi-agent, multi-session agent workspace who need to uniformly orchestrate sessions, tasks, and automated jobs from within Claude Code.

Note: The plugin runs with the current DSH process’s permissions. Review the source code and license before installing.

In Short

This plugin bridges Claude Code and DSH’s sessions, tasks, and automated jobs via a local loopback HTTP service with random token authentication — well suited for developers who want to drive DSH directly from Claude Code.

Directory page: https://www.skillhub.cn/plugins/WoodSettler/dsh-claude-call
GitHub: https://github.com/WoodSettler/dsh-claude-call

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

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

Xiaoye