feat(notion): 添加Notion数据库集成功能和相关脚本
添加Notion数据库集成配置和访问脚本,包括: - 配置Notion MCP服务器设置 - 添加数据库查询、内容查看和添加功能 - 创建测试脚本和集成文档
This commit is contained in:
47
NOTION_INTEGRATION.md
Normal file
47
NOTION_INTEGRATION.md
Normal file
@@ -0,0 +1,47 @@
|
||||
# Notion 数据库集成
|
||||
|
||||
此项目已配置为通过 Model Context Protocol (MCP) 与 Notion 数据库进行集成。
|
||||
|
||||
## 配置详情
|
||||
|
||||
已在 `mcp_settings.json` 中添加了 Notion 服务器配置:
|
||||
|
||||
```json
|
||||
"notion": {
|
||||
"command": "npx",
|
||||
"args": [
|
||||
"-y",
|
||||
"@notionhq/notion-mcp-server"
|
||||
],
|
||||
"env": {
|
||||
"OPENAPI_MCP_HEADERS": "{\"Authorization\": \"Bearer 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\", \"Notion-Version\": \"2022-06-28\"}"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## 使用方法
|
||||
|
||||
### 1. 运行 Notion 数据库访问脚本
|
||||
|
||||
```bash
|
||||
python notion_database_access.py
|
||||
```
|
||||
|
||||
这将显示所有可访问的 Notion 数据库及其详细信息。
|
||||
|
||||
### 2. 手动测试 API
|
||||
|
||||
您也可以使用以下命令测试 API 连接:
|
||||
|
||||
```bash
|
||||
curl -H "Authorization: Bearer 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" \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "Notion-Version: 2022-06-28" \
|
||||
https://api.notion.com/v1/users/me
|
||||
```
|
||||
|
||||
## 注意事项
|
||||
|
||||
- 确保您的 Notion 集成已正确连接到所需的页面
|
||||
- 请妥善保管您的 API 密钥
|
||||
- 如果遇到权限错误,请检查 Notion 集成的权限设置
|
||||
Reference in New Issue
Block a user