Skip to main content
Glama

Notion MCP

by danhilse

Not MCP 集成

一个简单的模型上下文协议 (MCP) 服务器,它与 Notion 的 API 集成,以便通过 Claude 管理我的个人待办事项列表。这是一个专门为我在 Notion 中极简的待办事项列表设置量身定制的基本实现。

重要提示

这是一个针对特定用例设计的个人项目:我的简单 Notion 待办事项列表,它只有三个属性:

  • 任务(标题)
  • 时间(仅可选择两个选项:“今天”或“稍后”)
  • 复选框(标记是否已完成)

概念数据库示例

虽然您可以将其用作您自己的 Notion 集成的起点,但您可能需要修改代码以匹配您的特定数据库结构和要求。

特征

  • 添加新的待办事项
  • 查看所有待办事项
  • 查看今天的任务
  • 勾选任务为已完成

先决条件

  • Python 3.10 或更高版本
  • Notion 帐户
  • Notion 集成(API 密钥)
  • 与上述结构完全匹配的 Notion 数据库(或愿意修改适合您结构的代码)

设置

  1. 克隆存储库:
git clone https://github.com/yourusername/notion-mcp.git cd notion-mcp
  1. 设置Python环境:
python -m venv .venv source .venv/bin/activate # On Windows use: .venv\Scripts\activate uv pip install -e .
  1. 创建 Notion 集成:
  2. 通过集成共享您的数据库:
    • 在 Notion 中打开你的待办事项数据库
    • 点击“…”菜单→“添加连接”
    • 选择您的集成
  3. 创建.env文件:
NOTION_API_KEY=your-api-key-here NOTION_DATABASE_ID=your-database-id-here
  1. 配置Claude桌面:
{ "mcpServers": { "notion-todo": { "command": "/path/to/your/.venv/bin/python", "args": ["-m", "notion_mcp"], "cwd": "/path/to/notion-mcp" } } }

运行服务器

该服务器可以通过两种方式运行:

  1. 直接从命令行:
# From the project directory with virtual environment activated python -m notion_mcp
  1. 通过 Claude Desktop 自动执行(推荐):
  • 如果在claude_desktop_config.json中正确配置,服务器将在 Claude 启动时启动
  • 无需手动服务器管理
  • Claude 关闭时服务器停止

注意:直接运行时,除非出现错误,否则服务器不会显示任何输出 - 这是正常的,因为它正在等待 MCP 命令。

用法

通过 Claude 执行的基本命令:

  • “显示我的所有待办事项”
  • “我今天的计划是什么?”
  • “添加今日待办事项:检查电子邮件”
  • “添加稍后任务:审查项目”

限制

  • 仅适用于特定的 Notion 数据库结构
  • 不支持复杂的数据库模式
  • 仅限于“今天”或“稍后”的任务安排
  • 不支持附加属性或自定义字段
  • 基本错误处理
  • 没有重复任务、优先级或标签等高级功能

定制

如果您想要将其与不同的数据库结构一起使用,则需要修改server.py文件,特别是:

  • create_todo()函数用于匹配数据库属性
  • call_tool()中的 todo 格式用于处理您的数据结构
  • 如果您想要不同的选项,请使用list_tools()中的输入模式

项目结构

notion_mcp/ ├── pyproject.toml ├── README.md ├── .env # Not included in repo └── src/ └── notion_mcp/ ├── __init__.py ├── __main__.py └── server.py # Main implementation

执照

MIT 许可证 - 使用风险自负

致谢

  • 专为与 Claude Desktop 配合使用而设计
  • 使用 Notion 的 API
-
security - not tested
A
license - permissive license
-
quality - not tested

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

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

  1. 重要提示
    1. 特征
      1. 先决条件
        1. 设置
          1. 运行服务器
            1. 用法
              1. 限制
                1. 定制
                  1. 项目结构
                    1. 执照
                      1. 致谢

                        Related MCP Servers

                        • A
                          security
                          A
                          license
                          A
                          quality
                          MCP Server for the Notion API, enabling Claude to interact with Notion workspaces.
                          Last updated -
                          18
                          1,230
                          699
                          TypeScript
                          MIT License
                        • -
                          security
                          A
                          license
                          -
                          quality
                          A Model Context Protocol server that integrates with Notion's API to manage personal todo lists, allowing users to view, add, and update tasks directly from Claude.
                          Last updated -
                          13
                          Python
                          MIT License
                        • A
                          security
                          A
                          license
                          A
                          quality
                          A Model Context Protocol (MCP) server that provides tools for managing todo items, including creation, updating, completion, deletion, searching, and summarizing tasks.
                          Last updated -
                          10
                          22
                          TypeScript
                          MIT License
                        • -
                          security
                          F
                          license
                          -
                          quality
                          A Model Context Protocol server that enables Claude and other LLMs to interact with Notion workspaces, providing capabilities like searching, retrieving, creating and updating pages, as well as managing databases.
                          Last updated -
                          734
                          3
                          TypeScript

                        View all related MCP servers

                        MCP directory API

                        We provide all the information about MCP servers via our MCP API.

                        curl -X GET 'https://glama.ai/api/mcp/v1/servers/danhilse/notion_mcp'

                        If you have feedback or need assistance with the MCP directory API, please join our Discord server