@noob9527/dsh-mcp-oauth 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/CONTRIBUTING.md +22 -0
- package/LICENSE +21 -0
- package/README.md +106 -2
- package/README.zh.md +87 -0
- package/SECURITY.md +11 -0
- package/cordis.patch.yml +3 -0
- package/docs/acceptance.md +93 -0
- package/docs/releasing.md +37 -0
- package/lib/client.js +20209 -0
- package/lib/index.js +779 -0
- package/lib/types/callback.d.ts +10 -0
- package/lib/types/client/index.d.ts +9 -0
- package/lib/types/client/locales.d.ts +55 -0
- package/lib/types/config.d.ts +73 -0
- package/lib/types/connection.d.ts +27 -0
- package/lib/types/errors.d.ts +6 -0
- package/lib/types/index.d.ts +38 -0
- package/lib/types/provider.d.ts +80 -0
- package/lib/types/remote.d.ts +1 -0
- package/package.json +106 -3
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.1.0 — 2026-11-16
|
|
4
|
+
|
|
5
|
+
- Public npm identity: `@noob9527/dsh-mcp-oauth`, including scoped Host and Client module registration.
|
|
6
|
+
|
|
7
|
+
- Standalone Host/Client plugin targeting unmodified DSH 0.2.2-rc.2.
|
|
8
|
+
- Streamable HTTP tools with OAuth Authorization Code + PKCE, CIMD, pre-registration and DCR.
|
|
9
|
+
- Profile/service credential isolation, refresh rotation, cancellation and bounded connection recovery.
|
|
10
|
+
- Service settings with English and Chinese labels.
|
|
11
|
+
- Deterministic local OAuth/MCP and HTTPS metadata fixtures; Web acceptance and failure matrix.
|
|
12
|
+
|
|
13
|
+
Initial preview release. Desktop qualification remains pending.
|
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
Use Node 24.9 or newer, pnpm 12.5.1, Git and OpenSSL with `req -addext`. Install dependencies with `pnpm install --frozen-lockfile --ignore-scripts`.
|
|
4
|
+
|
|
5
|
+
Before a pull request:
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
pnpm run check:release
|
|
9
|
+
pnpm run typecheck
|
|
10
|
+
pnpm test
|
|
11
|
+
pnpm run build
|
|
12
|
+
pnpm pack --pack-destination artifacts
|
|
13
|
+
node scripts/check-release.mjs --tarball artifacts/noob9527-dsh-mcp-oauth-0.1.0.tgz
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Describe the user-visible behavior, relevant tests and compatibility impact. Add regression tests for changes to authorization, refresh, retries or teardown. Use loopback fixtures, atomic port allocation and explicit lifecycle cleanup. Do not weaken TLS verification, log credentials or silently retry tools with unknown outcomes.
|
|
17
|
+
|
|
18
|
+
Keep the plugin independent of DSH source workspaces and internal imports. Update both README languages for user-facing behavior changes. Do not broaden the supported DSH version without a packed-plugin installation test on the corresponding unmodified release.
|
|
19
|
+
|
|
20
|
+
Use reserved example domains and repository-owned fixtures. Do not commit organization-specific services, .env files, tokens, authorization codes, callback URLs containing state, credentials files, personal paths, or unreviewed recordings. See [SECURITY.md](SECURITY.md) for sensitive reports. The release check is a limited hygiene check, not a comprehensive secret scanner.
|
|
21
|
+
|
|
22
|
+
[Official-client acceptance](docs/acceptance.md) requires a local model key supplied outside the repository. Report browser, protocol and Desktop evidence separately. A PR does not need to publish a package or a GitHub Release.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 dsh-mcp-oauth contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,107 @@
|
|
|
1
|
-
#
|
|
1
|
+
# DSH MCP OAuth
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
OAuth-protected MCP tools for an unmodified DeepSeek Harness installation. The plugin owns its MCP connections and uses the official tool registry, credential store, authorization service and plugin-page extension.
|
|
4
|
+
|
|
5
|
+
[中文](README.zh.md)
|
|
6
|
+
|
|
7
|
+
## Status and compatibility
|
|
8
|
+
|
|
9
|
+
Independent community plugin; not an official DeepSeek product. Version 0.1.0 is an initial preview.
|
|
10
|
+
|
|
11
|
+
| Surface | Status |
|
|
12
|
+
| --- | --- |
|
|
13
|
+
| Official DSH 0.2.2-rc.2 Web, local macOS | Browser OAuth and real chat tool calls verified |
|
|
14
|
+
| Official Desktop | Intended scope; acceptance pending |
|
|
15
|
+
| Other DSH versions | Not declared compatible |
|
|
16
|
+
| Remote or shared multi-user DSH | Not supported |
|
|
17
|
+
|
|
18
|
+
## Install from npm
|
|
19
|
+
|
|
20
|
+
The public package name is `@noob9527/dsh-mcp-oauth`. Install the preview release:
|
|
21
|
+
|
|
22
|
+
```sh
|
|
23
|
+
dsh plugin --profile web add @noob9527/dsh-mcp-oauth@0.1.0
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
The unscoped `dsh-mcp-oauth` package is a different project. When migrating a local unscoped installation, remove its plugin entry before installing this package; do not enable both together. Use the same DSH profile and home to retain locally stored service settings and grants.
|
|
27
|
+
|
|
28
|
+
## Install from source
|
|
29
|
+
|
|
30
|
+
Requires Node **24.9+**, pnpm **12.5.1**, and an unmodified official DSH **0.2.2-rc.2** installation. Clone this repository and run these commands from its directory:
|
|
31
|
+
|
|
32
|
+
```sh
|
|
33
|
+
pnpm install --frozen-lockfile --ignore-scripts
|
|
34
|
+
pnpm run typecheck
|
|
35
|
+
pnpm test
|
|
36
|
+
pnpm pack --pack-destination artifacts
|
|
37
|
+
dsh plugin --profile web add "$(pwd)/artifacts/noob9527-dsh-mcp-oauth-0.1.0.tgz"
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Tests require OpenSSL supporting `req -addext`. No model API key or business MCP endpoint is needed for automated tests. Restart DSH when prompted. If DSH uses a custom `DSH_HOME`, use the same value for plugin installation and startup. The package-name install command becomes available only after a maintainer publishes to your configured registry; GitHub source publication alone does not publish an npm package.
|
|
41
|
+
|
|
42
|
+
Desktop has a separate profile; installation and OAuth behavior there are not yet qualified.
|
|
43
|
+
|
|
44
|
+
Open **Plugins → Built-in plugin settings → OAuth MCP → Add service** (the current public DSH slot places this settings entry in that group). Enter the service URL and registration settings, save, click **Sign in**, then **Open authorization page**. Approve in the browser on the computer running DSH. The callback page only confirms receipt; the DSH page separately displays authorization and connection completion. Tools become available to normal chat once connected.
|
|
45
|
+
|
|
46
|
+
## Configuration
|
|
47
|
+
|
|
48
|
+
The initial service list is empty. A placeholder endpoint is `https://mcp.example.com/mcp`; it is not a live service.
|
|
49
|
+
|
|
50
|
+
| Setting | Meaning |
|
|
51
|
+
| --- | --- |
|
|
52
|
+
| Service ID | Stable lower-case identifier; namespaces tools and credentials |
|
|
53
|
+
| Registration mode | Automatic, CIMD, pre-registered or DCR |
|
|
54
|
+
| Client metadata document URL | Public HTTPS CIMD document maintained by the client operator |
|
|
55
|
+
| Client ID / secret | Pre-registered identity; the secret is stored separately |
|
|
56
|
+
| Callback URL | Defaults to `http://127.0.0.1:6274/oauth/callback`; must match permitted redirects |
|
|
57
|
+
| Scopes | Optional space-separated scope names |
|
|
58
|
+
|
|
59
|
+
Automatic mode uses configured pre-registration first, then CIMD when configured and supported, then dynamic registration. Explicit CIMD fails when unsupported. The plugin does not host a public CIMD document. Configure its redirect URI before login; the plugin does not silently select another port if the configured port is occupied.
|
|
60
|
+
|
|
61
|
+
Advanced defaults: connection timeout 30 seconds, sign-in timeout 5 minutes, tool deadline 10 minutes, refresh lead time 60 seconds, 5 reconnect attempts with a maximum delay of 30 seconds. Tool deadlines are total deadlines, not progress-reset timers.
|
|
62
|
+
|
|
63
|
+
## Credentials and lifecycle
|
|
64
|
+
|
|
65
|
+
Service configuration is stored in the active profile's `mcp-oauth/servers.json`. Grants are stored through DSH credentials, with keys derived from the canonical profile directory and service ID. The default DSH store is a local credential file, not an OS keychain. A service's URL, registration mode, client identity, scopes and callback bind its credentials; changing them requires new authorization.
|
|
66
|
+
|
|
67
|
+
Client secrets, access tokens and refresh tokens are not returned to the UI or written to service configuration. PKCE verifiers and state remain in memory during authorization. One running DSH process per profile is supported; concurrent processes sharing a profile are not a token-refresh coordination mechanism.
|
|
68
|
+
|
|
69
|
+
Disabling preserves authorization. Clearing authorization disconnects and deletes the local grant. Deleting removes both the configuration and its grant. These actions do not claim server-side revocation. Uninstalling the package leaves local persisted data; clear grants and delete services first if you want to remove that data.
|
|
70
|
+
|
|
71
|
+
Requests refresh an expiring token when possible. Concurrent refresh work is coalesced; a 401 permits one SDK authentication retry. Refresh alone does not interrupt accepted calls. Network failures and tool timeouts never cause automatic replay; an unknown outcome must be checked before manually repeating a state-changing tool.
|
|
72
|
+
|
|
73
|
+
Only local Web and Desktop are in scope. No remote-host browser callbacks, legacy SSE/stdio transports, MCP Tasks, resource browsing or prompt browsing are provided.
|
|
74
|
+
|
|
75
|
+
## Development and validation
|
|
76
|
+
|
|
77
|
+
```sh
|
|
78
|
+
pnpm install --frozen-lockfile --ignore-scripts
|
|
79
|
+
pnpm run typecheck
|
|
80
|
+
pnpm test
|
|
81
|
+
pnpm run build
|
|
82
|
+
pnpm pack
|
|
83
|
+
pnpm exec tsx tests/serve-fixture.ts
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Tests run deterministic OAuth/MCP and HTTPS metadata servers on loopback. CIMD authorization fetches and validates the actual metadata document, including client identity and redirect URI, before consent. OpenSSL generates a temporary per-run certificate trusted only by the test authorization server; TLS verification remains enabled. Run `pnpm exec tsx tests/serve-cimd.ts` for browser acceptance. This local test does not certify public hosting or a third-party authorization server.
|
|
87
|
+
|
|
88
|
+
See [acceptance](docs/acceptance.md) for the official-client workflow and current verification status. Protocol tests are not a substitute for actual chat invocation.
|
|
89
|
+
|
|
90
|
+
## Troubleshooting
|
|
91
|
+
|
|
92
|
+
- `OAUTH_CALLBACK_UNAVAILABLE`: free the configured loopback port, or configure a different redirect permitted by your client metadata.
|
|
93
|
+
- `OAUTH_CIMD_UNSUPPORTED`: choose a registration method supported by the authorization server.
|
|
94
|
+
- `OAUTH_ISSUER_CHANGED`: verify the server's issuer and clear the old authorization before logging in again.
|
|
95
|
+
- `OAUTH_LOGIN_REQUIRED`: refresh is unavailable or rejected; sign in again.
|
|
96
|
+
- `MCP_CALL_OUTCOME_UNKNOWN`: inspect the operation on the server before retrying it.
|
|
97
|
+
- `OAUTH_CONFIG_UNREADABLE`: repair the profile configuration file; the plugin does not discard unreadable configuration.
|
|
98
|
+
|
|
99
|
+
## Contributing and releases
|
|
100
|
+
|
|
101
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for development, [SECURITY.md](SECURITY.md) for sensitive reports, and [the release guide](docs/releasing.md) for publishing source or packages. GitHub CI checks, tests and builds the project without model credentials; a green CI run does not replace Desktop or real-chat acceptance.
|
|
102
|
+
|
|
103
|
+
Authentication recovery failure withdraws the affected service’s tools and requires sign-in. A lost response or timeout reports an unknown outcome and never automatically replays tools/call; reconnect only reinitializes the connection and discovers tools. Closing a connection rejects new calls and drains admitted work. See the [failure acceptance matrix](docs/acceptance.md#high--and-medium-priority-failure-acceptance) for automated versus browser evidence.
|
|
104
|
+
|
|
105
|
+
## License
|
|
106
|
+
|
|
107
|
+
[MIT](LICENSE). Dependencies retain their own licenses.
|
package/README.zh.md
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# DSH MCP OAuth
|
|
2
|
+
|
|
3
|
+
为未经修改的官方 DeepSeek Harness 提供 OAuth MCP 工具接入。插件自行管理 MCP 连接,通过官方工具、凭据、授权及插件页面接口集成。
|
|
4
|
+
|
|
5
|
+
[English](README.md)
|
|
6
|
+
|
|
7
|
+
## 状态与兼容性
|
|
8
|
+
|
|
9
|
+
本项目是独立社区插件,并非 DeepSeek 官方产品。0.1.0 为初始预览版。
|
|
10
|
+
|
|
11
|
+
| 客户端 | 验证状态 |
|
|
12
|
+
| --- | --- |
|
|
13
|
+
| 官方 DSH 0.2.2-rc.2 Web,本机 macOS | 已验证浏览器授权和真实聊天调用 |
|
|
14
|
+
| 官方 Desktop | 计划支持,尚待验收 |
|
|
15
|
+
| 其他 DSH 版本 | 未声明兼容 |
|
|
16
|
+
| 远程或多人共享 DSH | 不支持 |
|
|
17
|
+
|
|
18
|
+
## 从 npm 安装
|
|
19
|
+
|
|
20
|
+
公开包名为 `@noob9527/dsh-mcp-oauth`。安装预览版:
|
|
21
|
+
|
|
22
|
+
```sh
|
|
23
|
+
dsh plugin --profile web add @noob9527/dsh-mcp-oauth@0.1.0
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
无 scope 的 `dsh-mcp-oauth` 属于其他项目。从本地旧包迁移时,先移除旧插件条目,再安装新包,不要同时启用两者。使用相同 DSH profile 和 home,以保留本机服务配置和授权记录。
|
|
27
|
+
|
|
28
|
+
## 从源码安装与登录
|
|
29
|
+
|
|
30
|
+
需要 Node **24.9+**、pnpm **12.5.1**,以及未经修改的官方 DSH **0.2.2-rc.2**。克隆本仓库后,在仓库目录运行:
|
|
31
|
+
|
|
32
|
+
```sh
|
|
33
|
+
pnpm install --frozen-lockfile --ignore-scripts
|
|
34
|
+
pnpm run typecheck
|
|
35
|
+
pnpm test
|
|
36
|
+
pnpm pack --pack-destination artifacts
|
|
37
|
+
dsh plugin --profile web add "$(pwd)/artifacts/noob9527-dsh-mcp-oauth-0.1.0.tgz"
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
测试需要支持 `req -addext` 的 OpenSSL;自动化测试不需要模型 API Key 或业务 MCP 服务。DSH 提示需要重启时,重启后继续。如果使用自定义 `DSH_HOME`,安装插件和启动 DSH 时必须使用相同值。只有维护者将包发布到你配置的 registry 后,才能按包名安装;将源码发布到 GitHub 不会自动发布 npm 包。
|
|
41
|
+
|
|
42
|
+
Desktop 使用独立 profile,目前尚未完成其安装和 OAuth 验收。
|
|
43
|
+
|
|
44
|
+
进入“Plugins → Built-in plugin settings → OAuth MCP”(当前官方扩展位把设置入口放在这个分组中),添加服务、保存并点击“登录”,随后打开授权页面。浏览器必须运行在 DSH 所在的电脑上。回调页只确认已收到授权响应;最终授权状态和工具连接状态分别显示在 DSH 中。
|
|
45
|
+
|
|
46
|
+
## 配置
|
|
47
|
+
|
|
48
|
+
默认服务列表为空。文档中的 `https://mcp.example.com/mcp` 仅为占位地址。
|
|
49
|
+
|
|
50
|
+
- 自动模式优先使用已配置的预注册身份,其次使用服务端支持的 CIMD,最后尝试 DCR。
|
|
51
|
+
- CIMD 文档需由客户端运营者托管在 HTTPS 地址;本插件不提供公共文档托管。
|
|
52
|
+
- 默认回调为 `http://127.0.0.1:6274/oauth/callback`,必须与客户端允许的回调一致。端口占用时不会自动换端口。
|
|
53
|
+
- 客户端密钥单独保存;编辑表单留空表示保留已有值。清除授权会删除包含密钥的本机授权记录。
|
|
54
|
+
- 高级设置默认:连接超时 30 秒、授权超时 5 分钟、工具总时限 10 分钟、提前 60 秒刷新、最多重连 5 次且间隔不超过 30 秒。
|
|
55
|
+
|
|
56
|
+
## 凭据与失败处理
|
|
57
|
+
|
|
58
|
+
服务配置保存在当前 profile 的 `mcp-oauth/servers.json`。授权信息通过 DSH 凭据服务保存,按 profile 的真实目录和服务标识区分。默认存储为本地文件,不是系统钥匙串。修改服务地址、客户端身份、权限范围或回调配置后需要重新授权。
|
|
59
|
+
|
|
60
|
+
停用保留凭据;清除授权断开连接并删除本机凭据;删除服务同时删除配置和凭据。这些操作不代表已在授权服务器撤销 token。卸载包保留持久化数据,如需清理,请先清除授权并删除服务。首版不支持多个 DSH 进程同时使用同一 profile。
|
|
61
|
+
|
|
62
|
+
刷新 token 不主动中断已受理的长调用。HTTP 401 最多触发一次 SDK 认证后重发;断线或超时不会自动重放工具调用。出现“结果未知”时,先核查服务端执行情况,再决定是否重试。
|
|
63
|
+
|
|
64
|
+
首版只支持本机 Web/Desktop,不支持远程回调、旧版 SSE/stdio、MCP Tasks、资源浏览和提示词浏览。
|
|
65
|
+
|
|
66
|
+
## 开发与验收
|
|
67
|
+
|
|
68
|
+
```sh
|
|
69
|
+
pnpm install --frozen-lockfile --ignore-scripts
|
|
70
|
+
pnpm run typecheck
|
|
71
|
+
pnpm test
|
|
72
|
+
pnpm run build
|
|
73
|
+
pnpm pack
|
|
74
|
+
pnpm exec tsx tests/serve-fixture.ts
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
本地测试服务提供确定性搜索、延迟返回和调用计数。CIMD 测试启动独立 HTTPS 文档服务,授权服务器在同意授权前实际抓取并校验客户端身份和回调地址。OpenSSL 为每次测试生成临时证书,仅测试授权服务器显式信任,TLS 校验保持开启。运行 `pnpm exec tsx tests/serve-cimd.ts` 可进行浏览器验收;这不代表验证了公网托管或第三方授权服务器。官方客户端验收步骤和已完成项目见 [验收说明](docs/acceptance.md)。
|
|
78
|
+
|
|
79
|
+
## 贡献与发布
|
|
80
|
+
|
|
81
|
+
开发流程见 [CONTRIBUTING.md](CONTRIBUTING.md),敏感问题报告见 [SECURITY.md](SECURITY.md),源码与包的发布步骤见[发布指南](docs/releasing.md)。GitHub CI 不需要模型凭据;CI 通过不代表完成 Desktop 或真实聊天验收。
|
|
82
|
+
|
|
83
|
+
认证恢复失败会注销受影响服务的工具并提示重新登录。响应丢失或超时会报告结果未知,不会自动重放 tools/call;重连仅重新初始化连接和发现工具。关闭连接会拒绝新调用并等待已受理工作结束。[故障验收矩阵](docs/acceptance.md#high--and-medium-priority-failure-acceptance)区分自动化测试与真实页面证据。
|
|
84
|
+
|
|
85
|
+
## 许可证
|
|
86
|
+
|
|
87
|
+
[MIT](LICENSE)。依赖保留各自的许可证。
|
package/SECURITY.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Security
|
|
2
|
+
|
|
3
|
+
This preview integrates OAuth credentials and external tools. Only DSH 0.2.2-rc.2 is currently targeted; Desktop acceptance is pending. See the README for deployment limitations.
|
|
4
|
+
|
|
5
|
+
Do not put tokens, client secrets, authorization codes, credential files or unsanitized logs in public issues or pull requests.
|
|
6
|
+
|
|
7
|
+
If the repository's Security tab provides **Report a vulnerability**, use that private channel. If it is unavailable, open a public issue requesting a private contact channel without vulnerability details. Do not disclose exploit instructions or credentials while waiting for a private channel. There is no guaranteed response-time commitment.
|
|
8
|
+
|
|
9
|
+
For an exposed credential, revoke or rotate it at its issuer. Clearing local plugin authorization does not revoke it at the server.
|
|
10
|
+
|
|
11
|
+
The maintainer should enable GitHub private vulnerability reporting before making the repository public. Reports should identify the plugin and DSH versions, deployment type, impact, and a reproduction using synthetic credentials and local fixtures.
|
package/cordis.patch.yml
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# Official-client acceptance
|
|
2
|
+
|
|
3
|
+
Use an isolated `DSH_HOME` and an unmodified npm installation of DSH 0.2.2-rc.2. Never use source overlays or workspace links as release evidence.
|
|
4
|
+
|
|
5
|
+
1. Run `pnpm pack`, then install the tarball with `dsh plugin --profile web add /absolute/path/to/dsh-mcp-oauth-0.1.0.tgz`.
|
|
6
|
+
2. Run `dsh web --no-open --port 3097` with the same isolated home. Open the exact URL printed by DSH; its local login token must not be recorded in screenshots or documentation.
|
|
7
|
+
3. Run `pnpm exec tsx tests/serve-fixture.ts`. Add its printed MCP endpoint in Plugins → OAuth MCP, use DCR and a free permitted loopback callback port.
|
|
8
|
+
4. Sign in, open the authorization page and approve. Verify that authorization succeeds, the connection becomes connected and two tools are listed.
|
|
9
|
+
5. Configure model credentials through DSH's own UI. Start a chat asking it to call the configured search tool with query `oauth`. Verify the tool card contains `document-1`; do not substitute a terminal SDK call for this step.
|
|
10
|
+
6. Restart DSH and verify another chat call succeeds without browser authorization.
|
|
11
|
+
7. Check cancellation, disabled state, clear authorization, failed login and disconnected state. Inspect light/dark themes and a narrow window.
|
|
12
|
+
8. Repeat installation and the interaction in the official Desktop app's separate profile.
|
|
13
|
+
|
|
14
|
+
The fixture contains no business environment or personal data. Do not record browser address bars containing authorization codes, access tokens or callback state. Actual model credentials must remain outside this repository.
|
|
15
|
+
|
|
16
|
+
## Evidence status
|
|
17
|
+
|
|
18
|
+
The automated protocol suite and actual client acceptance are separate evidence categories. The implementation session records executed checks in its delivery report; unexecuted model, Desktop and visual checks must not be described as passed.
|
|
19
|
+
|
|
20
|
+
## Local CIMD Web acceptance
|
|
21
|
+
|
|
22
|
+
Run `pnpm exec tsx tests/serve-cimd.ts` (requires OpenSSL with `req -addext` support). The command prints an MCP URL, HTTPS metadata document URL, loopback callback URL and read-only audit URL. Set `CIMD_CALLBACK_URL` before starting if the default callback port is unavailable. Use those exact values in Plugins → OAuth MCP → Add service, with a new service ID and explicit CIMD mode. Leave the pre-registered client ID and secret empty.
|
|
23
|
+
|
|
24
|
+
The metadata host owns a temporary certificate and key. Only the fixture authorization server trusts that certificate. Neither DSH nor the browser needs a trust override: the authorization server fetches the HTTPS document. The test server pins the permitted document URL, allowing its owned loopback endpoint only; it is not a production SSRF policy implementation. No global certificate store or TLS verification flag is changed.
|
|
25
|
+
|
|
26
|
+
Sign in, open the authorization page, approve, and wait for Authorized / Connected / Tools: 2. Ask the real DSH chat to invoke `mcp__cimd-test__search` once with query `cimd-e2e` (use service ID `cimd-test`). Inspect both the tool card and the audit endpoint. The audit endpoint exposes counters only, never tokens or authorization codes.
|
|
27
|
+
|
|
28
|
+
Observed on 2026-11-16 in the unmodified official DSH 0.2.2-rc.2 Web client, with installed plugin build6 tarball:
|
|
29
|
+
|
|
30
|
+
| Evidence | Observed |
|
|
31
|
+
| --- | --- |
|
|
32
|
+
| HTTPS metadata retrieval / validation | 1 / 1 |
|
|
33
|
+
| Authorization / authorization-code token exchange | 1 / 1 |
|
|
34
|
+
| DCR registration | 0 |
|
|
35
|
+
| Actual chat tool calls | 1 |
|
|
36
|
+
| Tool input | query = cimd-e2e |
|
|
37
|
+
| Tool output | document-1; OAuth MCP test document; query = cimd-e2e |
|
|
38
|
+
|
|
39
|
+
This exercises discovery, explicit CIMD client selection, actual HTTPS metadata retrieval and validation, browser consent, PKCE code exchange, authenticated MCP discovery and real-model tool execution. The document and authorization server are repository-owned test fixtures, not public hosting or a third-party identity provider. No production plugin code was changed for this CIMD verification; later uninstalled lifecycle changes are outside this browser evidence. Desktop CIMD acceptance remains pending.
|
|
40
|
+
|
|
41
|
+
The automated suite also rejects a metadata document with a mismatched client_id or redirect URI before consent and token exchange. Typechecking and all 18 tests passed after these fixture changes. The fixtures keep token state in memory: restarting the fixture requires fresh authorization.
|
|
42
|
+
|
|
43
|
+
## CIMD expiry, long call and process restart
|
|
44
|
+
|
|
45
|
+
Run `CIMD_TOKEN_SECONDS=10 CIMD_CALLBACK_URL=http://127.0.0.1:16277/oauth/callback pnpm exec tsx tests/serve-cimd.ts`. Add a separate `cimd-lifecycle` service in the official Web client using the printed endpoints and explicit CIMD mode. Set Advanced → Refresh lead time to 0 ms so this test exercises actual expiry rather than the default 60-second early refresh. This is a test setting, not a recommended production default.
|
|
46
|
+
|
|
47
|
+
Complete browser authorization once. From actual DSH chat call `mcp__cimd-lifecycle__delayed_echo` with message `cimd-long-survived-expiry` and delayMs 20000. Then call `mcp__cimd-lifecycle__search` with query `cimd-after-expiry`. Stop the DSH process and wait for it to exit; keep the fixture process alive. Start the same official DSH installation with the same DSH_HOME, reopen the newly printed Web login URL and call search with query `cimd-after-process-restart`. Do not sign in to the MCP service again.
|
|
48
|
+
|
|
49
|
+
Observed on 2026-11-16 with official DSH 0.2.2-rc.2 and installed plugin build6 (no product-code changes for this test):
|
|
50
|
+
|
|
51
|
+
| Stage | Refresh count | Tool execution count | Result |
|
|
52
|
+
| --- | --- | --- | --- |
|
|
53
|
+
| Initial authorization | 0 | 0 | Connected, two tools |
|
|
54
|
+
| Long tool completed | 1 | 1 | cimd-long-survived-expiry |
|
|
55
|
+
| Search after expiry | 2 | 2 | document-1, query cimd-after-expiry |
|
|
56
|
+
| DSH process restarted | 3 | 2 | Credentials loaded, automatic refresh |
|
|
57
|
+
| Chat search after restart | 4 | 3 | document-1, query cimd-after-process-restart |
|
|
58
|
+
|
|
59
|
+
The long call ran for 20,001 ms. Its bearer token expired 9,991 ms after acceptance; the result completed 10,010 ms after expiry. Refresh count remained 1 throughout that call, so refreshing did not interrupt or replay it. Each of the three requested tools executed once. Browser authorization and authorization-code exchange counts remained 1; metadata retrieval remained 1; DCR registration remained 0. The fourth refresh occurred because the short token issued during startup expired before the next chat call.
|
|
60
|
+
|
|
61
|
+
The fixture rotates and invalidates each consumed refresh token. Successful refresh after a real process restart therefore verifies that the rotated refresh token was persisted and reused. This verifies request-time expiry handling; it does not claim periodic background refresh or require every server to continue an accepted call after token expiry. The fixture deliberately allows accepted work to complete.
|
|
62
|
+
|
|
63
|
+
Evidence is stored locally in ignored `artifacts/evidence/cimd-lifecycle-*.json`, `dsh-cimd-long-call.png` and `dsh-cimd-after-restart.png`; JSON contains counters and timestamps, not tokens. The audit endpoint now includes token issuance/expiry and tool acceptance/completion events. The automatic suite includes CIMD concurrent refresh, rotated-grant reload and a deterministic clock-controlled long-call expiry case; typechecking and all 20 tests passed.
|
|
64
|
+
|
|
65
|
+
## High- and medium-priority failure acceptance
|
|
66
|
+
|
|
67
|
+
Verified on 2026-11-16 with unmodified official DSH 0.2.2-rc.2 Web and the new `dsh-mcp-oauth-0.1.0.tgz` from the failure-acceptance pack directory. This package replaces build6 for these checks. No official DSH files were modified.
|
|
68
|
+
|
|
69
|
+
| Scenario | Automated evidence | Real Web evidence |
|
|
70
|
+
| --- | --- | --- |
|
|
71
|
+
| Refresh token revoked | Login-required error, tools withdrawn, no interactive retry | Chat reports sign-in required; no tool executes or new consent opens |
|
|
72
|
+
| Early 401 | One refresh, one successful tool execution | Covered by automated bridge test |
|
|
73
|
+
| Repeated 401 | One refresh, then sign-in required and zero tools | Two rejected requests, one refresh, no tool execution; settings show sign-in required |
|
|
74
|
+
| Response lost after acceptance | Unknown outcome; reconnect without replay | One accepted call, two connection initializations; chat explicitly says result unknown |
|
|
75
|
+
| Disconnect during long work | Barrier-controlled accepted long call; one execution, reconnect | Response-loss case above; held long-work case is automated |
|
|
76
|
+
| Tool timeout | Unknown outcome; one execution | Automated only |
|
|
77
|
+
| User cancellation | Cancellation reaches server, no replay | Stop button sends one cancellation; delayed work has cancelledAt and no completedAt |
|
|
78
|
+
| Clear/disable/unload during login or refresh | Six controlled Host cases; no late credential restore, no remaining tools or callback listener | Automated only |
|
|
79
|
+
| Concurrent expiry | Eight actual tool calls share one refresh | Automated only |
|
|
80
|
+
| Multiple services | Credential/tool namespaces and failure isolation | Healthy service search succeeds while failed service requires login |
|
|
81
|
+
| Tool list changes | Real SSE notification; removed tools disappear; duplicate names never partially register | Settings count changes 2 → 3 → 1 |
|
|
82
|
+
| Reconnect budget and manual recovery | Two retries after initial failure, then stop; explicit reconnect recovers | Successful reconnect after response loss; exhaustion is automated |
|
|
83
|
+
| Configuration identity changes | URL, metadata identity, callback, scope, mode/client ID do not reuse mismatched grants | Automated only |
|
|
84
|
+
| Disable/enable/delete | Disable retains grant, enable restores tools without consent, delete removes grant and flow | Earlier enable/disable check plus current Host tests |
|
|
85
|
+
| Unload with an active call | Connection closes and drains in-flight work; no late tool registration | Automated only |
|
|
86
|
+
|
|
87
|
+
The fault fixture is started with `CIMD_CALLBACK_URL=http://127.0.0.1:16278/oauth/callback pnpm exec tsx tests/serve-cimd.ts`. Its optional `/test-control` route exists only in audit-enabled manual fixtures. POST a strict JSON object with selected flags (`dropCalls`, `rejectTokens`, `rejectOnce`, `refreshFails`, `failInitialize`) or `toolNames`. Requests with Origin or a content type other than application/json are rejected; the server listens only on loopback. These controls are test infrastructure and are not in the npm plugin package.
|
|
88
|
+
|
|
89
|
+
The browser sequence used `cimd-faults`: drop response, cancel a 60-second delayed call, reject every bearer token, manually sign in again, publish tool-list changes, reject one bearer request while refusing refresh, then call the separate healthy `cimd-test` service. Its final pre-reset audit recorded two manual authorizations, zero DCR registrations, two accepted tools (one dropped response, one cancelled), one successful refresh and one refused refresh. No new tool execution occurred during either authentication failure. All fault flags were reset after validation; the fault service remains sign-in required until explicitly logged in again.
|
|
90
|
+
|
|
91
|
+
Local evidence lives in ignored `artifacts/evidence/faults-{drop,cancel,401,refresh}.json` and `dsh-fault-*.png` / `dsh-faults-and-isolation.png`. The regression suite now has 47 passing tests. New tests first exposed exhausted-401 misclassification, missing persistent authentication error status and missing reconnect after a lost tool response; these were fixed in the accepted package. The package also drains active calls during close and gives unknown-outcome failures an explicit no-automatic-retry message.
|
|
92
|
+
|
|
93
|
+
This matrix distinguishes automated published-API integration tests from actual browser evidence. It does not constitute Desktop qualification, public-network identity-provider acceptance, or a claim that every matrix row was exercised through a model chat.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Publishing source and packages
|
|
2
|
+
|
|
3
|
+
## Publish the GitHub repository
|
|
4
|
+
|
|
5
|
+
The project uses MIT. Review the license holder and existing Git author information before public publication. Retaining commit history also publishes its author metadata; source hygiene does not remove that metadata.
|
|
6
|
+
|
|
7
|
+
1. Review `git status`, `git diff --check` and `git diff`; do not stage ignored evidence, credentials or generated packages.
|
|
8
|
+
2. Run the checks in CONTRIBUTING.md. Inspect the tarball file list and generated JavaScript.
|
|
9
|
+
3. Verify that `origin` points to the public `noob9527/dsh-mcp-oauth` GitHub repository and that package repository, homepage and issue links match it.
|
|
10
|
+
4. Review and commit the release changes, then push the intended branch. No script in this project performs these steps automatically.
|
|
11
|
+
5. Wait for the GitHub CI checks for that commit before publishing its package.
|
|
12
|
+
6. Enable private vulnerability reporting. Choose a default branch and protect it with the CI checks after their first successful GitHub run. Review repository permissions and enabled Actions.
|
|
13
|
+
|
|
14
|
+
Suggested description: OAuth MCP tools for unmodified DeepSeek Harness, with PKCE, CIMD and credential refresh.
|
|
15
|
+
|
|
16
|
+
GitHub CI has read-only repository permissions and no model or registry secrets. It builds a tarball artifact; it does not publish Releases, tags or npm packages. Linux/macOS workflow execution is confirmed only by a real GitHub run, not by a local test result.
|
|
17
|
+
|
|
18
|
+
## Release a package
|
|
19
|
+
|
|
20
|
+
Before declaring a release, complete the intended platform acceptance matrix, verify the exact tarball on an unmodified supported DSH, update compatibility statements and turn the changelog preview into an accurately dated release entry. Choose the release version before packing; change the documented tarball names when the version changes.
|
|
21
|
+
|
|
22
|
+
```sh
|
|
23
|
+
pnpm install --frozen-lockfile --ignore-scripts
|
|
24
|
+
pnpm run check:release
|
|
25
|
+
pnpm run typecheck
|
|
26
|
+
pnpm test
|
|
27
|
+
pnpm pack --pack-destination artifacts
|
|
28
|
+
node scripts/check-release.mjs --tarball artifacts/noob9527-dsh-mcp-oauth-0.1.0.tgz
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Manually create a GitHub prerelease and attach the reviewed tarball if preview distribution is desired. A source release and an npm release are distinct operations.
|
|
32
|
+
|
|
33
|
+
The distribution target is the public npm registry under `@noob9527/dsh-mcp-oauth`. Package metadata fixes the registry and public access. Authenticate as an account permitted to publish under the `noob9527` scope; keep credentials outside this repository. Review the exact tarball with `npm publish ./artifacts/noob9527-dsh-mcp-oauth-0.1.0.tgz --dry-run`, then publish that same file with `npm publish ./artifacts/noob9527-dsh-mcp-oauth-0.1.0.tgz --access public`. Verify the registry version and install the published package into a clean official DSH profile before announcing it. No workflow automatically publishes npm packages.
|
|
34
|
+
|
|
35
|
+
## Evidence limits
|
|
36
|
+
|
|
37
|
+
Local Web acceptance and the automated suite are recorded in acceptance.md. Desktop remains unqualified. Local screenshots, counters and tarballs under artifacts/ are intentionally ignored; review them before any separate upload. Do not publish URLs containing browser login tokens, callback codes or OAuth state.
|