dsh-oauth-mcp-client:DeepSeek Harness 的 OAuth 2.1 MCP 客戶端插件

前言

DSH 採用插件方式擴展能力;插件目錄頁屬於獨立社區站點,與 DeepSeek、幻方沒有官方從屬關係。

給 DSH 接入需要登錄態的外部 MCP 服務時,通常會遇到幾個問題:OAuth 2.1 授權、動態客戶端註冊、瀏覽器回調、令牌保存、斷線重連,以及 MCP 工具發現、註冊和執行。dsh-oauth-mcp-client 是面向這些問題提供的客戶端插件,內置了連接 Springbrand 生產 MCP Gateway 的配置。

這是什麼

springbrand-lab 維護的 @dsh-external/dsh-oauth-mcp-clientpackage.json 中的版本是 0.1.0,許可證爲 MIT。

它是一句定位清晰的 DSH 客戶端插件:OAuth 2.1 Streamable HTTP MCP client plugin for DeepSeek Harness。

已覈實的關鍵信息包括:

  • OAuth state 通過 DSH credential service 存儲,不存儲在這個倉庫中。
  • 內置配置連接 Springbrand 生產 MCP Gateway,默認 serverNamespringbrand,URL 是 https://connector.springbrand.ai/mcp
  • src/connection.tssrc/tools.ts 改編自 DeepSeek Harness 的 @deepseek-ai/dsh-mcp-client,許可證爲 MIT。

核心功能

下面這些能力來自已覈實資料:

  • OAuth 2.1 authorization code flow with PKCE
  • Dynamic OAuth client registration
  • Browser login with a loopback callback
  • Token and client metadata storage through the DSH credential service
  • Streamable HTTP transport with automatic reconnects
  • MCP tool discovery, registration, and execution
  • DSH Web connection management with live status and capability discovery
  • One-click persistent connection setup followed by browser OAuth

將插件 bundle 加入 DSH profile 後,會同時添加內置的 Springbrand MCP connection;不需要再單獨執行 MCP 註冊步驟。

安裝與啓用

先準備運行環境:

  • Node.js 22.19 or later
  • Git
  • A browser for the first OAuth login

該倉庫沒有發佈到 npm,當前安裝使用本地 checkout。

第一步,克隆倉庫並完成本地構建:

git clone https://github.com/springbrand-lab/dsh-oauth-mcp-client.git
cd dsh-oauth-mcp-client
corepack enable
pnpm install
pnpm build

第二步,把本地插件安裝到 DSH 的 web profile,並啓動 DSH Web:

PLUGIN_DIR="$PWD"
npx --yes @deepseek-ai/dsh@latest plugin --profile web add "$PLUGIN_DIR"
npx --yes @deepseek-ai/dsh@latest web

首次啓動會打開瀏覽器完成 Springbrand 登錄和 OAuth 授權。授權完成後,打開 Settings → Plugins → MCP Connections,可以看到連接狀態和已註冊能力。

典型用法

下面是一個可以直接對 agent 使用的請求:

Search the Springbrand marketplace for resources and list the first 10.

也可以通過內置工具驗證連接狀態:

mcp__springbrand__search_capabilities
mcp__springbrand__execute_capability

調用 mcp__springbrand__execute_capability 時,需要使用 mcp__springbrand__search_capabilities 返回的完整名稱,例如:

platform:springbrand@0:springbrand.resources.list

不要把它替換成較短的 action_id,例如:

springbrand.resources.list

在 DSH Web 中也可以管理連接:打開 Settings → Plugins → MCP Connections,輸入唯一的 server name 和服務器的 HTTPS MCP URL,然後選擇 Add and sign in,在打開的瀏覽器中完成 OAuth 流程。

這個操作會把連接寫入持久配置:

~/.dsh/profiles/web/cordis.patch.yml

重啓 DSH 後連接仍然保留;這裏沒有臨時 --patch 命令。

內置默認配置

已覈實的內置默認值包括:

  • serverNamespringbrand
  • urlhttps://connector.springbrand.ai/mcp
  • credentialRefSPRINGBRAND_MCP_OAUTH_PRODUCTION
  • callbackPort0
  • authorizationTimeoutMs300000
  • toolCallTimeoutMs60000
  • failOnStartupErrortrue
  • reconnect:enabled

其中 callbackPort0 表示選擇空閒端口;callback listener 綁定到本地 loopback interface。

適用場景與注意

這個插件適合需要讓 DSH 通過 OAuth 2.1 連接外部 Streamable HTTP MCP 服務,或需要接入 Springbrand 生產 MCP Gateway 的場景。

安裝和使用時需要注意:

  • 插件以當前 dsh 進程權限運行;安裝前建議檢查源碼、依賴和許可證。
  • OAuth state 通過 DSH credential service 存儲,不在這個倉庫中。
  • 不要手動配置 Authorization header;OAuth client 負責它。
  • 不要提交 access token、refresh token 或導出的 credential data。
  • 許可證爲 MIT;src/connection.tssrc/tools.ts 基於 MIT License 從 @deepseek-ai/dsh-mcp-client 改編而來。

鏈接

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

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

小夜