dsh-mcp-proxy
ben7am1n
Context-cheap lazy MCP access for DeepSeek Harness
PROJECT TOPICS
PROJECT README
A macOS-only account-pool and native provider plugin for DeepSeek Harness (dsh).
Current status / 当前状态: Developer preview · macOS only · Windows is not supported or verified in this release.
Dockyard DSH 把多个官方 OAuth / 官方 CLI 会话接入 DeepSeek Harness,提供一个统一的账号池、模型目录、额度状态和 provider-native 请求入口。它是 DSH 的原生 bundle/plugin,不需要另起一个代理网关,也不把 provider 逻辑塞进 DSH 核心。
当前包含的 provider 模块:
claude 官方 CLI 的订阅 OAuth 会话与原生请求适配。cursor-agent 或 Cursor.app 的官方 active session 与原生请求适配。如果对应的官方 CLI 或桌面端没有安装、没有登录,Dockyard 会返回明确的 unavailable/degraded 状态;不会用硬编码的账号、模型、版本、套餐或额度伪造可用结果。
/dockyard 命令管理账号和 provider。当前发布版本只支持 macOS。Windows 不是受支持的平台,也没有经过完整验证。
原因是当前完整功能依赖 macOS 原生能力和 macOS 官方客户端状态:
/usr/bin/open 打开授权页面。纯 JavaScript 的部分未来可以继续做跨平台抽象,但本仓库当前不能宣传为 macOS/Windows 通用。如果你使用 Windows,请等待 Windows backend 和真实 E2E 验证完成。
Dockyard DSH 是 DSH plugin,不是独立的 agent。请先安装 DSH CLI,并确认 dsh 命令可用。
当前上游 DSH CLI 的 npm 安装方式:
# DSH 当前是 developer preview;请使用上游要求的 Node.js 版本。
# 当前上游 package.json 要求 Node 22.19+ 的 22.x,或 Node 24+。
npm install --global @deepseek-ai/dsh
dsh --version
上游安装和兼容性变化以 DeepSeek Harness 官方仓库 为准。
git clone https://github.com/AITabby/dockyard-dsh.git
cd dockyard-dsh
# 安装仓库依赖;prepare 会生成/刷新可分发 bundle。
npm install
# 推荐先做一次本地验证。
npm test
npm run build
把本地 checkout 安装到一个隔离的 DSH profile:
DSH_HOME=/tmp/dockyard-dsh-home dsh plugin --profile dockyard-dsh add .
DSH_HOME=/tmp/dockyard-dsh-home dsh --profile dockyard-dsh --dump-config
DSH_HOME=/tmp/dockyard-dsh-home dsh --profile dockyard-dsh
验证通过后,日常使用可以省略临时 DSH_HOME,直接安装到默认 DSH home:
dsh plugin --profile dockyard-dsh add .
dsh --profile dockyard-dsh
首次运行建议保留 --dump-config,确认配置中出现 @dockyard-dsh/plugin bundle。
仓库公开后,可以直接让 DSH 从 GitHub 安装:
dsh plugin --profile dockyard-dsh add github:AITabby/dockyard-dsh
dsh --profile dockyard-dsh
如需固定到某一次提交,使用:
dsh plugin --profile dockyard-dsh add github:AITabby/dockyard-dsh#<commit-sha>
GitHub 直装最短,但 DSH 使用 pnpm 安装 git dependency 时,可能会提示允许执行该包的 prepare。这是安装器对远程代码执行的安全确认:请先阅读源码,只对信任的版本允许构建,再按终端输出把准确的包名加入对应 profile 的 pnpm-workspace.yaml,通常形如:
allowBuilds:
'@dockyard-dsh/plugin': true
如果你不想处理这个确认,使用上面的“克隆后安装”方式最简单、最可控。本仓库会提交已经生成的 packages/dsh-plugin/dist/index.mjs 和 packages/dsh-plugin/lib/client.js,确保 checkout 本身包含可运行的发布入口。
在运行中的 DSH profile 中:
/dockyard status
/dockyard scan [provider]
/dockyard add [provider] [candidateId]
/dockyard login <provider>
/dockyard refresh [provider]
/dockyard models <provider>
/dockyard policy <provider> <manual|sticky_session|round_robin|failover> [accountId]
/dockyard use <provider> <accountId>
/dockyard remove <provider> <accountId>
常见流程是:先 /dockyard login <provider> 或 /dockyard scan <provider>,再 /dockyard add <provider>,最后用 /dockyard status 和 /dockyard models <provider> 检查实时状态。
claude auth login --claudeai 和 claude auth status --json。官方没有返回真实额度窗口时,Dockyard 显示未知,不估算百分比。cursor-agent login、cursor-agent status 和官方 streaming 接口;也可读取 Cursor.app 的 active OAuth session。官方客户端没有提供的模型或额度不会被硬编码。grok login --oauth、grok models 和 streaming JSON;请求使用短生命周期的官方 CLI profile,完成后清理临时文件。127.0.0.1。远程绑定必须显式设置 DOCKYARD_DSH_ALLOW_REMOTE=1 和 DOCKYARD_DSH_REMOTE_TOKEN,并使用 Authorization: Bearer ...。unknown/null。SECURITY.md,不要提交 token、OAuth 文件、Keychain 值或包含敏感信息的日志。本地页面只是调试/观察界面,不是 DSH plugin 的运行前提:
npm run dev
open http://127.0.0.1:8787/
页面和 DSH 命令读取同一个 runtime;它不会创建第二套账号池、模型目录或额度数据源。
npm install
npm test
npm run build
npm run build:plugin
npm pack --dry-run
发布包的关键内容是:
packages/dsh-plugin/dist/index.mjs # Node/host bundle
packages/dsh-plugin/lib/client.js # browser client bundle
packages/dsh-plugin/cordis.patch.yml # DSH bundle layer
npm pack --dry-run 应只显示发布入口、client bundle、patch、必要的 package metadata 和安全说明。修改 provider source 后,重新执行 npm run build,再提交更新后的构建产物。
packages/core/ 模块生命周期、契约、事件和 DSH route
packages/account-pool/ 账号发现、选择、健康状态和 credential reference
packages/runtime/ 一个共享的 Dockyard runtime
packages/dsh-plugin/ DSH bundle、LLM adapter、命令和 client UI
packages/vault/ macOS Keychain backend
modules/provider-*/ 各 provider 自己的 OAuth、目录、额度和 native transport
apps/local-page/ 可选的 loopback 调试页面
tests/ 安全、生命周期、provider 和 runtime 测试
核心原则是:provider-specific 逻辑留在 provider module,账号选择留在 runtime,host 只消费稳定契约。不要在 host 中新增 provider 特判,也不要把动态 provider 数据写成常量。
Dockyard DSH is a native DeepSeek Harness bundle/plugin that connects official OAuth and official CLI sessions to one shared account pool, model catalog, quota view, and provider-native request path. It does not require a second proxy gateway and it does not put provider-specific branches into the DSH core.
Current provider modules:
claude CLI.cursor-agent or Cursor.app.When an official CLI or desktop client is missing or not signed in, Dockyard reports an explicit unavailable/degraded state. It does not invent accounts, models, versions, plans, or quota values.
/dockyard command surface.This release supports macOS only. Windows is not supported and has not been fully verified.
The complete integration currently depends on macOS-specific behavior:
/usr/bin/open.Some pure JavaScript layers can be abstracted for other platforms later, but this repository must currently be treated as a macOS-only plugin.
Dockyard DSH is a DSH plugin, not a standalone agent. Install the DSH CLI first and verify that the dsh command is available:
# DSH is currently a developer preview. Use the Node.js version required by DSH.
# The current upstream package declares Node 22.19+ on the 22.x line, or Node 24+.
npm install --global @deepseek-ai/dsh
dsh --version
Follow the official DeepSeek Harness repository for upstream installation and compatibility changes.
git clone https://github.com/AITabby/dockyard-dsh.git
cd dockyard-dsh
npm install
npm test
npm run build
Install the checkout into an isolated profile first:
DSH_HOME=/tmp/dockyard-dsh-home dsh plugin --profile dockyard-dsh add .
DSH_HOME=/tmp/dockyard-dsh-home dsh --profile dockyard-dsh --dump-config
DSH_HOME=/tmp/dockyard-dsh-home dsh --profile dockyard-dsh
After verification, omit the temporary DSH_HOME to use the default DSH home:
dsh plugin --profile dockyard-dsh add .
dsh --profile dockyard-dsh
Once the repository is public, DSH can install it without a manual clone:
dsh plugin --profile dockyard-dsh add github:AITabby/dockyard-dsh
dsh --profile dockyard-dsh
For a reproducible install, pin a commit:
dsh plugin --profile dockyard-dsh add github:AITabby/dockyard-dsh#<commit-sha>
Because a GitHub install is a pnpm git dependency, DSH may ask for permission to run the package's prepare script. Review the source and allow the exact package key printed by pnpm, usually:
allowBuilds:
'@dockyard-dsh/plugin': true
If you want to avoid that prompt, clone the repository and run npm install instead. The repository intentionally carries the generated packages/dsh-plugin/dist/index.mjs and packages/dsh-plugin/lib/client.js artifacts so a checkout contains the runnable release entry points.
/dockyard status
/dockyard scan [provider]
/dockyard add [provider] [candidateId]
/dockyard login <provider>
/dockyard refresh [provider]
/dockyard models <provider>
/dockyard policy <provider> <manual|sticky_session|round_robin|failover> [accountId]
/dockyard use <provider> <accountId>
/dockyard remove <provider> <accountId>
A typical flow is /dockyard login <provider> or /dockyard scan <provider>, then /dockyard add <provider>, followed by /dockyard status and /dockyard models <provider>.
Claude uses claude auth login --claudeai and claude auth status --json. Cursor prefers cursor-agent login, cursor-agent status, and its official streaming interface, with Cursor.app active-session discovery as a fallback. Antigravity discovers the official local session and uses an irreversible local session fingerprint when the official CLI does not return an email. Grok uses grok login --oauth, grok models, and streaming JSON with a short-lived official CLI profile.
Claude and Cursor generally expose only the current official active session rather than a portable multi-account credential API. Dockyard does not pretend that a stale session descriptor is another usable account; re-authorize the desired account in the official environment, then scan and refresh it.
127.0.0.1 by default. Remote binding requires both DOCKYARD_DSH_ALLOW_REMOTE=1 and DOCKYARD_DSH_REMOTE_TOKEN, plus Authorization: Bearer ... on remote API calls.unknown/null.SECURITY.md before filing issues. Never commit tokens, OAuth files, Keychain values, or sensitive logs.npm run dev
open http://127.0.0.1:8787/
This page is an optional diagnostic surface. It reads the same runtime as the DSH commands and is not a second account, model, or quota data source.
npm install
npm test
npm run build
npm run build:plugin
npm pack --dry-run
The distributable entry points are:
packages/dsh-plugin/dist/index.mjs # Node/host bundle
packages/dsh-plugin/lib/client.js # browser client bundle
packages/dsh-plugin/cordis.patch.yml # DSH bundle layer
After changing provider source, run npm run build and commit the refreshed artifacts together with the source change.
packages/core/ lifecycle, contracts, events, and DSH routes
packages/account-pool/ account discovery, selection, health, and references
packages/runtime/ the shared Dockyard runtime
packages/dsh-plugin/ DSH bundle, LLM adapter, commands, and client UI
packages/vault/ macOS Keychain backend
modules/provider-*/ provider OAuth, catalog, quota, and native transport
apps/local-page/ optional loopback diagnostic page
tests/ security, lifecycle, provider, and runtime tests
The core rule is simple: provider-specific logic stays in provider modules, account selection stays in the runtime, and hosts consume stable contracts. Do not add provider-specific branches to a host or hard-code dynamic provider data.
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。