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 整合