Notion Mcp

Notion Mcp

🚀 个人待办事项列表的简单 MCP 服务器(Notion 集成)

这是一个简单的 Model Context Protocol (MCP) 服务器,它集成了 Notion API,主要用于管理个人的待办事项列表。

🚀 快速开始

演示

视觉指南

Notion MCP 查询 1

Notion MCP 查询 2

Notion MCP 查询 3

✨ 主要特性

  • 显示任务:可列出所有待办事项。
  • 添加任务:支持创建新的待办事项。
  • 更新任务状态:能够标记任务为完成。

📦 安装指南

先决条件

  • Python 3.11 或更高版本
  • Notion 账户及 API 访问权限
  • Notion 集成令牌
  • 用于管理待办事项的 Notion 页面
  • Claude Desktop 客户端

安装步骤

通过 Smithery 安装

使用 Smithery 自动安装 Notion MCP:

npx -y @smithery/cli install @Badhansen/notion-mcp --client claude

手动安装

  1. 克隆仓库:
git clone https://github.com/Badhansen/notion-mcp.git
cd notion-mcp
  1. 设置 Python 环境:
uv venv
source .venv/bin/activate
uv pip install -e .
  1. 创建 Notion 集成:

  2. 将您的数据库/页面与集成共享:

    • 打开 Notion 工作区中的数据库/表格或页面
    • 点击菜单中的 "..."
    • 转到 "添加连接"
    • 选择您的集成(搜索名称)

配置

  1. 创建 .env 文件:
cp .env.example .env
  1. .env 中配置 Notion 凭据:
NOTION_TOKEN=<你的 Notion API 令牌>
PAGE_ID=<你的 Notion 页面 ID>
NOTION_VERSION="2022-06-28"
NOTION_BASE_URL="https://api.notion.com/v1"
  1. 要与 Claude Desktop 配合使用,请调整您的 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         # 项目文档

🤝 贡献指南

  1. Fork 仓库:在 GitHub 上 Fork 此项目。
  2. 创建分支:为新功能或修复创建新分支。
  3. 提交更改:提交您的修改并添加详细说明。
  4. Push 到远程仓库
  5. 打开 Pull Request:针对主分支提出合并请求。

📄 许可证

本项目采用 MIT 协议。

  • 0 关注
  • 0 收藏,21 浏览
  • system 提出于 2025-09-19 07:24

相似服务问题

相关AI产品