Skip to main content
Glama

Notion MCP Server

by ghubnerr

Not MCP 服务器

用于与 Notion 工作区集成的模型上下文协议 (MCP) 服务器。该服务器为 AI 模型提供了访问、查询和修改 Notion 内容的标准化接口。

先决条件

  • Node.js(v16 或更高版本)
  • Notion API 密钥(来自您的Notion 集成
  • 具有适当权限的连接 Notion 工作区

安装

  1. 克隆此存储库:
    git clone https://github.com/yourusername/notion-mcp-server.git cd notion-mcp-server
  2. 安装依赖项:
    npm install
  3. 使用您的 Notion API 密钥在根目录中创建一个.env文件:
    # Required NOTION_API_KEY=your_notion_api_key_here # Optional settings DEBUG=false REQUIRE_CONFIRMATION_FOR_CREATE=true REQUIRE_CONFIRMATION_FOR_UPDATE=true REQUIRE_CONFIRMATION_FOR_DELETE=true UPDATE_POLLING_INTERVAL=60000 MAX_BLOCK_DEPTH=3 BACKUP_DIR=./backups BACKUP_RETENTION_DAYS=30 MAX_BACKUPS_PER_PAGE=5
  4. 构建项目:
    npm run build
  5. 启动服务器:
    npm start

与 Claude for Desktop 一起使用

要将此 Notion MCP 服务器与 Claude for Desktop 一起使用:

  1. 确保 Claude for Desktop 已安装并更新至最新版本
  2. 打开Claude for Desktop的配置文件:
    • 在 macOS 上: ~/Library/Application Support/Claude/claude_desktop_config.json
    • 在 Windows 上: %APPDATA%\Claude\claude_desktop_config.json
  3. 添加服务器配置:
    { "mcpServers": { "notion": { "command": "node", "args": ["/path/to/notion-mcp-server/build/index.js"], "env": { "NOTION_API_KEY": "your_notion_api_key_here" } } } }
  4. 保存文件并重新启动 Claude for Desktop

资源

服务器公开以下资源:

资源 URI描述
notion://databases列出工作区中的所有数据库
notion://databases/{databaseId}/schema检索特定数据库的架构
notion://databases/{databaseId}/content从特定数据库中检索所有页面/项目
notion://pages/{pageId}检索特定页面的内容
notion://updates检索工作区中最近的更新和更改

工具

该服务器提供以下工具:

提示

服务器包括以下预配置的提示:

提示名称描述
upcoming-deadlines获取即将到来的截止日期列表
project-status总结项目状态
daily-tasks获取今天的任务列表

示例查询

一旦连接到 Claude,您就可以询问有关 Notion 工作区的自然语言问题:

  1. “今天我的工作区中有哪些任务需要完成?”
  2. “显示 X 项目的状态”
  3. “在我的‘想法’数据库中创建一个新页面,标题为‘新功能概念’”
  4. “将任务 Y 的状态更新为‘已完成’”
  5. “过去 24 小时内我的工作区发生了哪些变化?”
  6. “总结下周的截止日期”
  7. “显示页面 abc123 的所有备份”
  8. “从备份文件page_abc123_2023-01-01.json恢复页面abc123”

扩展服务器

要添加新功能:

  1. 添加资源:扩展index.ts中的资源处理程序
  2. 添加工具:在index.ts中创建新的工具定义
  3. 添加提示:在index.ts中定义新的提示模板
  4. 增强 API 集成:在notion-api.ts中添加新的 API 函数

日志

检查服务器日志以获取详细的错误信息:

  • Claude 桌面日志:在 Claude 日志目录中查找与 MCP 相关的日志
  • 服务器输出:检查服务器日志的标准输出和错误流
-
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.

模型上下文协议服务器为 AI 模型提供标准化接口来访问、查询和修改 Notion 工作区中的内容。

  1. 先决条件
    1. 安装
      1. 与 Claude for Desktop 一起使用
        1. 资源
          1. 工具
            1. 提示
            2. 示例查询

          Related MCP Servers

          • -
            security
            A
            license
            -
            quality
            A Model Context Protocol server that provides a standardized interface for interacting with Notion's API, enabling users to list databases, create pages, and search across their Notion workspace.
            Last updated -
            95
            Python
            MIT License
            • Apple
          • A
            security
            A
            license
            A
            quality
            A Model Context Protocol (MCP) server that exposes the official Notion SDK, allowing AI models to interact with Notion workspaces.
            Last updated -
            17
            77
            7
            TypeScript
            Apache 2.0
            • Apple
            • Linux
          • A
            security
            F
            license
            A
            quality
            A Model Context Protocol server that connects Claude and other AI assistants to your Notion workspace, allowing AIs to interact with databases, pages, and blocks.
            Last updated -
            12
            0
            10
            JavaScript
            • Apple
          • A
            security
            F
            license
            A
            quality
            A Model Context Protocol server that connects AI assistants like Claude to Notion workspaces, enabling them to view, search, create, and update Notion databases, pages, and content blocks.
            Last updated -
            12
            194
            JavaScript
            • Apple

          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/ghubnerr/Notion-MCP'

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