Notion MCP Server

Notion MCP Server

site icon
2025.04.11 99000
TypeScriptNotion集成内容管理自动化工具交流协作
Notion server 提供了丰富的工具集,用于读取、写入和管理 Notion 中的页面、数据库、块和评论等内容。
View on GitHub

Overview

产品定位

mcp-notion-server 是一个中间件服务,旨在桥接 Claude 和 Notion API,实现自动化管理和操作 Notion 内容的能力。

核心功能

  1. Notion 内容管理
  2. 检索页面、数据库、块和用户信息
  3. 创建和更新数据库及数据库项
  4. 查询数据库内容
  5. 管理块内容(追加、删除、检索)

  6. 搜索功能

  7. 按标题搜索页面和数据库
  8. 支持分页和过滤

  9. 用户管理

  10. 列出所有用户
  11. 检索特定用户信息
  12. 获取当前授权用户信息

  13. 评论功能

  14. 创建评论
  15. 检索评论

  16. 格式转换

  17. 支持 JSON 和 Markdown 格式转换
  18. 可显著减少令牌消耗

适用场景

  1. 自动化内容管理:自动创建、更新和删除 Notion 内容
  2. 数据集成:将外部数据源集成到 Notion 中
  3. 团队协作:自动化团队工作流程和任务管理
  4. 知识管理:自动组织和检索知识库内容
  5. 内容生成:自动生成和格式化文档内容

工具列表

  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. 确保集成具有所需权限
  3. 验证集成是否被邀请到相关页面或数据库
  4. 确认令牌和配置正确设置

  5. Markdown 转换问题

  6. 编辑页面内容时可能出现问题
  7. 建议在需要修改内容时使用 JSON 格式

使用教程

使用依赖

  1. Node.js 环境
  2. Notion 账户和集成权限

安装教程

  1. 创建 Notion 集成:
  2. 访问 Notion 集成页面
  3. 点击 "New Integration"
  4. 命名集成并选择适当权限

  5. 获取密钥:

  6. 复制 "Internal Integration Token"

  7. 将集成添加到工作区:

  8. 打开要访问的页面或数据库
  9. 点击 "···" > "Connections" > 选择你的集成

  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. 测试只读工具:
node build/index.js --enabledTools=notion_retrieve_block,notion_retrieve_block_children,notion_retrieve_page,notion_query_database,notion_retrieve_database,notion_search,notion_list_all_users,notion_retrieve_user,notion_retrieve_bot_user,notion_retrieve_comments
  1. 启用 Markdown 转换:
{
  "mcpServers": {
    "notion": {
      "command": "npx",
      "args": ["-y", "@suekou/mcp-notion-server"],
      "env": {
        "NOTION_API_TOKEN": "your-integration-token",
        "NOTION_MARKDOWN_CONVERSION": "true"
      }
    }
  }
}

许可证

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