
Notion MCP Server

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工作区的功能。
核心功能
- 块操作:追加、检索、删除块及其子块。
- 页面管理:检索页面信息、更新页面属性。
- 数据库操作:创建、查询、更新数据库及数据库项。
- 搜索功能:按标题搜索页面或数据库。
- 用户管理:列出所有用户、检索特定用户信息。
- 评论功能:创建和检索评论。
适用场景
- 自动化管理Notion工作区内容。
- 集成Notion数据到其他应用或服务。
- 批量操作Notion中的块、页面或数据库。
工具列表
notion_append_block_children
:追加子块到父块。notion_retrieve_block
:检索特定块信息。notion_retrieve_block_children
:检索块的子块。notion_delete_block
:删除特定块。notion_retrieve_page
:检索页面信息。notion_update_page_properties
:更新页面属性。notion_create_database
:创建新数据库。notion_query_database
:查询数据库。notion_retrieve_database
:检索数据库信息。notion_update_database
:更新数据库信息。notion_create_database_item
:在数据库中创建新项。notion_search
:搜索页面或数据库。notion_list_all_users
:列出所有用户。notion_retrieve_user
:检索特定用户信息。notion_retrieve_bot_user
:检索当前令牌关联的机器人用户。notion_create_comment
:创建评论。notion_retrieve_comments
:检索评论。
常见问题解答
- 权限错误:确保集成具有所需权限,并已邀请到相关页面或数据库。
- 配置错误:确认令牌和配置在
claude_desktop_config.json
中正确设置。
使用教程
使用依赖
- 安装Node.js环境。
安装教程
- 创建Notion集成:
- 访问Notion Your Integrations page。
- 点击"New Integration"。
- 命名集成并选择适当权限。
- 获取密钥:复制"Internal Integration Token"。
- 将集成添加到工作区:
- 打开要访问的页面或数据库。
- 点击右上角的导航按钮。
- 点击"Connect to"按钮并选择您的集成。
- 配置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"
}
}
}
}
调试方式
- 检查集成权限是否正确设置。
- 确认集成已添加到相关页面或数据库。
- 验证令牌和配置是否正确。