Notion MCP 服务器基于 Notion API 构建,它能够让 Claude 与 Notion 工作区进行互动协作,为您的工作流程提供强大助力。
文档中未提及具体安装步骤,可补充相关内容以方便用户使用。
以下是使用notion_append_block_children工具向父块添加子块的示例:
# 假设这里有调用 notion_append_block_children 的代码
# 由于未提供实际代码,此处仅作示例示意
# 调用 notion_append_block_children 函数,传入父块 ID 和子块对象数组
result = notion_append_block_children(block_id="your_block_id", children=[{"type": "paragraph", "paragraph": {"text": [{"type": "text", "text": {"content": "This is a new child block."}}]}}])
print(result)
在搜索内容时,使用可选参数进行分页搜索:
# 假设这里有调用 notion_search 的代码
# 由于未提供实际代码,此处仅作示例示意
# 调用 notion_search 函数,传入搜索关键词、每页结果数量和游标
result = notion_search(query="your_search_query", page_size=20, cursor="your_cursor")
print(result)
notion_append_block_childrenblock_id (字符串):父块的 ID。children (数组):待添加的子块对象数组。notion_retrieve_blockblock_id (字符串):要获取的块 ID。notion_retrieve_block_childrenblock_id (字符串):父块的 ID。start_cursor (字符串):下一页结果的游标。page_size (数字,默认值:100,最大值:100):获取的块数量。notion_delete_blockblock_id (字符串):要删除的块 ID。notion_retrieve_pagepage_id (字符串):要获取的页面 ID。notion_update_page_propertiespage_id (字符串):要更新的页面 ID。properties (对象):待更新的属性。notion_create_databaseparent (对象):数据库的父级对象。title (数组):数据库标题。properties (对象):数据库属性。notion_retrieve_databasesnotion_update_database_propertiesdatabase_id (字符串):要更新的数据库 ID。properties (对象):待更新的属性。notion_delete_databasedatabase_id (字符串):要删除的数据库 ID。notion_searchquery (字符串):搜索关键词。page_size (数字):每页结果数量。cursor (字符串):游标用于分页。若要通过Claude Desktop使用,请在claude_desktop_config.json中添加以下内容:
{
"mcpServers": {
"notion": {
"command": "node",
"args": ["your-built-file-path"],
"env": {
"NOTION_API_TOKEN": "your-integration-token"
}
}
}
}
若遇权限错误:
claude_desktop_config.json中设置正确。该 MCP 服务器基于 MIT License 发布。这意味着您可以自由使用、修改和分发软件,但需遵守 MIT 许可证的条款和条件。如需更多详情,请参阅项目仓库中的 LICENSE 文件。