One-click OAuth (PKCE) connect to Qichacha (qcc.com) MCP services in DeepSeek Harness: dynamic client registration, token auto-refresh, and dynamic mcp-client configuration.
Install
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:duhu2000/qcc-mcp-oauth
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time. Only install sources you trust, and pin a commit (github:owner/repo#sha).
README
One-click OAuth connect to 企查查 (Qichacha) MCP services inside DeepSeek Harness. 在 DeepSeek Harness 中一键 OAuth 授权接入企查查 MCP 数据(工商 / 风险 / 知产 / 经营 / 董监高)。
功能 / Features
- 🔑 一键 OAuth 连接:
Authorization Code + PKCE(S256),动态注册客户端(无 client_secret),自动打开浏览器跳转企查查授权页,loopback 回调自动完成 - 🌐 一次授权、全 Server 可用:一份
access_token/refresh_token覆盖企查查 OAuth 集合内全部 MCP Server(company / risk / ipr / operation / executive) - 🔄 自动刷新:access_token 过期前自动 refresh(token 轮换),失败才需要重新授权
- 💾 安全持久化:token 存储于 DSH 存储域(
~/.dsh/storages,目录 0700),重启 Host 自动恢复连接 - 🛠 对话即管理:内置
qcc_oauth_connect/qcc_oauth_status/qcc_oauth_disconnect三个工具 - 🚪 一键断开:调用 OAuth revoke 撤销 refresh_token 并停用 MCP 工具
安装 / Install
前置:DeepSeek Harness(dsh CLI,web profile),Node ≥ 20。
🤖 让 Agent 安装(最省事,推荐给不熟悉命令行的用户)
把下面的链接直接发给你的 DeepSeek Harness 对话(或使用 dsh-plugin-marketplace 安装失败后出现的 「让 Agent 安装」 按钮):
帮我安装这个插件 https://github.com/duhu2000/qcc-mcp-oauth
Agent 会按本 README 执行以下命令(你也可以自己跑):
# 方式一:一键脚本(自动安装 + 注册 bundle + 提示重启)
bash <(curl -fsSL https://raw.githubusercontent.com/duhu2000/qcc-mcp-oauth/main/install.sh)
# 方式二:手动两步
dsh plugin --profile web add qcc-dsh-mcp-oauth # 安装依赖并自动注册 bundle
# 重启 dsh web
说明:安装时的
peer dependencies警告可忽略——@deepseek-ai/*等对等依赖由 DSH web profile 自带(host 依赖),无需另行安装;安装完成后必须重启 dsh web 才能生效。
方式 A:npm 安装
# 1. 安装插件到 profile(声明了 dsh.bundle 的包会被 dsh plugin add 自动注册到 bundles)
dsh plugin --profile web add qcc-dsh-mcp-oauth
# 2. 重启 dsh web
若未自动注册:手动在 ~/.dsh/profiles/web/package.json 的
dsh.profile.bundles追加"qcc-dsh-mcp-oauth"(与@deepseek-ai/dsh-base、@deepseek-ai/dsh-web-app并列),再重启。
方式 B:GitHub 直装
dsh plugin --profile web add github:duhu2000/qcc-mcp-oauth
# 再重启 dsh web
方式 C:源码 / 本地调试
git clone https://github.com/duhu2000/qcc-mcp-oauth.git
cd qcc-mcp-oauth
dsh plugin --profile web add "link:$(pwd)" # 或 pnpm add "file:$(pwd)"
# 再重启 dsh web
插件包内自带
cordis.patch.yml(bundle patch);dsh plugin add自动完成依赖安装与 bundles 注册,插件行自动合入,无需手改任何文件。
使用 / Usage
重启后,插件会自动发起 OAuth 授权(默认开启,激活且无有效授权时自动打开企查查授权页);如未自动触发,在对话中输入:
| 你说 | 效果 |
|---|---|
| "连接企查查" | 触发 qcc_oauth_connect:自动打开浏览器跳转企查查授权页,登录授权后自动完成连接 |
| "查一下企查查连接状态" | 触发 qcc_oauth_status:显示授权状态、token 过期时间、覆盖的 MCP Server |
| "断开企查查" | 触发 qcc_oauth_disconnect:撤销 refresh_token、清除本地授权、停用工具 |
连接成功后,以下工具直接可用(示例):
mcp__qcc-company__get_company_registration_info/get_actual_controller/ ...mcp__qcc-risk__get_company_risk_scan/get_dishonest_info/ ...mcp__qcc-ipr__*、mcp__qcc-operation__*、mcp__qcc-executive__*
原理 / How it works
严格遵循《企查查MCP OAuth 接入文档》(Authorization Code + PKCE,公开接口版):
- 发现 MCP Protected Resource Metadata → 2. 发现 OAuth Server Metadata(endpoint 全部动态读取,不硬编码)
- 动态注册客户端(
client_id,90 天自动续期)→ 4. 打开授权页(scope=mcp:tools) - loopback 回调校验
state→ 6. 授权码 +code_verifier换 token - 通过
ctx.loader为 5 个@deepseek-ai/dsh-mcp-client条目注入 Bearer header → 8. 过期前自动刷新(轮换)
详见 docs/OAUTH-IMPLEMENTATION.md。
配置 / Configuration
插件行位于 ~/.dsh/profiles/web/cordis.patch.yml(bundle 合入后可见):
- id: qcc-mcp-oauth
name: 'qcc-dsh-mcp-oauth'
config:
issuer: 'https://agent.qcc.com' # OAuth 授权服务器
clientName: 'DeepSeek Harness - QCC MCP' # 授权页展示名
refreshSkewMs: 300000 # 过期前提前刷新(ms)
openBrowser: true # 自动打开浏览器(false = 仅打印授权 URL)
autoConnectOnActivate: true # 激活且无授权时自动打开授权页(false = 手动触发)
persistTokens: true # 持久化 token(false = 仅内存)
mcpEntryPrefix: 'mcp-qcc' # 受管 mcp-client 条目 id 前缀
安全说明 / Security
- token 只写入
~/.dsh/storages(0700),不进入 git、不进入对话历史 - 连接期间
loader会把条目配置写回 profile 配置文件(含 token),建议:chmod 600 ~/.dsh/profiles/web/cordis.yml;不要把~/.dsh加入任何仓库 - Bearer token 仅发送给授权集合内的精确 resource URL
- 断开时调用 revoke 撤销 refresh_token
- 如需彻底移除:
qcc_oauth_disconnect后从 bundles 移除包名并dsh plugin --profile web remove qcc-dsh-mcp-oauth
已知限制 / Limitations
- 企查查 OAuth 集合当前为 5 个 resource(company/risk/ipr/operation/executive);history / legal-regulation / legal-case / tender 不在文档集合内(如有需要请与企查查确认后扩展
resources配置) - 第三方插件无法注册 DSH 设置页卡片(apiproxy allowlist 限制),管理入口为对话工具
- 回调使用本地 loopback 地址,适用于桌面端;SaaS/Web 回调地址需提前与企查查确认白名单
开发 / Development
npm install # 需要 host 依赖时(见 docs/INSTALL.md)
npm run lint # 语法检查
npm test # 单元 + 集成测试(含 mock OAuth 服务器全流程)
测试覆盖:PKCE、元数据发现、动态注册、完整授权码流程(loopback)、refresh 轮换、revoke、 插件级集成(连接/幂等/自动刷新/断开/重启恢复)。
License
MIT
Links
More in this category
superdesigndev/treg★ 428
Tool catalog for agents: search ~2,600 external endpoints (SEO and SERP, backlinks, social, people and company enrichment, ad libraries, scraping) by the task you want done, read each one's parameters and per-call price, then call it with the credential injected server-side. Ships the skill plus an MCP row that stays disabled until TREG_TOKEN is set.
Lum1104/dsh-browser★ 216
Chrome sidebar extension that lets DSH operate your browser directly, no vision capabilities required.
zhaoolee/notes★ 142
Export DSH conversations as Smartisan Notes-style PNGs, or create and update Markdown notes in a configured account-scoped workspace.
liustack/modsearch★ 115
Web search bridge for text-only agents: ask the web or X, get structured JSON evidence (search, fetch, citations).
taxueseek/argo★ 94
Search built for agents: multilingual coverage across web, academic, code, shopping, finance, news, and encyclopedias.
Vladimir-Human/ru-marketplace-mcp#dsh★ 64
Skills and optional MCP rows for ten Russian marketplaces: price comparison across Wildberries, Detsky Mir and Yandex Market, plus per-source search, product cards and reviews. The 13 skills load on install; both MCP rows stay disabled until RU_MARKETPLACE_MCP_DIR points at a local clone, which needs Python 3.12+ and uv.