
Notion MCP Server
使语言模型能够通过标准化的工具与 Notion 工作区进行交互,这些工具包括搜索、读取、创建和更新页面和数据库。
README
Notion MCP 服务器
一个模型上下文协议 (MCP) 服务器,提供与 Notion 的无缝集成。该服务器使语言模型能够通过标准化的工具与您的 Notion 工作区进行交互,以进行搜索、读取、创建和更新页面和数据库。
🌟 主要特性
页面操作
- 🔍 搜索您的 Notion 工作区
- 📝 创建具有丰富 Markdown 内容的新页面
- 📖 以清晰的格式读取页面内容
- 🔄 更新现有页面
- 💬 添加和检索评论
- 🧱 块级操作(更新、删除)
增强的 Markdown 支持
- 多个标题级别 (H1-H3)
- 带有语言支持的代码块
- 带有复选框状态的交互式待办事项
- 带有多行支持的块引用
- 水平分隔线
- 带有标题的图像
- 嵌套的要点
数据库操作
- 创建和管理数据库
- 添加和更新数据库条目
- 使用过滤器和排序进行查询
- 支持各种属性类型:
- 标题、富文本、数字
- 选择、多选
- 日期、复选框
- 还有更多!
🚀 快速开始
前提条件
- Node.js (v16 或更高版本)
- Notion API 密钥
- 兼容 MCP 的客户端(例如,Claude Desktop)
安装
- 克隆存储库:
git clone https://github.com/v-3/notion-server.git
cd notion-server
- 安装依赖项:
npm install
- 设置您的环境:
# 创建 .env 文件
echo "NOTION_API_KEY=your_notion_api_key_here" > .env
# 或者直接导出
export NOTION_API_KEY=your_notion_api_key_here
- 构建服务器:
npm run build
🔧 配置
Claude Desktop 设置
- 更新您的 Claude Desktop 配置 (
claude_desktop_config.json
):
{
"mcpServers": {
"notion": {
"command": "node",
"args": ["/absolute/path/to/notion-server/build/index.js"],
"env": {
"NOTION_API_KEY": "your_notion_api_key_here"
}
}
}
}
- 重启 Claude Desktop 以应用更改
🛠️ 可用工具
页面操作
// 搜索页面
{
query: string // 搜索查询
}
// 读取页面
{
pageId: string // 要读取的页面的 ID
}
// 创建页面
{
title?: string, // 页面标题
content?: string, // 页面内容,使用 markdown 格式
parentPageId: string // 父页面 ID
properties?: object // 用于数据库条目
}
// 更新页面
{
pageId: string, // 要更新的页面 ID
content: string, // 新内容
type?: string // 内容类型
}
数据库操作
// 创建数据库
{
parentPageId: string,
title: string,
properties: object
}
// 查询数据库
{
databaseId: string,
filter?: object,
sort?: object
}
🔐 设置 Notion 访问权限
创建集成
- 访问 Notion Integrations
- 点击 "New integration"
- 配置权限:
- 内容:读取、更新、插入
- 评论:读取、创建
- 用户信息:读取
连接页面
- 打开您的 Notion 页面
- 点击 "..." 菜单 → "Connections"
- 添加您的集成
- 根据需要为其他页面重复此操作
📝 使用示例
创建页面
const result = await notion.create_page({
parentPageId: "page_id",
title: "My Page",
content: "# Welcome\nThis is a test page."
});
查询数据库
const result = await notion.query_database({
databaseId: "db_id",
filter: {
property: "Status",
select: {
equals: "In Progress"
}
}
});
🤝 贡献
欢迎贡献!请:
- Fork 存储库
- 创建一个功能分支
- 提交 Pull Request
📜 许可证
本项目根据 MIT 许可证授权 - 有关详细信息,请参阅 LICENSE 文件。
🙏 鸣谢
本项目的改进很大程度上归功于 sweir1/notion-server,他进行了以下更新:
- 增强了 Markdown 支持,增加了更多块类型
- 完善的数据库操作
- 改进的错误处理和调试
- 更好的数据库条目属性处理
- 更清晰的页面输出格式
要使用 sweir1 的版本,您可以克隆他们的存储库:
git clone https://github.com/sweir1/notion-server.git
推荐服务器
Apple MCP Server
通过 MCP 协议与 Apple 应用(如“信息”、“备忘录”和“通讯录”)进行交互,从而使用自然语言发送消息、搜索和打开应用内容。

Notion API MCP Server
使用 Notion API 实现高级待办事项列表管理和内容组织,支持创建数据库、动态筛选和协作任务跟踪等功能。
Todoist MCP Server
将 Claude 与 Todoist 集成,实现自然语言任务管理,支持使用日常语言进行项目和版块组织、任务创建、更新、完成和删除。
Curri MCP Server
通过管理文本笔记、提供笔记创建工具以及使用结构化提示生成摘要,从而实现与 Curri API 的交互。
Inkdrop MCP Server
通过模型上下文协议将 Inkdrop 笔记应用与 Claude AI 集成,允许 Claude 在您的 Inkdrop 数据库中搜索、阅读、创建和更新笔记。
Notion MCP Server
通过将 Notion API 作为 LLM 的工具公开,从而实现与 Notion 的交互。这使得可以通过自然语言无缝地进行读取、创建、更新和删除 Notion 页面等操作。

Obsidian MCP REST Server
为人工智能助手提供一个标准化的接口,通过本地 REST API 与 Obsidian vault 进行交互,从而实现笔记的读取、写入、搜索和管理。

MCP Tasks Organizer
一个 MCP 服务器,可以将 Cursor agent 计划转换为结构化的 Markdown 任务列表,并将其组织在您的存储库中,帮助您将 AI 生成的计划和建议作为可执行的规范进行跟踪。

Branch Thinking MCP Server
一个 MCP 服务器,用于通过分支导航思维过程,支持思维交叉引用和优先级跟踪,以增强洞察力生成和结构化想法探索。

MCP-AnkiConnect
一个 MCP 服务器,集成了 Claude 和 Anki 抽认卡,允许用户直接通过对话复习到期卡片并创建新的抽认卡。 (Alternatively, a slightly more formal translation:) 一个 MCP 服务器,整合了 Claude 与 Anki 闪卡功能,使用户能够通过对话直接复习待复习的卡片并创建新的闪卡。 **Explanation of Choices:** * **MCP Server:** I kept this as "MCP 服务器" as it's likely a specific technical term that's best left untranslated unless more context is provided. * **Claude:** Left as "Claude" as it's a proper noun (the name of the AI). * **Anki flashcards:** Translated as "Anki 抽认卡" (chōu rèn kǎ) or "Anki 闪卡" (shǎn kǎ). Both are common translations for "flashcards" in the context of Anki. "抽认卡" is slightly more formal. * **Review due cards:** Translated as "复习到期卡片" (fùxí dàoqí kǎpiàn) or "复习待复习的卡片" (fùxí dài fùxí de kǎpiàn). Both convey the meaning of reviewing cards that are due for review. The second option is slightly more explicit. * **Create new flashcards:** Translated as "创建新的抽认卡" (chuàngjiàn xīnde chōu rèn kǎ) or "创建新的闪卡" (chuàngjiàn xīnde shǎn kǎ). * **Directly through conversation:** Translated as "直接通过对话" (zhíjiē tōngguò duìhuà). The choice between the two options depends on the desired level of formality and explicitness.