Notion Mcp

io.github.shck-dev由 GitHub 账号 shck-dev 发布v0.5.2更新于 Oct 24, 2026

Notion MCP server — search, export, and import pages as markdown

发布方自己的服务:Notion

概览

AI 生成的概览

让助手搜索 Notion 工作区,并以 Markdown 导出、导入、追加和创建页面,还能管理评论与图片。

可以做什么
通过 Notion 内部网页 API 搜索账号可见的全部页面,将页面导出为 Markdown,并把 Markdown 字符串或本地文件写回页面。导入会替换页面原有内容,追加则只在末尾添加、不改动已有内容。还可创建子页面、上传本地图片或引用外部图片链接,以及列出、新增和回复评论讨论。
适用场景
适合希望助手以 Markdown 读写 Notion 页面、又不想创建 Notion 集成或等待工作区管理员审批的场景。适用于账号本身已有相应页面访问权限的个人或小团队工作流。
运行要求
通过 npx 以 stdio 在本地运行,需要 Node.js 18 或更高版本(或 Bun)。需要从浏览器获取三个值:NOTION_TOKEN(token_v2 cookie)、NOTION_USER_ID 和 NOTION_SPACE_ID,以环境变量方式提供或由 init 命令保存。需要访问 Notion 的网络连接。
安装前请注意
NOTION_TOKEN 是会话 cookie,可访问账号能看到的一切内容,应视为完整账号凭据,且会定期失效。导入类工具会替换页面全部现有内容,评论、图片和创建类工具会写入工作区。该服务器依赖未公开的内部 API,可能随 Notion 更新而失效,Markdown 转换也可能丢失部分格式。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Notion Mcp,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

[MCP Badge]

@shck-dev/notion-mcp

Notion MCP Server — search, export, and import pages as markdown

[npm version] [npm downloads] [license]

No workspace admin. No OAuth. No page sharing.
Just paste 3 values from your browser and go.

Blog Post | GitHub | npm


Features

  • Search — full-text search across your entire workspace
  • Export — download any page as clean markdown (headings, lists, to-do, code blocks, tables, links, images with viewable URLs)
  • Import — write markdown back to Notion pages (replaces content), from a string or local file
  • Append — add markdown to the end of a page without touching existing content
  • Create — spin up new child pages, optionally prefilled from a markdown string or file
  • Images — upload a local image to a page, or reference an external URL
  • Comments — list open discussions, add new comments, reply to threads
  • One-command setup — npx @shck-dev/notion-mcp init: paste a browser "Copy as cURL" and it extracts + saves your credentials
  • Prompts & resources — a notion_setup prompt and a notion://guide resource for in-client onboarding
  • Zero setup friction — uses the same internal API as the Notion web app; if you can see it in your browser, this server can access it

Tools

ToolDescription
notion_searchFull-text search across all pages in your workspace
notion_export_pageExport any Notion page as markdown; image links resolve to viewable CDN URLs (pass image_dir to download images locally instead)
notion_import_pageWrite markdown to a Notion page — replaces all existing content
notion_import_page_from_fileWrite a local .md file to a page — replaces all content
notion_append_to_pageAppend markdown to the end of a page (non-destructive)
notion_append_to_page_from_fileAppend a local .md file to the end of a page (non-destructive)
notion_create_pageCreate a new sub-page, optionally prefilled with markdown
notion_create_page_from_fileCreate a new sub-page from a local .md file
notion_add_imageAppend an image to the end of a page — local file is uploaded to Notion, http(s) URL is referenced as-is
notion_list_commentsList open discussion threads on a page
notion_add_commentStart a new discussion — inline (anchored to text) or block-level
notion_reply_commentReply to an existing discussion thread
notion_initPaste a browser "Copy as cURL" to extract & save credentials

Why not the official Notion API?

This MCP serverOfficial Notion API
SetupPaste 3 values from DevToolsCreate integration, get admin approval, share pages
Page accessEverything you can seeOnly explicitly shared pages
MarkdownBidirectional (export + import)Read-only blocks API
AuthCookie (token_v2)OAuth / integration token

Trade-off: The internal API is undocumented and may change. Token expires periodically (re-grab from browser).

Quick start

Easiest: interactive setup

bash
npx @shck-dev/notion-mcp init

Open Notion in Chrome → DevTools (F12) → Network → click any request to notion.so/api/v3/… → right-click → Copy as cURL, then paste it and press Ctrl-D. Your token, user id, and workspace id are extracted and saved to ~/.notion-mcp/config.json. Then register the server — no env block needed:

bash
claude mcp add notion -- npx @shck-dev/notion-mcp

Prefer to set the three values by hand? Steps below.

1. Get credentials from your browser

  1. Open notion.so in Chrome
  2. Press F12 → Application → Cookies → www.notion.so
  3. Copy the token_v2 cookie value → NOTION_TOKEN
  4. Press F12 → Network tab, do any action in Notion
  5. Find a POST request to api/v3/*, click it
  6. From Request Headers: copy x-notion-active-user-header → NOTION_USER_ID
  7. From Request Body (Payload): find spaceId → NOTION_SPACE_ID

2. Configure your MCP client

Claude Code
bash
claude mcp add notion -- env NOTION_TOKEN=your_token NOTION_USER_ID=your_user_id NOTION_SPACE_ID=your_space_id npx @shck-dev/notion-mcp
Claude Desktop / Cursor / any MCP client

Add to your MCP config (claude_desktop_config.json, .cursor/mcp.json, etc.):

json
{  "mcpServers": {    "notion": {      "command": "npx",      "args": ["@shck-dev/notion-mcp"],      "env": {        "NOTION_TOKEN": "your_token_v2_value",        "NOTION_USER_ID": "your_user_id",        "NOTION_SPACE_ID": "your_space_id"      }    }  }}

Requirements

  • Node.js ≥ 18 (for npx) — or Bun. The published server is compiled to node-compatible JS, so Bun is no longer required to run it.

Limitations

  • Internal API — undocumented, may break with Notion updates
  • Token expiry — token_v2 expires periodically; re-grab from browser when auth fails
  • Databases — database/collection pages don't export rows yet; sub-pages render as links and such pages return an explanatory note instead of empty output
  • Block granularity — import replaces all content, append adds to the end (no in-place editing of individual blocks)
  • Lossy markdown — some complex formatting may simplify during conversion (e.g. nested lists flatten on import)
  • External images — http(s) image URLs added via notion_add_image (or embedded in markdown) are referenced as-is and not re-uploaded to Notion

License

MIT

来源:README.md,提交 736e785

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.5.2最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

其他 Notion 集成