Skip to main content
Glama

Notion MCP Server

MIT License
13,722

Not MCP 服务器

notion-mcp-sm

该项目为Notion API实现了一个MCP 服务器

mcp-演示

安装

1.在Notion中设置集成:

转到https://www.notion.so/profile/integrations并创建一个新的内部集成或选择一个现有的集成。

创建 Notion Integration 代币

虽然我们限制了 Notion API 的公开范围(例如,您将无法通过 MCP 删除数据库),但将工作区数据暴露给 LLM 仍会带来不小的风险。注重安全的用户可能需要进一步配置集成的功能

例如,您可以通过从“配置”选项卡仅授予“读取内容”访问权限来创建只读集成令牌:

Notion Integration Token 功能显示已检查阅读内容

2. 将内容与集成连接起来:

确保相关页面和数据库已连接到您的集成。

为此,您需要访问该页面,单击 3 个点,然后选择“连接到集成”。

将集成令牌添加到 Notion 连接

3. 将 MCP 配置添加到您的客户端:
使用 npm:

将以下内容添加到您的.cursor/mcp.jsonclaude_desktop_config.json (MacOS: ~/Library/Application\ Support/Claude/claude_desktop_config.json

{ "mcpServers": { "notionApi": { "command": "npx", "args": ["-y", "@notionhq/notion-mcp-server"], "env": { "OPENAPI_MCP_HEADERS": "{\"Authorization\": \"Bearer ntn_****\", \"Notion-Version\": \"2022-06-28\" }" } } } }
使用 Docker:

使用 Docker 运行 MCP 服务器有两种选择:

选项 1:使用官方 Docker Hub 镜像:

将以下内容添加到您的.cursor/mcp.jsonclaude_desktop_config.json

{ "mcpServers": { "notionApi": { "command": "docker", "args": [ "run", "--rm", "-i", "-e", "OPENAPI_MCP_HEADERS", "mcp/notion" ], "env": { "OPENAPI_MCP_HEADERS": "{\"Authorization\":\"Bearer ntn_****\",\"Notion-Version\":\"2022-06-28\"}" } } } }

这种方法:

  • 使用官方 Docker Hub 镜像
  • 通过环境变量正确处理 JSON 转义
  • 提供更可靠的配置方法
选项 2:在本地构建 Docker 镜像:

您也可以在本地构建并运行 Docker 镜像。首先,构建 Docker 镜像:

docker-compose build

然后,将以下内容添加到您的.cursor/mcp.jsonclaude_desktop_config.json中:

{ "mcpServers": { "notionApi": { "command": "docker", "args": [ "run", "--rm", "-i", "-e", "OPENAPI_MCP_HEADERS={\"Authorization\": \"Bearer ntn_****\", \"Notion-Version\": \"2022-06-28\"}", "notion-mcp-server" ] } } }

别忘了将ntn_****替换成你的集成密钥。你可以在集成配置选项卡中找到它:

从开发者门户的“配置”选项卡复制集成令牌

示例

  1. 使用以下指令
Comment "Hello MCP" on page "Getting started"

AI 将正确规划两个 API 调用( v1/searchv1/comments ,以完成任务

  1. 类似地,以下指令将导致名为“Notion MCP”的新页面添加到父页面“Development”
Add a page titled "Notion MCP" to page "Development"
  1. 您也可以直接引用内容 ID
Get the content of page 1a6b35e6e67f802fa7e1d27686f017f2

发展

建造

npm run build

执行

npx -y --prefix /path/to/local/notion-mcp-server @notionhq/notion-mcp-server

发布

npm publish --access public
-
security - not tested
A
license - permissive license
-
quality - not tested

MCP 服务器支持与 Notion API 进行自然语言交互,允许用户在其 Notion 工作区内搜索、评论、创建页面和访问内容。

  1. 安装
    1. 1.在Notion中设置集成:
    2. 将内容与集成连接起来:
    3. 将 MCP 配置添加到您的客户端:
  2. 示例
    1. 发展

      Related MCP Servers

      • A
        security
        F
        license
        A
        quality
        A high-performance MCP server that integrates Notion into AI workflows, enabling interaction with Notion pages, databases, and comments through a standardized protocol.
        Last updated -
        8
        10
        13
        TypeScript
      • A
        security
        A
        license
        A
        quality
        An MCP server implementation that integrates Claude with Salesforce, enabling natural language interactions with Salesforce data and metadata for querying, modifying, and managing objects and records.
        Last updated -
        7
        87
        15
        TypeScript
        MIT License
      • A
        security
        A
        license
        A
        quality
        An MCP server implementation that integrates Claude with Salesforce, enabling natural language interactions with Salesforce data and metadata for querying, modifying, and managing objects and records.
        Last updated -
        7
        18
        4
        TypeScript
        MIT License
        • Apple
        • Linux
      • A
        security
        A
        license
        A
        quality
        Notion MCP Server is a MCP server implementation that enables AI assistants to interact with Notion's API.
        Last updated -
        13
        275
        91
        TypeScript
        MIT License

      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/hyunseok-ctrl/notion-mcp-server'

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