Back to home@Daseanle

dsh-mcp-orchestrator

MCP orchestration layer for DeepSeek Harness — multi-server routing, health monitoring, fallback, and tool aggregation

Stars
0
Language
JavaScript
Created
Aug 19, 2026
Updated
Aug 19, 2026
GitHub repo

Introduction

dsh-mcp-orchestrator

MCP orchestration layer for DeepSeek Harness (DSH) — multi-server management, health monitoring, auto-restart, and tool aggregation with collision handling.

What It Does

DSH has built-in MCP client support, but it lacks orchestration: there's no health monitoring, no auto-restart on crash, no tool collision detection, and no unified tool discovery. This plugin fills that gap.

Key capabilities:

  • Connect to multiple stdio MCP servers simultaneously
  • Health monitoring via periodic ping checks
  • Auto-restart with exponential backoff on unexpected disconnection
  • Tool aggregation across all servers with collision detection
  • Three namespace modes for tool name conflicts (collision, server, dot)
  • Three DSH management tools for the agent to discover and call MCP tools

Status: v0.1.0 — MVP

Verified Capabilities

CapabilityStatusTest
MCP SDK Client API (connect, ping, listTools, callTool, close)Passtest/spike.mjs
Multi-client support (2+ servers)Passtest/spike.mjs
Error handling (non-existent tool, missing args)Passtest/spike.mjs
ServerManager connect/disconnect/restartPasstest/integration.mjs
Tool discovery and callingPasstest/integration.mjs
Auto-restart with exponential backoffPasstest/integration.mjs
Tool collision detectionPasstest/integration.mjs
Namespace modes (collision/server/dot)Passtest/integration.mjs
Health monitoring (ping-based)Passtest/integration.mjs
Zod config schema validationPasstest/integration.mjs
Plugin lifecycle (apply, tools, system prompt, cleanup)Passtest/integration.mjs
Multi-server plugin with collision handlingPasstest/integration.mjs

Test Results

Spike:         34 passed, 0 failed
Integration:  124 passed, 0 failed
Total:        158 passed, 0 failed

Architecture

DSH Agent (Node.js process)
  └─ Cordis Framework
       └─ dsh-mcp-orchestrator plugin (apply(ctx, config))
            ├─ Config Schema (zod: servers[], healthCheckInterval, namespaceMode)
            ├─ System Prompt: "mcp-orchestrator" (management tools + workflow guide)
            ├─ Tool: mcp_list_servers (status, health, tool count per server)
            ├─ Tool: mcp_list_tools (aggregated tools, collision info, namespaced names)
            ├─ Tool: mcp_call_tool (auto-resolve server or explicit, proxy call)
            ├─ ServerManager
            │    ├─ Multi-server stdio connections (StdioClientTransport)
            │    ├─ Auto-restart (exponential backoff, max restarts)
            │    ├─ Tool sync (listTools on connect/reconnect)
            │    ├─ Health ping
            │    └─ findServerForTool (priority-based resolution)
            ├─ ToolRegistry
            │    ├─ Tool aggregation across all servers
            │    ├─ Collision detection (same tool name on multiple servers)
            │    └─ Namespace modes: collision / server / dot
            ├─ HealthMonitor
            │    └─ Periodic ping checks (configurable interval)
            └─ ctx.effect() cleanup (stop monitor, close all servers)

Installation

Prerequisites

  • Node.js >= 22.19 (or >= 24)
  • DSH installed: npm install -g @deepseek-ai/dsh
  • At least one MCP server to connect to

Build

cd dsh-mcp-orchestrator
npm install
npm run build

Install into DSH

Option A: From GitHub (recommended)

dsh plugin --profile web add github:Daseanle/dsh-mcp-orchestrator
dsh web

Option B: From local clone

git clone https://github.com/Daseanle/dsh-mcp-orchestrator.git
cd dsh-mcp-orchestrator && npm install && npm run build
dsh plugin --profile web add file:./dsh-mcp-orchestrator
dsh web

Configuration

Create or edit cordis.patch.yml in your DSH config directory:

- id: dsh-mcp-orchestrator
  config:
    servers:
      - name: filesystem
        command: npx
        args: ["-y", "@modelcontextprotocol/server-filesystem", "/tmp"]
        autoRestart: true
        priority: 10

      - name: memory
        command: npx
        args: ["-y", "@modelcontextprotocol/server-memory"]
        autoRestart: true
        priority: 5

    healthCheckInterval: 30000
    namespaceMode: collision

Config Schema (zod)

FieldTypeDefaultDescription
serversarray[]MCP server configurations
servers[].namestringUnique server name
servers[].commandstringExecutable to run
servers[].argsstring[][]Command line arguments
servers[].envRecord<string, string>{}Environment variables
servers[].autoRestartbooleantrueAuto-restart on crash
servers[].restartDelaynumber2000Base restart delay (ms)
servers[].maxRestartsnumber3Max restart attempts
servers[].prioritynumber0Priority for tool resolution (higher = preferred)
healthCheckIntervalnumber30000Ping interval (ms)
namespaceModeenumcollisionTool name collision handling

Namespace Modes

ModeBehaviorExample
collisionNamespace only when same tool name exists on 2+ serversechoserver1__echo (if collision)
serverAlways namespace with serverName__toolNameechoserver1__echo
dotAlways namespace with serverName.toolNameechoserver1.echo

Project Structure

dsh-mcp-orchestrator/
├── src/
│   ├── index.ts              # Plugin entry: apply(ctx, config) with zod schema
│   ├── server-manager.ts     # MCP server connections, auto-restart, tool sync
│   ├── tool-registry.ts      # Tool aggregation, collision detection, namespacing
│   ├── health-monitor.ts     # Periodic ping-based health checks
│   └── tools/
│       ├── list-servers.ts   # mcp_list_servers tool
│       ├── list-tools.ts     # mcp_list_tools tool
│       └── call-tool.ts      # mcp_call_tool tool
├── dist/                      # Compiled JavaScript (tsc output)
├── test/
│   ├── mock-server.mjs       # Mock MCP server (echo, add, greet)
│   ├── mock-server-2.mjs     # Second mock server (echo, subtract) for collision tests
│   ├── spike.mjs             # Spike: MCP SDK API validation (34 tests)
│   └── integration.mjs       # Integration: full plugin tests (124 tests)
├── cordis.patch.yml          # Example plugin configuration
├── package.json
├── tsconfig.json
├── CHANGELOG.md
└── LICENSE

Roadmap

PhaseScopeStatus
Phase 1 — SpikeMCP SDK validation, connect/listTools/callTool, multi-clientComplete
Phase 2 — MVPServerManager, ToolRegistry, HealthMonitor, auto-restart, 3 DSH toolsComplete
Phase 3 — OrchestrationFallback routing, usage statistics, priority weighting, open source releasePlanned

License

MIT