notion-connect

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Notion Connect

连接Notion

Connect your Notion workspace. One token, two minutes.
连接你的Notion工作区。只需一个令牌,耗时两分钟。

How to Set Up

设置步骤

  1. User goes to notion.so/my-integrations
  2. Clicks + New integration
  3. Names it anything (e.g. "AI Assistant")
  4. Selects the workspace
  5. Clicks Submit → copies the Internal Integration Secret (starts with
    ntn_
    )
  6. Pastes it in the chat
Important: After creating the integration, the user must also share specific pages/databases with it:
  • Open a Notion page → click
    ...
    menu → Connections → select the integration
  • This grants the integration access to that page and its children
  1. 用户访问notion.so/my-integrations
  2. 点击**+ 新建集成**
  3. 为其命名(例如“AI助手”)
  4. 选择工作区
  5. 点击提交 → 复制内部集成密钥(以
    ntn_
    开头)
  6. 将其粘贴到聊天框中
重要提示: 创建集成后,用户还必须将特定页面/数据库共享给该集成:
  • 打开Notion页面 → 点击
    ...
    菜单 → 连接 → 选择该集成
  • 这将授予该集成访问该页面及其子页面的权限

AI Agent Flow

AI Agent流程

Check if configured:

检查是否已配置:

bash
python3 notion-connect/scripts/notion_connect.py --check
Returns JSON:
{"configured": true, "workspace": "..."}
or
{"configured": false}
.
bash
python3 notion-connect/scripts/notion_connect.py --check
返回JSON:
{"configured": true, "workspace": "..."}
{"configured": false}
.

Save token (after user pastes it):

保存令牌(用户粘贴后):

bash
python3 notion-connect/scripts/notion_connect.py --set-token "ntn_xxxxxxxxxxxxx"
Saves to
~/.config/notion/config.json
and verifies the token works by calling the Notion API.
bash
python3 notion-connect/scripts/notion_connect.py --set-token "ntn_xxxxxxxxxxxxx"
保存至
~/.config/notion/config.json
,并通过调用Notion API验证令牌是否可用。

When Notion is not configured, tell the user EXACTLY this:

当Notion未配置时,务必告知用户以下内容:

"To connect Notion, I just need your Integration Token. It takes about 2 minutes:
  1. Open this page: https://www.notion.so/my-integrations
  2. Create a new integration (name it anything, like 'AI Assistant')
  3. After creating, go to Content access tab → Edit access → select the pages you want me to access
  4. Copy the Internal Integration Secret (starts with
    ntn_
    )
  5. Paste it here
"要连接Notion,我只需要你的集成令牌。耗时约2分钟:
  1. 打开此页面:https://www.notion.so/my-integrations
  2. 创建一个新集成(可任意命名,例如“AI助手”)
  3. 创建完成后,进入内容访问标签页 → 编辑访问权限 → 选择你希望我访问的页面
  4. 复制内部集成密钥(以
    ntn_
    开头)
  5. 将其粘贴到此处

CRITICAL RULES

重要规则

  1. NEVER ask the user for OAuth credentials — Notion internal integrations only need one token
  2. Always mention Content access — users must grant page access after creating the integration, otherwise it can't see anything
  3. Token starts with
    ntn_
    — if the user pastes something else, it's wrong
  4. Always show the Gitbook link when guiding setup
  1. 切勿向用户索要OAuth凭据 — Notion内部集成仅需一个令牌
  2. 务必提及内容访问权限 — 用户创建集成后必须授予页面访问权限,否则集成无法查看任何内容
  3. 令牌以
    ntn_
    开头
    — 如果用户粘贴的内容不符合,即为错误令牌
  4. 引导设置时务必展示Gitbook链接

Credential Storage

凭据存储

FilePath
Config
~/.config/notion/config.json
Format
{"token": "ntn_...", "workspace_name": "...", "workspace_id": "..."}
Permissions
0600
(user-only read)
文件路径
配置文件
~/.config/notion/config.json
格式
{"token": "ntn_...", "workspace_name": "...", "workspace_id": "..."}
权限
0600
(仅用户可读取)

Follow-Up Questions

后续操作示例

  • "Search my Notion workspace for recent pages"
  • "List my Notion databases"
  • "Create a new page with meeting notes"
  • "搜索我的Notion工作区中的最新页面"
  • "列出我的Notion数据库"
  • "创建一个包含会议记录的新页面"