io.github.ai-aviate/better-notion

编码与调试

by ai-aviate

Operate Notion with a single Markdown document — read, create, and update pages in one call.

什么是 io.github.ai-aviate/better-notion

Operate Notion with a single Markdown document — read, create, and update pages in one call.

README

better-mcp-notion

Japanese / 日本語

An MCP server that lets you operate Notion with a single Markdown document.

Existing Notion MCP servers are thin API wrappers that require multiple round-trips for a single operation. better-mcp-notion uses one Markdown document (YAML frontmatter + body) to read, create, and update pages in a single call.

Why better-mcp-notion?

Traditional Notion MCPbetter-mcp-notion
Tools16-22 tools9 tools
Create a DB entry3+ calls (search DB, get schema, create page, append blocks)1 call
Edit a page4+ calls (get page, get blocks, delete blocks, append blocks)1 call (read, edit, write)
FormatRaw JSON blocksMarkdown
Context windowHeavy (tool definitions + JSON)Light

Tools

ToolDescription
readRead a Notion page as Markdown with frontmatter. Supports recursive child page reading with depth.
writeCreate or update pages from Markdown. Supports batch operations and append/prepend.
searchSearch the workspace by keyword. Returns a Markdown-formatted list.
listList database records as a table or child pages as a list. Supports natural language filter & sort.
updateQuick property update without rewriting content. Just pass page + key-value pairs.
schemaView or modify database schema — add, remove, or rename columns.
commentAdd or read comments on a page.
deleteArchive (soft-delete) a page.
moveMove a page to a different parent page or database.

Quick Start

1. Create a Notion Integration

  1. Go to notion.so/profile/integrations and create a new integration
  2. Copy the API key (ntn_...)
  3. Share the pages/databases you want to access with the integration ("Connect to" in the page menu)

2. Add to your MCP client

Claude Code

bash
claude mcp add better-notion -- npx better-mcp-notion

Then set the environment variable:

bash
export NOTION_API_KEY=ntn_your_api_key_here

Claude Desktop / Cursor / Windsurf

Add to your MCP config file (e.g. claude_desktop_config.json, .cursor/mcp.json):

json
{
  "mcpServers": {
    "better-notion": {
      "command": "npx",
      "args": ["-y", "better-mcp-notion"],
      "env": {
        "NOTION_API_KEY": "ntn_your_api_key_here"
      }
    }
  }
}

From source

bash
git clone https://github.com/ai-aviate/better-mcp-notion.git
cd better-mcp-notion
npm install && npm run build

Then point your MCP config to node /path/to/better-mcp-notion/build/index.js.

Usage

Read a page

code
read({ page: "https://notion.so/My-Page-abc123def456" })

Returns:

markdown
---
id: abc123-def456
title: My Page
database: task-db-id
properties:
  Status: In Progress
  Tags:
    - backend
---
## Notes
- Completed API design

Create a page

code
write({ markdown: `
---
title: Meeting Notes
parent: "Project Alpha"
icon: "📝"
---
## Agenda
- Review progress
- Discuss next steps
` })

Create a database entry

code
write({ markdown: `
---
title: Fix login bug
database: "Task Board"
properties:
  Status: In Progress
  Tags:
    - backend
    - urgent
  Due Date: "2026-03-01"
---
## Description
Login fails when password contains special chars.
` })

Update a page (edit the output from read)

code
write({ markdown: `
---
id: abc123-def456
title: Updated Title
properties:
  Status: Done
---
## New content
Body replaces all existing blocks.
` })

Append content to an existing page

Use position: "append" to add content to the end without rewriting the entire page. Only the new content needs to be provided — existing content is preserved.

code
write({ markdown: `
---
id: abc123-def456
---
## New section
This is added to the end of the page.
`, position: "append" })

position: "prepend" adds content to the beginning instead.

Batch create (multiple pages in one call)

Separate pages with ===:

code
write({ markdown: `
---
title: Task 1
database: "Task Board"
properties:
  Status: Todo
---
Task 1 details
===
---
title: Task 2
database: "Task Board"
properties:
  Status: Todo
---
Task 2 details
` })

Query a database with filters

code
list({
  target: "Task Board",
  filter: "Status is Done AND Priority is High",
  sort: "Due Date ascending"
})

Filter syntax

  • Status is Done / Status = Done - equals
  • Priority != Low - not equals
  • Tags contains backend - multi-select contains
  • Done is true - checkbox
  • Score > 80 - number comparison (>, <, >=, <=)
  • Due Date after 2026-03-01 - date after/before
  • Combine with AND: Status is Done AND Priority is High

Sort syntax

  • Due Date ascending or Due Date asc
  • Created descending or Created desc

Read with child pages

code
read({ page: "parent-page-id", depth: 2 })

depth: 1 = current page only (default), 2 = include children, 3 = include grandchildren.

Quick property update

Update properties without rewriting content:

code
update({ page: "My Task", properties: { "Status": "Done", "Priority": "High" } })

Manage database schema

code
// View schema
schema({ database: "Task Board" })

// Add a column
schema({ database: "Task Board", action: "add", property: "Priority", type: "select", options: ["Low", "Medium", "High"] })

// Rename a column
schema({ database: "Task Board", action: "rename", property: "Due", name: "Due Date" })

// Remove a column
schema({ database: "Task Board", action: "remove", property: "Old Column" })

Comments

code
// Read comments
comment({ page: "abc123" })

// Add a comment
comment({ page: "abc123", body: "Looks good! Ready to ship." })

Frontmatter Reference

Write (create/update)

FieldCreateUpdateDescription
id-requiredPage ID to update
titlerecommendedoptionalPage title
parentrequired*ignoredParent page name or ID
databaserequired*ignoredDatabase name or ID (*either parent or database)
iconoptionaloptionalEmoji or image URL
coveroptionaloptionalCover image URL
propertiesoptionaloptionalDatabase properties (matched against schema)

Read (output only)

FieldDescription
idPage UUID
urlNotion page URL
titlePage title
parent / databaseParent page or database ID
icon, coverEmoji or image URL
propertiesAll database properties
created, last_editedTimestamps (read-only)

Read-only fields (url, created, last_edited, formulas, etc.) are safely ignored when passed to write.

Development

bash
npm run dev          # TypeScript watch mode
npm test             # Run tests
npm run test:watch   # Test watch mode

License

Elastic License 2.0 (ELv2) — Free to use, modify, and distribute. Cannot be offered as a managed/hosted service.

常见问题

io.github.ai-aviate/better-notion 是什么?

Operate Notion with a single Markdown document — read, create, and update pages in one call.

相关 Skills

网页构建器

by anthropics

Universal
热门

面向复杂 claude.ai HTML artifact 开发,快速初始化 React + Tailwind CSS + shadcn/ui 项目并打包为单文件 HTML,适合需要状态管理、路由或多组件交互的页面。

在 claude.ai 里做复杂网页 Artifact 很省心,多组件、状态和路由都能顺手搭起来,React、Tailwind 与 shadcn/ui 组合效率高、成品也更精致。

编码与调试
未扫描114.1k

前端设计

by anthropics

Universal
热门

面向组件、页面、海报和 Web 应用开发,按鲜明视觉方向生成可直接落地的前端代码与高质感 UI,适合做 landing page、Dashboard 或美化现有界面,避开千篇一律的 AI 审美。

想把页面做得既能上线又有设计感,就用前端设计:组件到整站都能产出,难得的是能避开千篇一律的 AI 味。

编码与调试
未扫描114.1k

网页应用测试

by anthropics

Universal
热门

用 Playwright 为本地 Web 应用编写自动化测试,支持启动开发服务器、校验前端交互、排查 UI 异常、抓取截图与浏览器日志,适合调试动态页面和回归验证。

借助 Playwright 一站式验证本地 Web 应用前端功能,调 UI 时还能同步查看日志和截图,定位问题更快。

编码与调试
未扫描114.1k

相关 MCP Server

GitHub

编辑精选

by GitHub

热门

GitHub 是 MCP 官方参考服务器,让 Claude 直接读写你的代码仓库和 Issues。

这个参考服务器解决了开发者想让 AI 安全访问 GitHub 数据的问题,适合需要自动化代码审查或 Issue 管理的团队。但注意它只是参考实现,生产环境得自己加固安全。

编码与调试
83.4k

by Context7

热门

Context7 是实时拉取最新文档和代码示例的智能助手,让你告别过时资料。

它能解决开发者查找文档时信息滞后的问题,特别适合快速上手新库或跟进更新。不过,依赖外部源可能导致偶尔的数据延迟,建议结合官方文档使用。

编码与调试
52.2k

by tldraw

热门

tldraw 是让 AI 助手直接在无限画布上绘图和协作的 MCP 服务器。

这解决了 AI 只能输出文本、无法视觉化协作的痛点——想象让 Claude 帮你画流程图或白板讨论。最适合需要快速原型设计或头脑风暴的开发者。不过,目前它只是个基础连接器,你得自己搭建画布应用才能发挥全部潜力。

编码与调试
46.3k

评论