dsh-any-agent
dsh-any-agent is an MCP server that turns DSH into a long-lived, background coding agent you can dispatch tasks to, supervise, and collect results from.
Create persistent DSH conversations with a workspace, model/provider, permission tier, approval policy, reasoning effort, and optional Git worktree isolation.
Dispatch coding goals asynchronously, returning a run ID and sentinel file, with optional blocking waits, queuing when busy, and idempotent retries.
Monitor conversations and live output incrementally with
dsh_list,dsh_read, anddsh_status.Collect completed turn results after reconnects or restarts with
dsh_get, including token usage and review tickets.Steer active work by interjecting to stop/redirect, queueing follow-up remarks, interrupting turns, and managing queued tasks.
Handle permission approvals across conversations with
dsh_inboxanddsh_approval_decide.Submit caller review verdicts (
pass/partial/fail) for completed runs.Manage DSH write-lock contention with takeover, release, and forget operations.
Run read-only health checks with
dsh_doctor.Watch dispatched work locally via
dsh-any-agent watchor a read-onlydashboardwith call-chain and token-usage views.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@dsh-any-agent fix the flaky login test and let me know when it's done"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Give any MCP client a coding buddy that sticks around.
Website · Quick start · Features · Tools · Live view · Usage notes · Changelog
🧪 Offline suite green in CI on Linux, Windows and macOS · 👀 new live call-chain view (watch / dashboard, with token usage) · 🔌 MCP over stdio · 📦 Zero dependencies · 📜 MIT
An MCP server that drives DeepSeek Harness as a long-lived coding agent. Hand it a goal, let it write code and run scripts, steer it mid-flight, and collect the result when you are ready.
Claude Code · Claude Desktop · Codex · Cursor · Windsurf · Zed · Gemini CLI · Antigravity · opencode · VS Code — or any client that speaks MCP over stdio.
🎯 The problem this solves
You already have a coding agent in your editor. What you do not have is one that can:
hand a multi-hour job to another agent and walk away — then collect the result when it's done;
keep the job alive across restarts of your editor, your session, your machine's idle reap (the conversation always survives; for a turn that is still running to survive the client closing or reconnecting, turn on resident process mode,
DSH_MCP_DAEMON=1);cut in mid-flight when it's going the wrong way, without destroying the work;
run several of them at once and switch between them;
see what it is doing without asking the agent — which tools it called, which approvals went through, how many tokens it spent.
DSH (DeepSeek Harness) can do all of that — it has file/shell tools, skills, subagents and workflows — but it is a GUI-first application. Its own sdk profile exposes only 3 requests and can't resume, cancel, or answer approvals.
This server is the missing adapter: it makes DSH into a well-behaved background agent that any MCP client can hire, supervise and collect from.
Think of it as
&job— like&in a shell, but for an agent.
Related MCP server: dsh-mcp
✨ Why it's different
Capability | What you get |
🔄 A dead process never kills a conversation | The identity lives on disk. A crash, an idle reap, even restarting this whole server costs you nothing — the next call transparently resumes it, memory intact (verified across processes). |
🗣️ You are never stuck waiting | Steer a conversation mid-flight — interject to stop and redirect (~100 ms to reach idle, measured over four cancelled turns), or queue a remark for after the current turn. Interrupting never damages the conversation. |
📡 Completion notification, not polling | Long tasks return immediately with a |
🌿 Edit the same repository at the same time |
|
🪟 Many conversations at once |
|
👀 You can see it yourself |
|
🧠 Reasoning hidden by default | You get "thought for N chars / M seconds" statistics instead of context-burning prose — and it is never logged, never written to disk. |
🤫 Silent by default | Not one byte on stderr, so nothing pollutes your host's logs. stdout carries the protocol and nothing else. |
🧩 Capabilities compose | DSH can mount its own MCP servers (IDA Pro, browsers, your internal tooling), so this is a bridge to a whole toolbox. |
🛡️ Read-only that really is read-only |
|
🔎 Caller review, not blind relay | Every result carries a |
🧭 Positioning: a dispatcher, not a capability aggregator
This server dispatches; it does not re-implement what DSH already does. The caller gives a goal, and DSH decides which tools, skills, subagents or team to use. Nothing from DSH's tool surface is proxied, duplicated or preloaded.
Owned by DSH (this server stays out) | Owned by this server (dispatch semantics) |
File I/O, shell, search, editing | Session identity and cross-crash resume |
Skills, subagents, Agent Teams, task board | Async dispatch, receipts, completion sentinels |
Model routing, sandbox, approval policy | Incremental read, interject, interrupt, live call-chain view |
Memory/context/compaction | Approval bridge, write-lock governance, queue, inbox |
worktrees the agent creates with git inside a conversation | Setup, status, doctor, audit; optional per-conversation worktree isolation ( |
Dispatch on demand: dsh_send passes a goal, not a tool manifest, and the caller
does not need to know DSH's tool list. The DSH agent picks what it needs — including
capabilities added after this server was built (for example Agent Teams). This
server does not grow one MCP tool per DSH feature.
Team mode (opt-in since 0.5.0): off by default. Run dsh-any-agent team on
and reconnect to use the dsh-team profile by default. From DSH 0.2.2-rc.2, new
sessions use DSH's shared task board and standard subagent tools. Earlier DSH
versions use the experimental team tools. Teammates share one workspace.
Only dispatch semantics become tools: start, send, read, get, review, interject, interrupt, approve, queue, inbox, status, release, takeover, doctor. No file I/O, no shell, no editor, no task board.
When to add something outside DSH: only when you need a guarantee rather than a
behavior — for example, several top-level sessions editing the same repository need
worktree isolation (dsh_start(isolation="worktree") gives each conversation its own git
worktree and branch). For collaboration, prefer letting DSH run the team itself.
Quick start
Requires Node.js ≥ 22.15 and DSH installed with a working model route and credentials. See Requirements for details.
npm install -g dsh-any-agent
dsh-any-agent-setup
dsh-any-agent-setup --yesThe second command previews the changes; --yes applies them. Reconnect your client's MCP server and run the installation check. The dispatch workflow shows how to send a task in your project and collect the result.
Collect results after reconnecting. Call dsh_get with the conversation ID and the original run_id or client_run_id. With only the conversation ID, it can find the most recently started turn. On startup the server prunes result files older than seven days by default. Keep the result file while you still need its idempotency key for retries.
Only using Cursor or VS Code? Add it in one click instead (runs npx -y dsh-any-agent@latest; DSH still has to be installed):
Want to see it first? Watch the 54-second promo — dispatch, interject, the sentinel landing and the caller's review, with the terminal replayed from a real run:
Before your first task: read the Usage Notes, especially the model-config and external-MCP permission boundaries. External MCP tools bypass DSH's sandbox. For a fresh machine, follow Setup.
The default is
workspace-writewith escalation denied. To review escalation requests individually, setDSH_MCP_APPROVAL=askin the MCP server configuration and reconnect. A tool call may choose a stricter policy. Useread-onlyfor untrusted content. See Permissions & privacy.
Quick start — Install and connect · Changelog
Start here — The problem · Why it's different · Why not just wrap the DSH CLI · Requirements · Setup
Using it — Tools · Live view · Dispatch then collect · Completion notifications · Many conversations
Behavior — Permissions · Reasoning · Logging and privacy · Workspace & GUI
Hard parts — The write lock
Reference — Environment · Tests · Known limitations · Why the old profile name?
🧰 Tools
Tool | What it does |
| Create a conversation: workspace, permission tier, approval policy, reasoning effort (default |
| Hand it a task. Defaults to |
| All conversations with live state: |
| Cursor-based incremental read of what a running conversation is producing right now. The cursor is a revision number: an entry whose text grew since your last read reappears — match it by |
| Conversation details and turn results. Pass |
| Caller review. Submit |
| Interject while it's busy: |
| Preempt the write lock. Verifies the holder’s OS start time before terminating it. Another live instance also requires |
| Stop the current turn without sending anything new (the conversation stays healthy); to stop and redirect, use |
| Hand the conversation back (frees the write lock so you can open it in your own DSH GUI). Still resumable; |
| Adjudicate a pending approval (only when |
| Lightweight status check (single conversation), including the write-lock holder |
| Cross-conversation approval inbox: every pending approval with reason, input and age; decide with |
| Inspect/modify the session queue: |
| Read-only health check: DSH version, profile, state/dir writability, orphan locks, sessions and RSS, effective config |
Every tool declares all four MCP annotations (readOnlyHint, destructiveHint, idempotentHint, openWorldHint). Six only read state and are marked read-only: dsh_list, dsh_read, dsh_get, dsh_status, dsh_inbox, dsh_doctor. Tool titles, descriptions and the server instructions come in English and Chinese: they follow your system language, or set DSH_MCP_LANG=en|zh. Tool results follow the same setting; a few less common error messages are still Chinese only.
👀 Live view: see what the dispatched work is doing
The tools above are for the calling agent. You, sitting at the client, usually see one dsh_send and nothing else. Since 0.6.1 the server writes each conversation's activity to a local event stream, so you can watch the call chain without going through the agent:
claude-code pid 8328
└─ e896d16a temperature module running · total 278k/17k · context 3%
├─ ✓ run-…-1 [send] · done · 1m24s · 8 tools · 69k↑ 4.1k↓ tok
└─ ▶ run-…-2 [queue] · running · 156k↑ 12k↓ tok
✓ read temp.js 13ms
✓ edit temp.js 18ms
◆ approval auto-allow ⚠ danger-full-access node --test
▶ pwsh node --testdsh-any-agent watchdsh-any-agent dashboard --openwatch: the call chain in your terminal, redrawn in place liketop(no scrolling spam).watch <conversation id prefix>follows one conversation;--onceprints once and exits.dashboard: a local read-only web page;--openlaunches it in your default browser. Left: conversations grouped by client. Middle: the run timeline, with a timing bar per tool call and approvals/escalations highlighted. Right: overview, tool breakdown, files touched, approvals, and token usage (input / output / cache hit, context window, per-turn chart).English / 中文: follows your system language by default; pass
--lang en|zhto choose, or switch from the page's top-right corner.Doesn't disturb running work: both are separate processes that only read event files — they never touch the write lock or DSH. Use them to watch progress, and don't open MCP-driven conversations in the DSH GUI (that takes the write lock; see usage notes 3.10).
Safety and privacy: the dashboard binds
127.0.0.1only, its URL carries a one-time token, it checks the Host header, and it has no control that changes state. Command, path and prompt previews are redacted first; reasoning is never written at any level.DSH_MCP_LIVE=metakeeps only tool names and status;offdisables it.
Details in Usage · side view; event format and design trade-offs in the live view design.
📚 Documentation map
Document | Contents |
Requirements, profile bootstrap, 10 MCP clients | |
Dispatch/collect, sentinels, many conversations, live view, reasoning | |
Pitfalls: model routing, cost, concurrency and the write lock, permissions, privacy, troubleshooting | |
Event stream format, | |
Default behavior, how to disable (per client), verify and revert | |
Tiers, approvals, GUI visibility, logging | |
Four holder classes, takeover, GUI contention | |
Every switch and its default | |
Offline/integration suites and coverage | |
Limits, profile naming | |
DSH version matrix, team-package requirements, upgrade checks | |
Why ACP, sdk/plugin comparison | |
Release checklist |
🧑🤝🧑 Team mode (opt-in)
Run dsh-any-agent team on or dsh-any-agent team off, then reconnect. DSH
0.2.2-rc.2 and newer remember the team setting for each session.
Full steps (commands, verification, rollback) are in Team mode.
📇 Listed on
🙏 Acknowledgements
dsh-any-agent started from Moer2831/Deepseek-DSH-MCP (MIT), where this server was called dsh-mcp. The ACP client, the session hub, write-lock handling, sentinel files, the original design draft and the first test suites come from that project; client setup and restore, team mode, the live view, caller review and the release pipeline were added here. The original copyright notice is kept in LICENSE.
Star History
Available Tools
15 toolsdsh_approval_decideDecide approvalADestructive
While a turn is running, decide a permission request DSH is waiting on (these only appear when the conversation uses on_approval=ask); after you allow or deny, the turn continues. It hands DSH's out-of-sandbox and escalation requests to the caller instead of allowing or denying them all. To grade the result of a finished turn use dsh_review.
Inputs: decision (required), approval_id (required), conversation_id (required).
dsh_doctorHealth checkARead-onlyIdempotent
Read-only health check: the DSH executable and version, whether the profile exists or has drifted, the state file, whether the runs/locks directories are writable, orphan locks, the number of sessions and their RSS, and the effective configuration. It reports and changes nothing; ok=false means at least one check failed.
Inputs: no named parameters.
dsh_getGet conversation or run resultARead-onlyIdempotent
Details of one conversation; with run_id, the final result of that dispatch (the place to collect asynchronous work). Without run_id it uses the most recent turn. Returns: title, workspace, permission tier, state, turn count, token usage, context pressure, pending approvals, and the turn's full result (answer, tools, usage, error) with its review ticket. The service keeps the latest 20 runs in memory. After a restart or eviction the result is read back from the sentinel file, which is on disk and survives restarts.
Inputs: conversation_id (required), run_id, max_chars, client_run_id. Returns: run, sentinel_file, conversation_id
dsh_inboxApproval inboxARead-onlyIdempotent
Inbox of pending approvals across conversations (dsh_status covers a single one). Lists every approval waiting for your decision: conversation id and title, approval id, tool, reason, a summary of the command or path, and how long it has waited. Decide with dsh_approval_decide. Returns an empty list when nothing is pending.
Inputs: include_input, conversation_id. Returns: count, approvals
dsh_interjectInterjectADestructive
Say something to a conversation while it is running a turn. This tool blocks until the new turn ends (it moves to the background only when timeout_ms expires). Two modes: interject (default) stops the current turn and redirects at once; queue does not stop it and speaks right after the current turn ends naturally (without using the dsh_queue queue). To stop without saying anything use dsh_interrupt; to run after the current turn without blocking use dsh_send(queue=true). On an idle conversation it runs as an ordinary wait=true turn (full result, not a receipt). Note: ACP refuses concurrent prompts, so steering the model inside the same turn is not possible; interject is the practical equivalent (cancel, then start a new turn immediately, with history intact).
Inputs: message (required), conversation_id (required), mode, review, +3 more.
dsh_interruptInterrupt turnADestructiveIdempotent
Stop without saying anything new: interrupt the turn the conversation is running (ACP's native session/cancel, the same path as a user pressing stop). The interrupted turn is recorded as cancelled; the text and tool calls it had produced stay in its result (dsh_get / sentinel), and files it changed are not rolled back. The conversation itself stays healthy and can take a new task right away. To stop and redirect use dsh_interject; to cancel a queued task that has not started use dsh_queue(action=remove).
Inputs: conversation_id (required).
dsh_listList conversationsARead-onlyIdempotent
List conversations and their live state, for keeping track of several at once. state: running (a turn is in progress) / idle (process alive, nothing running) / detached (no process; resumable). A running conversation also reports elapsed time, the tool it is executing and how much it has output this turn. Two sources are merged: conversations this server holds, and ones on DSH's disk that are not open (DSH's session/list leaves out open sessions). Pass only_running=true for just the active ones; follow up with dsh_read to see what one is producing.
Inputs: cwd, only_running, include_closed. Returns: count, running, probe_ok, probe_error, +3 more
dsh_queueManage queueADestructive
Inspect or change a conversation's queue of pending tasks (it only manages tasks already queued; enqueue with dsh_send(queue=true)). A restart marks unstarted receipts cancelled. action=list lists them. remove cancels one and writes a cancelled sentinel; update rewrites the queued text; promote moves one to the front.
Inputs: action (required), conversation_id (required), text, run_id.
dsh_readRead live outputARead-onlyIdempotent
Read a conversation's run-time output (cursor-based and incremental): see what a running conversation has produced so far without waiting for the turn to end. Typical use: dsh_list(only_running) to find active conversations, then call dsh_read repeatedly, passing back the last cursor, to watch several in turn. The output buffer is memory-only and bounded (a ring; the oldest entries are dropped) and disappears when the server or process exits. Reasoning is not buffered: live reasoning of the turn currently running is attached only with include_reasoning=true. The cursor is a revision number: an entry whose text grew is returned again; match it by seq and replace its text (do not append twice).
Inputs: conversation_id (required), limit, cursor, include_reasoning.
dsh_releaseRelease conversationADestructiveIdempotent
Release the DSH process a conversation occupies (this frees the write lock so the user can open the same conversation in their own DSH GUI). The conversation stays on disk and can be resumed later; forget=true writes a tombstone: it is removed from the registry and later lookups by id say it was forgotten (to bring it back, delete the tombstone file named in the error, by default $DSH_HOME/.dsh-any-agent-forgotten/<id>.json). To free memory in one go when you are done, pass all=true (each conversation is about 300-480 MB; the default MAX_LIVE=4 already reaps the least recently used one; all=true releases idle conversations and skips ones running a turn unless force=true). Releasing a single conversation stops its DSH process; if a turn is running, it is interrupted.
Inputs: all, force, forget, conversation_id.
dsh_reviewSubmit review verdictA
Record the caller's review verdict on the result of a turn that has ended (to allow or deny a permission request while a turn is running, use dsh_approval_decide). Results from dsh_send / dsh_interject and the sentinel carry a review ticket (checklist, evidence summary, review_id). Before treating a result as done, verify it yourself (read the changed files, look at git diff, run tests), then call this tool to record pass / partial / fail. Reviews are advisory by default: they do not block later dsh_send calls and are not fed back to DSH automatically; send another dsh_send if something needs fixing. A verdict can still be submitted after the run record was evicted from memory or the server restarted (the sentinel file is the reference).
Inputs: run_id (required), verdict (required), conversation_id (required), notes, +1 more.
dsh_sendDispatch taskADestructive
Dispatch a task to a conversation. Give a goal, not commands: DSH decides which file, shell, search, skill, subagent and team tools to use, and this server does not preload or proxy DSH's tool surface. Non-blocking by default (wait=false): it returns run_id + sentinel_file at once, the turn runs in the background and you are notified when it ends, so you can do other work and the task is never cut off by a timeout. Pass wait=true to block for the result (optionally with timeout_ms; on expiry it only moves to the background and does not cancel the turn). [A timeout never destroys the task] when wait=true reaches timeout_ms before the turn ends, this tool does not error and does not cancel: it downgrades to background, returns run_id + sentinel_file, and the turn runs to the end with the result delivered through the sentinel file (timeout_ms=0 means wait forever). In both modes a small file holding the final result is written atomically when the turn ends. Wait for it with a background task (Bash run_in_background + until [ -f sentinel_file ]; on Windows/PowerShell a Test-Path loop, and the receipt contains ready-made commands) and you are woken when it lands; no polling needed. Once the file exists, read it for the result, or collect with dsh_get(conversation_id, run_id); dsh_read shows output while the turn is running. Reasoning is hidden by default (answer plus reasoning statistics only). Results and background receipts carry a review ticket (advisory by default): verify, then submit a verdict with dsh_review. If the conversation is busy this tool errors: use dsh_send(queue=true) to enqueue (returns at once), dsh_interject to stop and redirect, or dsh_interrupt to just stop.
Inputs: prompt (required), conversation_id (required), team, wait, +5 more. Returns: queued, run_id, status, replayed, +3 more
dsh_startStart conversationA
Create a DSH conversation: a coding agent you can keep working with. The conversation lives on disk and the process is only a cache; if the process is reaped or crashes, the next dispatch brings it back with ACP session/resume and nothing is lost. Returns the conversation_id and the conversation title. Dispatch work to it with dsh_send.
Inputs: cwd, model, review, provider, +6 more. Returns: cwd, permission, on_approval, conversation_id
dsh_statusConversation statusARead-onlyIdempotent
A lightweight snapshot of one conversation: reads live state from this server's memory without spawning a DSH process. Returns state (running/idle/detached), the current tool and output size while running, the latest turn's run_id, status and review status, pending approvals, queue length, and the write-lock holder lock_holder (when you hit the lock, use it to choose between dsh_takeover and asking the other side to dsh_release). For a turn's full result use dsh_get, for live output dsh_read, for all conversations dsh_list.
Inputs: conversation_id (required). Returns: run, busy, alive, state, +4 more
dsh_takeoverTake over write lockADestructive
Preempt a conversation's write lock. DSH's write lock is a cross-process kernel semaphore that never expires while its holder lives, and no API can take it away: the only means is killing the holder, so this tool first works out who that is. (1) If the lock is actually free, a normal resume follows and nothing is killed. (2) If the holder is an orphan this server left behind, its OS start time must match the registration before takeover. (3) Another live dsh-any-agent instance also requires force=true. (4) If the holder is unknown, or its start time is missing or differs from the registration, release the conversation in its original host and retry. Killing a holder that is running a turn interrupts that turn (logged as interrupted); the conversation itself is unharmed.
Inputs: conversation_id (required), force.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 15 tools
Most tools target a clearly distinct lifecycle action (start/send/read/get/interrupt/release), and the descriptions aggressively cross-reference the sibling tool to disambiguate (read vs get, status vs list, inbox vs approval_decide vs review). The residual overlap is small but real: dsh_send(queue=true), dsh_interject(queue), and dsh_interrupt all touch 'steering a running turn', and dsh_release vs dsh_interrupt both stop work — an agent has to read carefully to pick correctly.
Every tool uses the same dsh_ prefix plus a lowercase action word (start, send, read, get, list, status, interrupt, release, doctor). No camelCase or mixed verb styles anywhere; the surface reads as one predictable namespace.
15 tools sits at the top of the well-scoped band, and the domain (managing long-lived async coding-agent conversations with locks, queues, approvals and reviews) genuinely needs most of them. A few, such as dsh_doctor and dsh_takeover, are narrow operational escapes that most sessions never touch, pushing it slightly past lean.
The lifecycle is well covered end to end: create, dispatch, watch live output, collect results, steer, stop, queue management, approvals, review verdicts, lock preemption, release/forget, and health checks. Gaps are minor — no way to change a conversation's configuration (workspace, permission tier, profile) or to enumerate past runs beyond the in-memory 20 / sentinel file, so history and reconfiguration require working around the surface.
Maintenance
Related MCP Connectors
Remote MCP server for supportsheep: run AI interviews and manage support content for your blog.
Remote MCP server for supportsheep: run AI interviews and manage support content for your blog.
- aXDeprecatedio.github.ax-platform
Agent-native collaboration network: orchestrate a team of long-running agents from any MCP client.
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceLets any MCP-capable coding harness (Cursor, Claude Code, Codex, Gemini CLI, VS Code/Copilot, opencode, and others) hand a self-contained task to a real, isolated DeepSeek Harness process that works in a chosen workspace with its own context window, model, and toolchain, then returns the final answer. Exposes task submission with time estimates and acceptance criteria, status polling with live progress and process-tree telemetry, graceful cancel and forced kill of whole process trees, and a health probe reporting concurrency, deadlines, and recent jobs.2MIT
- AlicenseNot gradedqualityBmaintenanceLets Claude Code, Codex, or any MCP client drive DeepSeek Harness as a long-lived coding agent: starting and resuming conversations, dispatching tasks in the background, streaming live output and reasoning stats, interjecting or interrupting mid-turn, handling approval prompts, and collecting results later. Sessions persist by ID, so work survives process restarts and can be handed back to a DSH GUI when needed.16MIT
- AlicenseNot gradedqualityBmaintenanceEnables any MCP-capable client (Claude Code, Cursor, VS Code, and others) to deliver messages into a local DeepSeek Harness over stdio or Streamable HTTP. It also exposes a pull-based task queue so producers can publish work that clients claim, complete, or list.MIT
- AlicenseBqualityBmaintenanceEnables MCP-compatible clients to delegate complex multi-step programming and research goals to coordinated teams of specialized subagents, with cross-session messaging, swarm and pipeline workflows, sandboxed workspace tools, persistent SQLite state, and a live dashboard.2274 npm1MIT