基本能力
产品定位
Notion MCP Server 是一个用于与 Notion 工作区进行交互的中间件,旨在通过标准化的工具集实现语言模型与 Notion 的无缝集成。
核心功能
- 页面操作
- 搜索 Notion 工作区
- 创建带有丰富 Markdown 内容的新页面
- 读取页面内容并格式化
- 更新现有页面
- 添加和检索评论
-
块级操作(更新、删除)
-
增强的 Markdown 支持
- 多级标题(H1-H3)
- 支持语言的代码块
- 带有复选框状态的交互式待办事项
- 多行支持的块引用
- 水平分隔线
- 带有标题的图像
-
嵌套项目符号
-
数据库操作
- 创建和管理数据库
- 添加和更新数据库项
- 使用过滤器和排序进行查询
- 支持多种属性类型(标题、富文本、数字、选择、多选、日期、复选框等)
适用场景
- 自动化 Notion 内容管理
- 集成 Notion 到语言模型工作流
- 批量处理 Notion 页面和数据库
- 开发基于 Notion 的自动化工具
工具列表
- 页面操作工具
- 搜索页面
- 读取页面
- 创建页面
-
更新页面
-
数据库操作工具
- 创建数据库
- 查询数据库
常见问题解答
- 如何设置 Notion 访问权限?
- 创建 Notion 集成并配置适当的权限
-
将集成连接到需要访问的页面
-
如何更新页面内容?
-
使用
update_page
工具,提供页面 ID 和新内容 -
如何查询数据库?
- 使用
query_database
工具,提供数据库 ID 和可选过滤器和排序条件
使用教程
使用依赖
- Node.js (v16 或更高版本)
- Notion API 密钥
- MCP 兼容客户端(如 Claude Desktop)
安装教程
-
克隆仓库:
bash
git clone https://github.com/v-3/notion-server.git
cd notion-server -
安装依赖:
bash
npm install -
设置环境:
```bash
echo "NOTION_API_KEY=your_notion_api_key_here" > .env
或直接导出
export NOTION_API_KEY=your_notion_api_key_here
```
- 构建服务器:
bash
npm run build
调试方式
-
更新 Claude Desktop 配置:
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 应用更改
-
测试创建页面:
typescript
const result = await notion.create_page({
parentPageId: "page_id",
title: "My Page",
content: "# Welcome\nThis is a test page."
});