前言¶
在 dsh agent 中读取或写入 Notion 时,常见的问题不只是能不能调用工具,还包括 OAuth 授权、token 刷新、本地回调、凭据存储和失效处理。
dsh-notion-mcp 是一个 DeepSeek Harness(DSH)插件,它通过官方 Notion MCP 服务器,用 OAuth 2.0(授权码 + PKCE)把 dsh 连接到 Notion。完成一次性浏览器授权后,Notion 搜索、页面、数据库、评论等工具会以 mcp__notion__* 的形式挂载给 dsh agent。
下面介绍它的定位、功能、安装方式、授权流程和注意事项。
这是什么¶
dsh-notion-mcp 是一个 DSH 插件,用于把 dsh 连接到 Notion。
它使用官方 Notion MCP 服务器,并通过 OAuth 2.0 授权码 + PKCE 完成浏览器授权。插件负责处理客户端注册、token 换取、token 刷新和凭据存储,最终让 dsh agent 直接调用 mcp__notion__* 工具。
许可证为 MIT。GitHub 仓库地址为:
https://github.com/mingzeng21/dsh-notion
核心功能¶
dsh-notion-mcp 提供以下已核实能力:
- 通过官方 Notion MCP 服务器把
dsh连接到 Notion。 - 使用 OAuth 2.0 授权码 + PKCE 完成一次性浏览器授权。
- 运行时动态客户端注册(RFC 7591),无需提供
client_id或密钥。 - access token 到期前自动刷新,refresh token 原子落盘。
- Notion 搜索、页面、数据库、评论等工具以
mcp__notion__*挂载给 dsh agent。 - token 存在 dsh 的凭据层,不进入仓库。
- refresh token 出现
invalid_grant时清掉并停止重试。
环境要求¶
运行前需要确认 DSH 和 Node.js 版本:
- DeepSeek Harness(
dsh)已验证兼容以下版本: v0.1.0-rc.8v0.1.1-rc.1v0.1.1-rc.2v0.1.2-alpha.1- Node.js 要求:
^22.19.0或>=24.0.0。 - Node 23 不在支持范围内。
安装¶
安装命令如下:
dsh plugin --profile web add dsh-notion-mcp
安装命令中的 --profile 用于指定安装插件的 profile。如果你要在最小 profile 中运行 notion 命令,也可以在该 profile 中安装:
dsh plugin --profile notion add dsh-notion-mcp
注意:notion 命令需要在最小 profile 里运行;web 等 UI app 不会把 notion 转发给插件。
授权¶
授权在最小 profile 中执行。下面以 notion profile 为例:
dsh --profile notion notion login
执行后,dsh notion login 会打印授权 URL,并在 127.0.0.1:53007 等待回调。
在浏览器中打开打印出的授权 URL,批准后 Notion 会重定向到:
http://127.0.0.1:53007/callback
授权完成后,Notion 工具会以 mcp__notion__* 形式可用。
本地 OAuth 回调端口为 53007,监听地址为 127.0.0.1。
配置¶
默认配置项如下:
mcpUrl: https://mcp.notion.com/mcp
mcpUrl 是 Notion MCP 服务器 URL。
安全与注意¶
使用前建议先检查仓库源码和许可证。插件以当前 dsh 进程权限运行,安装前确认你信任该仓库、依赖关系和你的运行环境。
已核实的安全相关行为包括:
- token 存在 dsh 的凭据层,不进入仓库。
- 仓库不包含任何密钥。
- 运行时动态客户端注册,无需提供
client_id或密钥。 - refresh token 原子落盘。
- Notion 每次刷新都会轮换 refresh token。
- 若 refresh token 出现
invalid_grant,插件会清掉并停止重试,需要重新执行:
dsh notion login
卸载¶
卸载命令如下:
dsh plugin --profile web remove dsh-notion-mcp
仓库¶
GitHub 仓库地址:
https://github.com/mingzeng21/dsh-notion
许可证:MIT。