Notion待办事项管理服务

一个基于Notion API的个人待办事项管理服务,支持任务展示、添加和更新功能。

  • by Badhansen
  • Python
  • 本地部署
  • 31 星标
  • 更新于
在 GitHub 查看 Badhansen/notion-mcp

使用说明

概念mcp

一个简单的模型上下文协议(MCP)服务器,它集成了Notion的API来管理我的个人待办事项列表。

演示

视觉指南

MCP查询1的概念

MCP查询2的概念

MCP查询3的概念

先决条件

  • Python 3.11或更高版本
  • 具有API访问权限的Notion帐户
  • Notion集成令牌
  • 一个你想管理待办事项列表的Notion页面
  • 克劳德桌面clint

设置

通过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集成:
    • 首选https://www.notion.so/my-integrations
    • 创建新的集成
    • 复制API密钥
  2. 使用集成共享您的数据库/页面:
    • 打开带有数据库/表或页面的概念工作区。
    • 点击“…”菜单→ “添加连接”
    • 选择您的集成(按名称搜索)

配置

  1. 创建 .env 文件:
cp .env.example .env
  1. 在中配置Notion凭据 .env:
NOTION_TOKEN=<your-notion-api-token>
PAGE_ID=<your-notion-page-id>
NOTION_VERSION="2022-06-28"
NOTION_BASE_URL="https://api.notion.com/v1"
  1. 要按预期将其与Claude Desktop一起使用,您需要调整您的 claude_desktop_config.json 文件。 首选 Claude Desktop -> Settings -> Developer -> Edit Config。现在添加 Notion 服务器配置。
{
    "mcpServers": {
        "notion-mcp": {
            "command": "uv",
            "args": [
                "--directory",
                "/Users/username/Projects/Python/notion-mcp/src" /* Path to your project */,
                "run",
                "server.py"
            ]
        }
    }
}

发展

项目结构:

notion-mcp/
├── docs/
├── src/
│ └── server.py
├── .env
├── .python-version
├── README.md
├── pyproject.toml
└── uv.lock

支持功能

显示任务

要显示Notion工作区中的所有任务,请使用 show_all_todos 功能:

{
    "name": "show_all_todos",
    "arguments": {}
}

添加任务

要将新任务添加到Notion工作区,请使用 add_todo 功能:

{
    "name": "add_todo",
    "arguments": {
        "task": "Your task description"
    }
}

更新任务

要更新Notion工作区中的现有任务,请使用 complete_todo 功能:

{
    "name": "complete_todo",
    "arguments": {
        "task_id": "your-task-id"
    }
}

贡献

  1. 分叉存储库
  2. 创建特征分支
  3. 提交拉取请求

许可证

MIT许可证。有关详细信息,请参阅LICENSE文件。