Notion MCP Skill
Use this skill to run Notion MCP operations through uxc with OAuth and guarded write behavior.
Reuse the uxc skill guidance for discovery, schema inspection, OAuth lifecycle, and error recovery.
Do not assume another skill is auto-triggered in every runtime. Keep this skill executable on its own.
Prerequisites
- -
uxc is installed and available in PATH. - Network access to
https://mcp.notion.com/mcp. - OAuth callback listener is reachable (default examples use
http://127.0.0.1:8788/callback). - INLINECODE6 skill is available for generic discovery/describe/execute patterns.
Core Workflow (Notion-Specific)
Endpoint argument style in this skill:
- - Prefer shorthand
mcp.notion.com/mcp (scheme omitted). - Full URL
https://mcp.notion.com/mcp is also valid.
- 1. Ensure endpoint mapping exists:
-
uxc auth binding match mcp.notion.com/mcp
- 2. If mapping/auth is not ready, start OAuth login:
-
uxc auth oauth start notion-mcp --endpoint mcp.notion.com/mcp --redirect-uri http://127.0.0.1:8788/callback --scope read --scope write
- Prompt user to open the printed authorization URL.
- Ask user to paste the full callback URL after consent.
- Complete login with
uxc auth oauth complete notion-mcp --session-id <session_id> --authorization-response '<callback-url>'
- 3. Bind endpoint to the credential:
-
uxc auth binding add --id notion-mcp --host mcp.notion.com --path-prefix /mcp --scheme https --credential notion-mcp --priority 100
- 4. Use fixed link command by default:
-
command -v notion-mcp-cli
- If missing, create it:
uxc link notion-mcp-cli mcp.notion.com/mcp
-
notion-mcp-cli -h
- If command conflict is detected and cannot be safely reused, stop and ask skill maintainers to pick a different fixed command name.
- 5. Discover tools and inspect schema before execution:
-
notion-mcp-cli -h
-
notion-mcp-cli notion-fetch -h
-
notion-fetch requires
id (URL or UUID). Examples:
-
notion-mcp-cli notion-fetch id="https://notion.so/your-page-url"
-
notion-mcp-cli notion-fetch id="12345678-90ab-cdef-1234-567890abcdef"
- Common operations include
notion-search,
notion-fetch, and
notion-update-page.
- 6. Prefer read path first:
- Search/fetch current state before any write.
- 7. Execute writes only after explicit user confirmation:
- For
notion-update-page operations that may delete content, always confirm intent first.
OAuth Interaction Template
Use this exact operator-facing flow:
- 1. Start login command and wait for authorization URL output.
- Tell user:
- Open this URL in browser and approve Notion access.
- Copy the full callback URL from browser address bar.
- Paste the callback URL back in chat.
- 3. Run
uxc auth oauth complete notion-mcp --session-id <session_id> --authorization-response '<callback-url>'. - Optionally confirm success with:
- INLINECODE27
Do not ask user to manually extract or copy bearer tokens. Token exchange is handled by uxc.
Use uxc auth oauth login ... --flow authorization_code only for a single-process interactive fallback.
Guardrails
- - Keep automation on JSON output envelope; do not use
--text. - Parse stable fields first:
ok, kind, protocol, data, error. - Use
notion-mcp-cli as the default command path for all Notion MCP calls in this skill. - INLINECODE37 is equivalent to
uxc mcp.notion.com/mcp <operation> .... - Use direct
uxc mcp.notion.com/mcp ... only as a temporary fallback when link setup is unavailable. - Call
notion-fetch before notion-create-pages or notion-update-page when targeting database-backed content to obtain exact schema/property names. - Treat operations as high impact by default:
- Require explicit user confirmation before create/update/move/delete-style actions.
- - If OAuth/auth fails, use
uxc skill OAuth/error playbooks first, then apply Notion-specific checks in this skill's references.
References
- - Notion-specific auth notes (thin wrapper over
uxc skill OAuth guidance):
-
references/oauth-and-binding.md
- - Invocation patterns by task:
-
references/usage-patterns.md
- - Notion-specific failure notes (thin wrapper over
uxc skill error guidance):
- INLINECODE48
Notion MCP 技能
使用此技能通过 uxc 运行 Notion MCP 操作,支持 OAuth 和受保护的写入行为。
复用 uxc 技能指南进行发现、模式检查、OAuth 生命周期和错误恢复。
不要假设其他技能会在每个运行时自动触发。保持此技能可独立执行。
前提条件
- - uxc 已安装并可在 PATH 中使用。
- 可访问 https://mcp.notion.com/mcp 的网络。
- OAuth 回调监听器可访问(默认示例使用 http://127.0.0.1:8788/callback)。
- uxc 技能可用于通用的发现/描述/执行模式。
核心工作流(Notion 专用)
此技能中的端点参数风格:
- - 优先使用简写 mcp.notion.com/mcp(省略协议)。
- 完整 URL https://mcp.notion.com/mcp 同样有效。
- 1. 确保端点映射存在:
- uxc auth binding match mcp.notion.com/mcp
- 2. 如果映射/认证未就绪,启动 OAuth 登录:
- uxc auth oauth start notion-mcp --endpoint mcp.notion.com/mcp --redirect-uri http://127.0.0.1:8788/callback --scope read --scope write
- 提示用户打开打印的授权 URL。
- 要求用户在同意后粘贴完整的回调 URL。
- 使用 uxc auth oauth complete notion-mcp --session-id
--authorization-response 完成登录。
- 3. 将端点绑定到凭证:
- uxc auth binding add --id notion-mcp --host mcp.notion.com --path-prefix /mcp --scheme https --credential notion-mcp --priority 100
- 4. 默认使用固定链接命令:
- command -v notion-mcp-cli
- 如果缺失,创建它:uxc link notion-mcp-cli mcp.notion.com/mcp
- notion-mcp-cli -h
- 如果检测到命令冲突且无法安全复用,停止并让技能维护者选择不同的固定命令名称。
- 5. 在执行前发现工具并检查模式:
- notion-mcp-cli -h
- notion-mcp-cli notion-fetch -h
- notion-fetch 需要 id(URL 或 UUID)。示例:
- notion-mcp-cli notion-fetch id=https://notion.so/your-page-url
- notion-mcp-cli notion-fetch id=12345678-90ab-cdef-1234-567890abcdef
- 常见操作包括 notion-search、notion-fetch 和 notion-update-page。
- 6. 优先走读取路径:
- 在任何写入操作前先搜索/获取当前状态。
- 7. 仅在用户明确确认后执行写入:
- 对于可能删除内容的 notion-update-page 操作,始终先确认意图。
OAuth 交互模板
使用以下精确的操作员面向流程:
- 1. 启动登录命令并等待授权 URL 输出。
- 告知用户:
- 在浏览器中打开此 URL 并批准 Notion 访问。
- 从浏览器地址栏复制完整的回调 URL。
- 将回调 URL 粘贴回聊天中。
- 3. 运行 uxc auth oauth complete notion-mcp --session-id --authorization-response 。
- 可选地使用以下命令确认成功:
- uxc auth oauth info
不要要求用户手动提取或复制 bearer 令牌。令牌交换由 uxc 处理。
仅在单进程交互式回退时使用 uxc auth oauth login ... --flow authorization_code。
防护措施
- - 保持自动化输出为 JSON 格式;不要使用 --text。
- 首先解析稳定字段:ok、kind、protocol、data、error。
- 在此技能的所有 Notion MCP 调用中使用 notion-mcp-cli 作为默认命令路径。
- notion-mcp-cli ... 等同于 uxc mcp.notion.com/mcp ...。
- 仅在链接设置不可用时,作为临时回退使用直接的 uxc mcp.notion.com/mcp ...。
- 在针对数据库支持的内容时,先调用 notion-fetch 再调用 notion-create-pages 或 notion-update-page,以获取精确的模式/属性名称。
- 默认将操作视为高影响:
- 在创建/更新/移动/删除类操作前要求用户明确确认。
- - 如果 OAuth/认证失败,首先使用 uxc 技能的 OAuth/错误处理手册,然后在此技能的参考资料中应用 Notion 特定的检查。
参考资料
- - Notion 特定认证说明(对 uxc 技能 OAuth 指南的轻量封装):
- references/oauth-and-binding.md
- references/usage-patterns.md
- - Notion 特定失败说明(对 uxc 技能错误指南的轻量封装):
- references/error-handling.md