Skip to main content
Glama

NotionMCP Light

by karaage0703

NotionMCP Light

NotionMCP Light 是一个模型上下文协议 (MCP) 服务器,它使用 Notion API 将 Markdown 文件与 Notion 页面同步。

概述

该项目是为了解决 Notion 官方模型上下文协议 (MCP) 服务器效率低下的问题而开发的,该服务器以块的形式读取和写入 Markdown 并消耗 LLM 令牌。我们提供了一个非官方的 MCP 服务器,允许您直接通过 API 将 Markdown 文件与 Notion 页面/数据库同步,而无需使用令牌。

功能

  • Markdown → Notion
    • 将 H1 识别为页面标题
    • 将 Markdown 内容创建为 Notion 页面或数据库页面
    • 可以指定数据库ID
    • 直接使用 Notion API(无需令牌)
  • 概念→Markdown
    • 将给定页面或数据库中的页面转换为 Markdown 格式。
    • 输出标题为 H1
    • 将块结构转换为 Markdown
    • 保存到文件
  • MCP 服务器支持
    • 符合模型上下文协议 (MCP)
    • 提供可从 Cursor 和 Cline 等 AI 工具调用的端点
    • 基于 stdio 的 JSON-RPC

安装

安装依赖项

# uvがインストールされていない場合は先にインストール # pip install uv # 依存関係のインストール uv sync

设置 Notion API 令牌

  1. Notion Developers上创建一个帐户并获取 API 令牌。
  2. 您可以在环境变量中设置它,或者创建一个.env文件并设置令牌。
# .envファイルの例 NOTION_TOKEN=your_notion_api_token

如何使用

启动 MCP 服务器

使用紫外线时(推荐)
uv run python -m src.main

或者,如果您想直接指定令牌:

uv run python -m src.main --token your_notion_api_token
如果你使用常规 Python
python -m src.main

或者,如果您想直接指定令牌:

python -m src.main --token your_notion_api_token

在 Cline/Cursor 中设置

要将 NotionMCP Light 与 Cline/Cursor 等 AI 工具一起使用,请将以下设置添加到mcp_settings.json文件:

"notion-mcp-light": { "command": "uv", "args": [ "run", "--directory", "/path/to/notion-mcp-light", "python", "-m", "src.main" ], "env": { "NOTION_TOKEN": "your_notion_api_token" }, "disabled": false, "alwaysAllow": [] }

/path/to/notion-mcp-light替换为 NotionMCP Light 的安装目录。

如何使用 MCP 工具

NotionMCP Light 提供以下 MCP 工具:

上传Markdown

上传您的 Markdown 文件并将其创建为 Notion 页面。

{ "jsonrpc": "2.0", "method": "uploadMarkdown", "params": { "filepath": "path/to/markdown.md", "database_id": "optional_database_id", "page_id": "optional_parent_page_id" }, "id": 1 }

下载Markdown

下载您的 Notion 页面并将其保存为 Markdown 文件。

{ "jsonrpc": "2.0", "method": "downloadMarkdown", "params": { "page_id": "notion_page_id", "output_path": "path/to/output.md" }, "id": 2 }

执照

该项目根据 MIT 许可证发布。请参阅LICENSE文件以了解详细信息。

-
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.

一个模型上下文协议服务器,无需使用 LLM 令牌即可将 Markdown 文件与 Notion 页面同步,从而能够通过 API 调用直接与 Notion 数据库和页面进行交互。

  1. 概述
    1. 功能
      1. 安装
        1. 安装依赖项
        2. 设置 Notion API 令牌
      2. 如何使用
        1. 启动 MCP 服务器
        2. 在 Cline/Cursor 中设置
      3. 如何使用 MCP 工具
        1. 上传Markdown
        2. 下载Markdown
      4. 执照

        Related MCP Servers

        • -
          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
        • -
          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 -
          275
          2
          TypeScript
        • -
          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 server that converts Markdown content to HTML format.
          Last updated -
          1
          2,839
          3
          TypeScript
          MIT License
          • 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/karaage0703/notion-mcp-light'

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