这是一个简单的 Model Context Protocol (MCP) 服务器,它集成了 Notion API,主要用于管理个人的待办事项列表。
使用 Smithery 自动安装 Notion MCP:
npx -y @smithery/cli install @Badhansen/notion-mcp --client claude
git clone https://github.com/Badhansen/notion-mcp.git
cd notion-mcp
uv venv
source .venv/bin/activate
uv pip install -e .
创建 Notion 集成:
将您的数据库/页面与集成共享:
.env 文件:cp .env.example .env
.env 中配置 Notion 凭据:NOTION_TOKEN=<你的 Notion API 令牌>
PAGE_ID=<你的 Notion 页面 ID>
NOTION_VERSION="2022-06-28"
NOTION_BASE_URL="https://api.notion.com/v1"
claude_desktop_config.json 文件。
前往 Claude Desktop -> 设置 -> 开发人员 -> 配置文件 并编辑:{
"mcpServers": {
"notionMcp": {
"url": "http://localhost:5000",
"enabled": true
}
}
}
{
"command": "listTasks"
}
{
"command": "addTask",
"task": "购买杂货"
}
{
"command": "completeTask",
"taskId": "unique_task_id_123"
}
notion-mcp/
├── server.py # 主服务器文件
├── config.py # 配置参数
├── routes/ # 路由定义
│ ├── tasks.py # 待办事项相关路由
├── utils/ # 辅助函数
│ ├── notion_utils.py # Notion API 工具
└── README.md # 项目文档
本项目采用 MIT 协议。