{"_id":"dsh-notion-oauth-ui","_rev":"2-71cc5779acdc2a01b56f728ad3157ded","name":"dsh-notion-oauth-ui","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.0":{"name":"dsh-notion-oauth-ui","version":"1.0.0","keywords":["dsh","dsh-plugin","notion","mcp","oauth","gui","ui","deepseek-harness"],"author":{"url":"https://github.com/MerkurevSergei","name":"Merkurev Sergei","email":"merkurevsn@gmail.com"},"license":"MIT","_id":"dsh-notion-oauth-ui@1.0.0","maintainers":[{"name":"merkurevsn","email":"merkurevsn@gmail.com"}],"homepage":"https://github.com/MerkurevSergei/dsh-notion-oauth-ui#readme","bugs":{"url":"https://github.com/MerkurevSergei/dsh-notion-oauth-ui/issues"},"dsh":{"bundle":{"patch":"./cordis.patch.yml"},"client":{"inject":["@deepseek-ai/dsh-client-runtime"],"platform":"web"}},"dist":{"shasum":"da650fdd4063ad2aa6a9d125bf7d5987924a2e83","tarball":"https://registry.npmjs.org/dsh-notion-oauth-ui/-/dsh-notion-oauth-ui-1.0.0.tgz","fileCount":11,"integrity":"sha512-CjzbbVj2aIldUvkRVlPmsIPSNKzrOWouQtyRsbCq16lUhf0SU1owHw15lWfHcwSVRqV9b96ZuQYsbsxEK27R1A==","signatures":[{"sig":"MEUCIQCN8nVYcBsiN3/HptDPO7k17ePO+jYAWLj2eue/eBXXqQIgb409M2dlLxfsQEKUrrJxYWU7bFkdwg+kURnQRBU38A4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":43211},"icon":"./icon.svg","main":"lib/index.js","type":"module","engines":{"dsh":">=0.1.5-rc.3","node":">=22.12.0"},"exports":{".":"./lib/index.js","./client":"./lib/client.js","./package.json":"./package.json","./locale/*.json":"./locale/*.json"},"gitHead":"9495c0509e2100b9e066beec5cc96008f55d847e","scripts":{"build":"node scripts/build.mjs","prepare":"node scripts/build.mjs","typecheck":"tsc --noEmit"},"_npmUser":{"name":"merkurevsn","email":"merkurevsn@gmail.com"},"repository":{"url":"git+https://github.com/MerkurevSergei/dsh-notion-oauth-ui.git","type":"git"},"_npmVersion":"10.2.3","description":"Connect Notion from the GUI with OAuth 2.0 + PKCE — official Notion MCP, no integration token.","directories":{},"_nodeVersion":"20.10.0","dependencies":{"commander":"^15.0.0"},"_hasShrinkwrap":false,"packageManager":"pnpm@11.7.0","devDependencies":{"esbuild":"^0.25.0","typescript":"^5.6.0","@types/node":"^22.0.0","@types/react":"^18.3.0"},"peerDependencies":{"react":">=18"},"peerDependenciesMeta":{"react":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/dsh-notion-oauth-ui_1.0.0_1790533750835_0.11999808024708791","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"_id":"dsh-notion-oauth-ui@1.0.3","dsh":{"bundle":{"patch":"./cordis.patch.yml"},"client":{"inject":["@deepseek-ai/dsh-client-runtime"],"platform":"web"}},"bugs":{"url":"https://github.com/MerkurevSergei/dsh-notion-oauth-ui/issues"},"dist":{"shasum":"0f97a4254bd1a09e51dc26b5a1dd00f8833bd746","tarball":"https://registry.npmjs.org/dsh-notion-oauth-ui/-/dsh-notion-oauth-ui-1.0.3.tgz","integrity":"sha512-x/X7mA+ECZ/qzs8a/3MBhMckcVmCWYnuaD7c9NG4jzxKceYFu3HmaJn0zldiTbv6oTHPPr/lTRtdE0ZnQSP5Ww==","fileCount":17,"unpackedSize":318013,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/dsh-notion-oauth-ui@1.0.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQC68yrKpvJCD/EF4316uZE2U5ri1pqvlZYGCrERi5Cx5gIgbUaThFHKMUhrh9Wzwjk0GFt85FUSjq/cjUFgg300+eg="}]},"icon":"./icon.svg","main":"lib/index.js","name":"dsh-notion-oauth-ui","type":"module","author":{"url":"https://github.com/MerkurevSergei","name":"Merkurev Sergei","email":"merkurevsn@gmail.com"},"engines":{"dsh":">=0.1.5-rc.3","node":">=22.12.0"},"exports":{".":"./lib/index.js","./client":"./lib/client.js","./package.json":"./package.json","./locale/*.json":"./locale/*.json"},"gitHead":"efddbf34b0876a545a37641bd70b5aa59c1e41f8","license":"MIT","scripts":{"build":"node scripts/build.mjs","prepare":"node scripts/build.mjs","typecheck":"tsc --noEmit"},"version":"1.0.3","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:0abdf915-7860-4e63-b73a-85be08e71e09"},"approver":{"name":"merkurevsn","email":"merkurevsn@gmail.com"}},"homepage":"https://github.com/MerkurevSergei/dsh-notion-oauth-ui#readme","keywords":["dsh","dsh-plugin","notion","mcp","oauth","gui","ui","deepseek-harness"],"repository":{"url":"git+https://github.com/MerkurevSergei/dsh-notion-oauth-ui.git","type":"git"},"_npmVersion":"12.1.0","description":"Connect Notion from the GUI with OAuth 2.0 + PKCE — official Notion MCP, no integration token.","directories":{},"maintainers":[{"name":"merkurevsn","email":"merkurevsn@gmail.com"}],"_nodeVersion":"24.21.0","dependencies":{"commander":"^15.0.0"},"packageManager":"pnpm@11.7.0","devDependencies":{"esbuild":"^0.25.0","typescript":"^5.6.0","@types/node":"^22.0.0","@types/react":"^18.3.0"},"peerDependencies":{"react":">=18"},"peerDependenciesMeta":{"react":{"optional":true}},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/dsh-notion-oauth-ui_1.0.3_1790538072361_0.44769616986037963"},"_hasShrinkwrap":false}},"time":{"created":"2026-09-27T18:29:10.779Z","modified":"2026-09-27T19:41:12.782Z","1.0.0":"2026-09-27T18:29:10.964Z","1.0.3":"2026-09-27T19:41:12.469Z"},"bugs":{"url":"https://github.com/MerkurevSergei/dsh-notion-oauth-ui/issues"},"author":{"url":"https://github.com/MerkurevSergei","name":"Merkurev Sergei","email":"merkurevsn@gmail.com"},"license":"MIT","homepage":"https://github.com/MerkurevSergei/dsh-notion-oauth-ui#readme","keywords":["dsh","dsh-plugin","notion","mcp","oauth","gui","ui","deepseek-harness"],"repository":{"url":"git+https://github.com/MerkurevSergei/dsh-notion-oauth-ui.git","type":"git"},"description":"Connect Notion from the GUI with OAuth 2.0 + PKCE — official Notion MCP, no integration token.","maintainers":[{"name":"merkurevsn","email":"merkurevsn@gmail.com"}],"readme":"# dsh-notion-oauth-ui\n\n在 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) 的图形界面中，用 OAuth 2.0（授权码 + PKCE）连接 [Notion](https://www.notion.com) —— 无需复制 Integration Token，也不必打开终端。页面、数据库与评论均通过官方 Notion MCP 服务器访问。\n\n## 特性\n\n- **GUI 一键登录** —— 设置页中的「Notion」页面提供一键 Login，无需终端、无需 Integration Token。\n- **OAuth + PKCE** —— 动态客户端注册（RFC 7591），无需复制 `client_id` 或密钥。\n- **静默刷新** —— access token 自动刷新，refresh token 原子轮换。\n- **工具以 `mcp__notion__*` 挂载** —— 通过官方 MCP 服务器搜索、读取/创建页面、数据库与评论。\n- **CLI 备选** —— `dsh notion login` 适用于 headless / CLI 配置。\n\n## 安装与登录\n\n**1. 安装** —— 侧边栏打开 **Plugins**，点击 **Add plugin**，输入 `dsh-notion-oauth-ui` 后按 **Install**。\n\n![侧边栏中要点击的位置](assets/setup-1.png)\n\n![已填写包名的 Add plugin 对话框](assets/setup-2.png)\n\n**2. 打开设置** —— 侧边栏底部的齿轮，或按 `Ctrl + ,`。\n\n![从侧边栏打开设置](assets/setup-3.png)\n\n**3. 登录** —— 打开 **Notion** 并点击 **Login**。\n\n![设置中的 Notion 项与 Login 按钮](assets/setup-4.png)\n\n**4. 授权** —— 浏览器会打开 Notion 授权页：选择工作区，勾选 **I recognize and trust this URL**，然后点击 **Continue**。\n\n![Notion 授权页](assets/setup-5.png)\n\n**5. 完成** —— 页面变为 **Connected**，`mcp__notion__*` 工具随即可用。\n\n![显示 Connected 的 Notion 页面](assets/setup-6.png)\n\nheadless 或仅 CLI 的配置，可以在终端走同一条流程：\n\n```sh\ndsh plugin --profile <name> add dsh-notion-oauth-ui\ndsh notion login\n```\n\n## 配置\n\n| 键 | 默认值 | 说明 |\n|---|---|---|\n| `mcpUrl` | `https://mcp.notion.com/mcp` | Notion MCP 服务器 URL |\n| `port` | `53007` | 本地 OAuth 回调端口（`127.0.0.1`） |\n| `refreshLeadMs` | `300000`（5 分钟） | 在令牌到期前提前这么久刷新 |\n| `refreshRetryMs` | `60000`（1 分钟） | 刷新失败时的重试间隔 |\n\n## 安全\n\n- **仅限回环的控制路由。** 设置页通过 `/api/dsh-notion-oauth-ui/{status,login,logout}` 通信。每个路由固定一种 HTTP 方法（`GET /status`、`POST /login`、`POST /logout`），并且只接受远端地址与 `Host` 均为回环、且非 `Sec-Fetch-Site: cross-site` 的请求。当请求携带 `Origin` 时，它必须是应用自身（`dsh-app://app`）或同源主机。Desktop 外壳会代理渲染进程的请求并**剥离** `Origin` 与 `Sec-Fetch-Site`，因此 `Origin` 缺失属于正常情况；两个 POST 路由因此额外要求 `Content-Type: application/json` —— 它不属于 CORS 简单值，跨站调用方必须先通过被本路由拒绝的预检请求。\n- **OAuth 加固。** 授权码 + PKCE（S256）、每次流程独立的 `state`（由回调服务器校验），以及 10 分钟的回调截止时间。格式错误或伪造的回调返回 400，**不会**中断正在等待的登录。\n- **传输。** `mcpUrl` 必须是 `https://`，否则插件拒绝加载。发现端点（授权、令牌、注册）取自 `mcpUrl` 资源所声明的地址，因此请保持其来源可信。\n- **静态令牌。** access/refresh token 以单条记录存放在 DSH 凭据层（`NOTION_OAUTH`）。该存储的私密性仅等同于你的操作系统用户账户：工具进程以同一用户运行，因此任何拥有凭据访问权的插件都能读取**所有**已存密钥（`NOTION_OAUTH`、`DEEPSEEK_API_KEY` 等），而不只是自己的。令牌不会暴露给浏览器端、不会由任何 HTTP 路由返回，也不会写入日志。\n\n## 许可证\n\nMIT。复用了 `dsh-notion-mcp` 与 `dsh-notion-connector`（均为 MIT）的代码与设计模式。\n","readmeFilename":"README.zh.md"}