Notion MCP Server

Notion MCP Server

site icon
2024.12.27 0
JavaScriptNotion API自动化工具交流协作
Notion MCP Server 是一个用于Notion API的MCP服务器,使Claude能够与Notion工作区进行交互。它提供了丰富的功能,包括创建、查询、更新和删除Notion中的块、页面、数据库等,以及搜索、用户管理和评论功能。
View on GitHub

Overview

基本能力

产品定位

Notion MCP Server 是一个中间件,用于连接Claude和Notion API,实现自动化操作Notion工作区的功能。

核心功能

  1. 块操作:追加、检索、删除块及其子块。
  2. 页面管理:检索页面信息、更新页面属性。
  3. 数据库操作:创建、查询、更新数据库及数据库项。
  4. 搜索功能:按标题搜索页面或数据库。
  5. 用户管理:列出所有用户、检索特定用户信息。
  6. 评论功能:创建和检索评论。

适用场景

  1. 自动化管理Notion工作区内容。
  2. 集成Notion数据到其他应用或服务。
  3. 批量操作Notion中的块、页面或数据库。

工具列表

  1. notion_append_block_children:追加子块到父块。
  2. notion_retrieve_block:检索特定块信息。
  3. notion_retrieve_block_children:检索块的子块。
  4. notion_delete_block:删除特定块。
  5. notion_retrieve_page:检索页面信息。
  6. notion_update_page_properties:更新页面属性。
  7. notion_create_database:创建新数据库。
  8. notion_query_database:查询数据库。
  9. notion_retrieve_database:检索数据库信息。
  10. notion_update_database:更新数据库信息。
  11. notion_create_database_item:在数据库中创建新项。
  12. notion_search:搜索页面或数据库。
  13. notion_list_all_users:列出所有用户。
  14. notion_retrieve_user:检索特定用户信息。
  15. notion_retrieve_bot_user:检索当前令牌关联的机器人用户。
  16. notion_create_comment:创建评论。
  17. notion_retrieve_comments:检索评论。

常见问题解答

  1. 权限错误:确保集成具有所需权限,并已邀请到相关页面或数据库。
  2. 配置错误:确认令牌和配置在claude_desktop_config.json中正确设置。

使用教程

使用依赖

  1. 安装Node.js环境。

安装教程

  1. 创建Notion集成
  2. 访问Notion Your Integrations page
  3. 点击"New Integration"。
  4. 命名集成并选择适当权限。
  5. 获取密钥:复制"Internal Integration Token"。
  6. 将集成添加到工作区
  7. 打开要访问的页面或数据库。
  8. 点击右上角的导航按钮。
  9. 点击"Connect to"按钮并选择您的集成。
  10. 配置Claude Desktop: 在claude_desktop_config.json中添加以下内容:
{
  "mcpServers": {
    "notion": {
      "command": "npx",
      "args": ["-y", "@suekou/mcp-notion-server"],
      "env": {
        "NOTION_API_TOKEN": "your-integration-token"
      }
    }
  }
}

{
  "mcpServers": {
    "notion": {
      "command": "node",
      "args": ["your-built-file-path"],
      "env": {
        "NOTION_API_TOKEN": "your-integration-token"
      }
    }
  }
}

调试方式

  1. 检查集成权限是否正确设置。
  2. 确认集成已添加到相关页面或数据库。
  3. 验证令牌和配置是否正确。

许可证

该项目遵循 MIT 开源许可条款,请参阅 MIT 了解完整条款。