Skip to main content
Glama
tiny-notion-mcp

tiny-notion-mcp

tiny-notion-mcp

一个轻量级的 Notion MCP 服务器,与官方 Notion MCP 相比,它能最大限度地减少 Token 使用量。

它不返回原始的 Notion API JSON,而是为每个工具返回最精简的有效表示:页面以纯 Markdown 格式返回,搜索结果则每条记录仅占一行。在实际应用中,这显著降低了读取密集型工作流中的 Token 消耗。

工具

工具

描述

notion_search

按标题搜索页面。以 TOON 格式返回,每条结果占一行。

notion_read

以 Markdown 格式读取页面。

notion_write

将 Markdown 追加到现有页面。

notion_create_page

在父页面下创建子页面,可选择性添加内容。

TOON 格式

搜索结果和页面创建响应使用紧凑的 TOON(Title | Object | Optional Notes,标题 | 对象 | 可选备注)格式:

Page title | page-id | https://notion.so/... | parent:<parent-id>

这使得搜索响应每条结果仅占一行,而不是数百个 Token 的 JSON。

Related MCP server: MCP Notion Server (@suncreation)

支持的块类型

读取 (notion_read)

块类型

Markdown 输出

段落

纯文本

标题 1 / 2 / 3

# / ## / ###

无序列表项

- item

有序列表项

1. item, 2. item, …

代码块

```lang … ```

表格

管道符分隔的行

子页面

[Subpage: title](id)

内联格式(粗体、斜体、粗斜体、删除线、下划线、内联代码、链接)均以 Markdown 格式保留。

写入 (notion_write)

写入时支持相同的块类型。Markdown 会被解析并作为原生 Notion 块追加到目标页面。

尚未实现 (v2)

以下块类型可被 Notion 识别但尚未处理。它们在读取时会被静默跳过,且无法写入:

  • 分割线 (---)

  • 引用块

  • 待办事项 / 复选框列表

  • 标注块 (Callout)

  • 折叠列表

  • 目录

  • 文件、图片和视频

已知限制

  • 不同列表类型之间的空段落块无法往返转换。 当页面中存在明确的空段落来分隔(例如)无序列表和有序列表时,该分隔符在“读取 → 写入”循环中会丢失。Markdown 在块之间自动添加的 "\n\n" 在视觉上是等效的,但在写入时不会生成 Notion 的空段落块。这是扁平化 Markdown 表示法的固有局限,在设计出 v2 格式之前将一直存在。

  • 表格标题标志无法往返转换。 Notion 表格可以在没有列标题行的情况下创建 (has_column_header: false)。当前的写入器总是设置 has_column_header: true,因为标准 Markdown 表格隐含了标题。写回的表格看起来相同,但会设置标题标志。

要求

  • Python 3.12+

  • 一个拥有您所需页面读/写权限的 Notion 集成令牌 (Integration Token)

安装

# From source
git clone https://github.com/your-username/tiny-notion-mcp
cd tiny-notion-mcp
pip install .

或者直接使用 uv 安装:

uv tool install .

配置

将您的 Notion 集成令牌设置为环境变量:

export NOTION_TOKEN=secret_...

NOTION_API_KEY 也可作为别名使用。

Claude Desktop / Claude Code

将服务器添加到您的 MCP 配置中:

{
  "mcpServers": {
    "tiny-notion-mcp": {
      "command": "tiny-notion-mcp",
      "env": {
        "NOTION_TOKEN": "secret_..."
      }
    }
  }
}

如果您使用 uv 安装到了隔离环境中,请使用完整路径:

{
  "mcpServers": {
    "tiny-notion-mcp": {
      "command": "uv",
      "args": ["run", "--", "tiny-notion-mcp"],
      "env": {
        "NOTION_TOKEN": "secret_..."
      }
    }
  }
}

开发

# Install with dev dependencies
pip install -e ".[dev]"

# Run tests
pytest

测试使用存根 NotionClient,不会进行真实的 API 调用。

设计目标

  • Token 效率优先。 每个响应在保持可操作性的前提下尽可能小。

  • 无中间文件。 所有内容均作为字符串内联返回 — 无临时文件,无文件路径引用。

  • 无需 Notion 账户即可测试。 NotionClient 接口采用注入方式,以便核心逻辑可以在隔离环境中进行测试。

Available Tools

9 tools
notion_create_pageA

Create a new page or database entry. Set parent_type='page_id' (default) for a subpage, or 'database_id' to insert a row into a database. For database entries, pass extra properties (Status, Date, etc.) as Notion property objects via the 'properties' field. Returns TOON format with the new page ID.

Inputs: parent_id (required), title (required), parent_type, properties, +1 more.

notion_delete_blockA

⚠️ DESTRUCTIVE — deletes a single block (moves to Notion's trash, recoverable within 30 days). Use notion_get_blocks to find the block ID first. Deleting a parent block (table, toggle) also deletes all its children.

Inputs: block_id (required).

notion_delete_pageA

⚠️ DESTRUCTIVE — moves a Notion page to trash. The page is recoverable from Notion's trash within 30 days. Only call this when the user explicitly asks to delete a page.

Inputs: page_id (required).

notion_get_blocksA

List all blocks on a page with their IDs. Returns one line per block: block-id | block_type | text_preview. If the response ends with 'MORE: ', pass that cursor as start_cursor to get the next batch. Use the block-id with notion_write's after_block_id to insert content after a specific block.

Inputs: page_id (required), start_cursor.

notion_query_databaseA

Query a Notion database and return results as a markdown table. Each row is one entry; columns match the database properties. An ID column is appended for follow-up reads or writes. If the response ends with 'MORE: ', pass that cursor as start_cursor to get the next batch.

Inputs: database_id (required), limit, start_cursor.

notion_readA

Read a Notion page as markdown. Returns markdown string directly. If the response ends with 'MORE: ', pass that cursor as start_cursor to read the next batch of blocks.

Inputs: page_id (required), start_cursor.

notion_update_pageA

Update properties of a Notion page or database entry. Pass a dict of Notion property objects, e.g. {"Status": {"status": {"name": "Done"}}} or {"Date": {"date": {"start": "2026-04-30"}}}.

Inputs: page_id (required), properties (required).

notion_writeA

Append markdown to a Notion page. Converts markdown to blocks. Pass after_block_id to insert the content after a specific block rather than at the end of the page. Use notion_read to find block IDs (each block object has an 'id' field).

Inputs: page_id (required), markdown (required), after_block_id.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.2/5.0

    Scored across 9 tools

    Disambiguation5/5

    Each tool targets a distinct Notion operation (create page, delete block, query database, etc.) with no overlapping functionality. The descriptions clearly differentiate between similar-sounding tools like notion_read (page as markdown) and notion_get_blocks (list block IDs).

    Naming Consistency5/5

    All tools follow a consistent `notion_<verb>_<noun>` pattern using snake_case. The verbs are descriptive and align with the action (create, delete, get, query, read, search, update, write), making the naming predictable and easy to follow.

    Tool Count5/5

    With 9 tools, the set is well-scoped for a Notion integration. Each tool serves a necessary core function without being excessive. The count is typical for such an API surface, allowing efficient coverage without overwhelming an agent.

    Completeness4/5

    The tools cover essential CRUD operations for pages and databases, plus search, block listing, and content writing. Missing are direct block update and database creation, but the existing set handles most common workflows. Minor gaps, but not critical.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      An MCP server that enables LLMs to interact with Notion workspaces via the Notion API, supporting page creation, database management, and content retrieval. It features markdown conversion to optimize token usage and enhanced error handling for more reliable workspace interactions.
      19
      1
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      A lightweight, read-only MCP server for Notion that enables searching, reading pages, and querying databases with token-efficient output and smart caching.
      29 npm
      5
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      A Notion MCP server that enables searching, exporting, and importing pages as markdown using browser credentials without admin or OAuth setup.
      91 npm
      2
      MIT