Notion Mcp Server

io.github.awkoy由 GitHub 帳號 awkoy 發布v3.3.1更新於 Nov 6, 2026

Token-auth Notion MCP: pages, databases, blocks, comments, files. Runs headless in CI and agents.

發布方自己的服務:Notion

概覽

AI 產生的概覽

以權杖驗證的 Notion MCP 伺服器,讓助理搜尋、讀取、建立與編輯頁面,查詢資料庫、留言並上傳檔案。

可以做什麼
  • 搜尋頁面與資料庫,以 Markdown 或含屬性的方式讀取頁面,檢視區塊內容
  • 建立與編輯頁面,設定標題與屬性,附加或更新區塊,移動與還原頁面
  • 建立與查詢資料庫與資料來源,列出、查詢與管理檢視
  • 列出、新增、更新與刪除留言,列出工作區使用者
  • 從 base64、公開網址或本機路徑上傳檔案,並解析檔案連結與圖片
  • 呼叫前查看任一操作的 schema 與範例,並把可批次的寫入合併為一次呼叫
適用情境
適合讓助理以自然語言操作 Notion 工作區:找出資料庫中的資料列、起草或改寫頁面、在筆記下留言,或一次批次重新命名大量頁面。也適合 CI、排程工作與背景代理等無人值守情境,因為它使用權杖驗證,不需瀏覽器登入。
執行需求
透過 npx(需 Node.js)或已發布的 Docker 映像以 stdio 在本機執行。需在 NOTION_TOKEN 環境變數提供 Notion 個人存取權杖或內部整合密鑰;NOTION_PAGE_ID 為選用的預設父頁面。需能連線 api.notion.com。選用設定涵蓋速率限制、唯讀模式、操作允許/封鎖清單、上傳限制與 HTTP 傳輸。
安裝前請注意
該權杖可存取權杖持有者能看到的全部內容,任何能連上 HTTP 端點的人都以該權杖身分行動。寫入操作會變更工作區內容,封存、移至垃圾桶與刪除無法透過 API 復原;可用 NOTION_READ_ONLY、操作封鎖清單或 NOTION_CONFIRM_DESTRUCTIVE 加以限制。上傳可讀取本機檔案,應設定 NOTION_UPLOAD_ROOT;開啟 NOTION_UPLOAD_ALLOW_PRIVATE_URLS 會讓網址抓取觸及私有位址。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Notion Mcp Server,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

Notion MCP Server — Connect Claude, Cursor, VS Code & Codex to Notion

[npm version] [npm downloads] [License: MIT]

notion-mcp-server is a Model Context Protocol (MCP) server that gives Claude Code, Claude Desktop, Cursor, VS Code, Codex and any other MCP client read/write access to Notion with one token. Your AI can search, create and edit pages, query databases, comment and upload files, in plain language.

  • Token auth on every Notion plan, Free included. No browser sign-in, so it also runs headless: in CI, cron jobs, background agents and on your own server.
  • Light on context. Its three tools cost 1,005 tokens at connection, against 17,163 for Notion's open-source server, and page reads come back 82% smaller. Benchmark →
  • Built for agents. Batched writes with atomic rollback and idempotency keys, retry on rate limits, markdown in and out, and errors that tell the model how to fix the call.

Quick start

1. Get a Notion token. Open app.notion.com/developers/tokens → + New token → name it, pick your workspace → Create token → copy the ntn_… value. A Personal Access Token sees everything you can see, with no per-page sharing. Can't create one? See the other token option.

2. Install it.

bash
npx add-mcp notion-mcp-server --env NOTION_TOKEN=ntn_paste_your_token_here

add-mcp finds the MCP clients on your machine and writes the config for the ones you pick: Claude Code, Claude Desktop, Cursor, VS Code, Codex, Gemini CLI, Cline, Windsurf, Zed and more. Add -g to install for your user instead of the current project.

Keep the --env flag. Without it the entry is written without a token, and every call fails with an auth error.

Or install in one click:

[Install in Cursor] [Install in VS Code] [Claude Desktop extension]

  • Cursor: replace YOUR_NOTION_TOKEN in the generated entry.
  • VS Code (Copilot agent mode): it asks for the token and stores it as a secret.
  • Claude Desktop: double-click the .mcpb file (or drag it into Settings → Extensions) and paste your token. No Node.js needed. New to all this? The step-by-step walkthrough assumes nothing.

Using Claude Code? Install it as a plugin instead. The plugin bundles the server with a Notion workflow skill, which teaches Claude when to search, how to filter a database with where, and how to batch writes. Claude Code asks for the token when you install it (or later with /plugin configure notion-mcp-server@awkoy) and keeps it in your system keychain:

/plugin marketplace add awkoy/notion-mcp-server/plugin install notion-mcp-server@awkoy

The plugin runs the npm release that matches its own version and needs Node.js 22 or later. It also offers a default parent page and a read-only switch; the plugin's README has the details.

Manual setup: JSON config, Claude Code, Codex, Gemini CLI, Docker

Any client that reads an mcpServers block (Cursor's ~/.cursor/mcp.json, Claude Desktop's claude_desktop_config.json, Cline, Zed, Continue…):

json
{  "mcpServers": {    "notion": {      "command": "npx",      "args": ["-y", "notion-mcp-server"],      "env": { "NOTION_TOKEN": "ntn_paste_your_token_here" }    }  }}

Claude Code:

bash
claude mcp add notion -s user -e NOTION_TOKEN=ntn_paste_your_token_here -- npx -y notion-mcp-server

Codex (~/.codex/config.toml):

toml
[mcp_servers.notion]command = "npx"args = ["-y", "notion-mcp-server"]env = { NOTION_TOKEN = "ntn_paste_your_token_here" }

Gemini CLI: gemini extensions install https://github.com/awkoy/notion-mcp-server asks for the token once and keeps it in your system keychain.

Docker (Podman, OrbStack and colima take the same flags; -i is required for stdio):

bash
claude mcp add notion -s user -e NOTION_TOKEN=ntn_paste_your_token_here \  -- docker run --rm -i -e NOTION_TOKEN ghcr.io/awkoy/notion-mcp-server:latest

3. Try it. In a new chat:

"Use Notion to make a page called 'Hello from my agent' and add a checklist of three things to try today."

Your AI calls notion_write and replies with a link to the new page.

What you can ask

  • "Find every row in my Tasks database where Status is 'Doing' and tell me which are overdue."
  • "Rename these 50 pages to the new convention." One batched call, not 50.
  • "Create a page from my 'Weekly review' template and fill in this summary."
  • "Rewrite that spec page: fix the headings and add a code sample." The page round-trips as markdown.
  • "Comment on yesterday's meeting notes with a one-paragraph summary."
  • "Upload this diagram to the design page."
  • "Look at the screenshot on that bug report and tell me what's wrong." The model gets the image itself.

Which Notion MCP should you use?

Best forAuthHeadless / CINotes
Notion hosted MCP (mcp.notion.com)Interactive chat in claude.ai, ChatGPT, Cursor; Notion AI featuresOAuth on every plan. MCP tokens on Business and Enterprise, created by workspace ownersBusiness and Enterprise onlyFirst-party and the largest tool set (meeting notes, SQL across data sources, Custom Agents); several tools need a paid plan or Notion AI
Notion open-source server—Token✅Notion calls it deprecated and "no longer actively maintained"
This serverAgents, automation, CI, self-hosting, long sessionsToken, every plan✅Actively maintained; 3 tools, batched and idempotent writes

To chat with Notion in claude.ai or ChatGPT, Notion's hosted connector is one click. Use this server when an agent runs unattended, when your plan has no MCP tokens, when context cost matters, or when you want it on your own host. Detailed comparison →

Configuration

Token: PAT or internal integration

Both go in the same NOTION_TOKEN env var; only where you get them differs.

Personal Access Token (recommended)Internal Integration (scoped)
Whereapp.notion.com/developers/tokens → + New tokenapp.notion.com/developers/connections → + New connection
ScopeEverything you can seeOnly pages where you clicked • • • → Connect → <integration>
Use whenDefault: personal and team workspacesYou can't create a PAT, or an admin wants explicit per-page scoping
  • Who can create a PAT. Workspace owners always can. On Free and Business plans only owners can by default, on Plus every member can, and admins can change the policy on Business and Enterprise. Guests can't.
  • Expiry and revoking. You pick the lifetime when you create it, a year at most. Revoke it on the same tokens page; it stops working immediately. Details: Notion's PAT guide.
  • object_not_found on a page you can see? That's an Internal Integration that was never Connected to the page. Connect it, or switch to a PAT.

Environment variables

Env varRequiredDefaultMeaning
NOTION_TOKEN✅—PAT (ntn_…) or Internal Integration secret
NOTION_PAGE_ID——Default parent for create_page / create_database when no parent is passed (page URL or id)
NOTION_RATE_LIMIT—3Requests per second (Notion's documented limit)
NOTION_READ_ONLY——true disables every write operation
NOTION_ALLOWED_OPERATIONS / NOTION_BLOCKED_OPERATIONS——Allowlist / blocklist of operations, see Restricting operations
NOTION_CONFIRM_DESTRUCTIVE——true asks you before a destructive operation runs
NOTION_UPLOAD_ROOT——Directory upload_file's local path source is confined to (/ for no limit). Unset: refused over HTTP, dot-named paths and system and app-data folders refused over stdio, see Files
NOTION_UPLOAD_MAX_BYTES—1073741824 (1 GiB)Largest file upload_file accepts from any source
NOTION_UPLOAD_URL_TIMEOUT_MS—30000Time limit for fetching a url source, redirects and body included
NOTION_UPLOAD_ALLOW_PRIVATE_URLS——true lets a url source reach private, loopback and link-local addresses
NOTION_FILE_URLS—fullref swaps Notion's long signed file URLs for short refs, see Files
HTTPS_PROXY / HTTP_PROXY——Send all outbound traffic through a proxy
NOTION_DAILY_LOG_PAGE_ID——Only used by the daily-log MCP prompt

HTTP variables are in Remote / HTTP transport. Upgrading from v1 or v2? Every env var still works; the tool names changed, see MIGRATION.md.

Restricting operations

NOTION_READ_ONLY=true turns off every write. For finer control, NOTION_ALLOWED_OPERATIONS and NOTION_BLOCKED_OPERATIONS take comma-separated operation names or presets: read, write, destructive (archive, trash and delete), or a family (pages, blocks, databases, data_sources, views, comments, users, files). The blocklist wins.

jsonc
{ "env": { "NOTION_ALLOWED_OPERATIONS": "read" } }                       // read-only{ "env": { "NOTION_BLOCKED_OPERATIONS": "destructive" } }                // everything except removals{ "env": { "NOTION_ALLOWED_OPERATIONS": "read,append_blocks,add_page_comment" } }

Disabled operations disappear from the tool schemas, so the model never sees them. The server prints what resolved at startup, for example Operation access: 22/48 enabled (allow=read; block=(none)).

To be asked instead of blocked, set NOTION_CONFIRM_DESTRUCTIVE=true: before a destructive operation runs, your client shows a yes/no dialog naming the target. The client has to support MCP elicitation. The full rules, the per-operation list and the limits of per-operation control are in docs/configuration.md.

Files

upload_file accepts base64, a public URL or a local path, up to NOTION_UPLOAD_MAX_BYTES (1 GiB by default). Since the model picks the source, the server guards the two it reads itself:

  • Local paths. Set NOTION_UPLOAD_ROOT to the directory uploads may come from; paths outside it are refused, symlinks included. Without it, path sources are off over HTTP, and over stdio a path is refused when it goes through a dot-named file or directory (~/.ssh, ~/.aws, .env) or lies under a system or app-data folder (/proc, /dev, ~/Library, %APPDATA%), where MCP clients keep your token. NOTION_UPLOAD_ROOT=/ turns the limit off. Inside a root every file is readable, .env and .git included, so over HTTP pick a root that holds only files you would hand to whoever can call the server.
  • URLs. http and https only. Every hop, redirects included, must resolve to a public address, so loopback, private networks and cloud metadata endpoints are refused; NOTION_UPLOAD_ALLOW_PRIVATE_URLS=true lifts that for an intranet. The fetch stops after NOTION_UPLOAD_URL_TIMEOUT_MS (30 s) or once the body passes the size limit.

Notion's signed file URLs are about 500 tokens each and expire within an hour. NOTION_FILE_URLS=ref replaces them in responses with short notion-file: refs that get_file_url and get_image resolve on demand. How refs work →

Remote / HTTP transport

The server speaks stdio by default. Set MCP_TRANSPORT=http to run it as a Streamable HTTP endpoint for web clients, networked agents and shared deployments:

bash
MCP_TRANSPORT=http PORT=3000 NOTION_TOKEN=ntn_xxx npx -y notion-mcp-server# -> notion-mcp-server vX.Y.Z running on http://127.0.0.1:3000/mcp
envdefaultmeaning
MCP_TRANSPORTstdioset to http to enable HTTP
PORT3000listen port (0 = OS-assigned)
HOST127.0.0.1bind address; 0.0.0.0 exposes it externally (only with MCP_AUTH_TOKEN)
MCP_AUTH_TOKEN—when set, every /mcp request must send Authorization: Bearer <token>
MCP_ALLOW_UNAUTHENTICATEDofftrue lets a non-loopback HOST start without MCP_AUTH_TOKEN, for when an authenticating proxy sits in front
MCP_ALLOWED_HOSTSlocalhost + bound hostcomma-list for the DNS-rebinding Host allowlist
MCP_ALLOWED_ORIGINSlocalhost originscomma-list for the browser Origin allowlist

⚠️ Whoever reaches /mcp acts as your NOTION_TOKEN. On loopback, the default, that means local processes only. A non-loopback HOST refuses to start without MCP_AUTH_TOKEN; put TLS in front of it too.

Over HTTP, upload_file takes no local paths unless NOTION_UPLOAD_ROOT is set, since the caller may not be on the server's machine. Base64 and URL sources work as usual, see Files.

bash
claude mcp add --transport http notion https://your-host/mcp \  --header "Authorization: Bearer <MCP_AUTH_TOKEN>"

Docker, health checks and protocol versions: docs/http-transport.md.

Tools and operations

Three tools, whichever of the 46 operations you end up calling: notion_read runs reads, notion_write runs writes, and notion_describe returns an operation's JSON Schema with a working example. Every id field also accepts a Notion URL, so paste what Share → Copy link gives you. Call examples, batch options and MCP resources: docs/operations.md.

Per-tool permissions

The read/write split lets you approve reads once and keep writes behind a prompt. In Claude Code's settings.json (where notion is whatever you named the server):

json
{ "permissions": { "allow": ["mcp__notion__notion_read", "mcp__notion__notion_describe"] } }

Operations menu (46 ops, plus two aliases)

AreaOperations
Pagescreate_page, get_page, set_page_title, set_page_property, set_page_properties, archive_page (alias: trash_page), restore_page, search_pages, move_page, get_page_markdown, update_page_markdown
Blocksappend_blocks, get_block, get_block_children, update_block, delete_block, batch_mixed_blocks
Databasescreate_database, query_database, update_database, delete_database
Data sourceslist_data_sources, get_data_source, update_data_source, delete_data_source, list_data_source_templates
Viewslist_views, get_view, query_view, create_view, update_view, delete_view
Commentslist_comments, add_page_comment, add_discussion_comment, get_comment, update_comment, delete_comment
Userslist_users, get_user, get_bot_user (alias: get_self)
Filesupload_file, list_file_uploads, get_file_upload, get_file_url, get_image

FAQ

Does it work on the Notion Free plan? Yes. A workspace owner can create a Personal Access Token on every plan, and the server needs nothing else.

Is there a Notion MCP server without OAuth? This one. It authenticates with a token, so nobody has to click Authorize. Notion's hosted MCP skips OAuth only on Business and Enterprise, with an MCP token a workspace owner creates.

Which clients does it work with? Any MCP client: Claude Code, Claude Desktop, Cursor, VS Code (Copilot agent mode), Codex, Gemini CLI, Cline, Windsurf, Zed, Continue, and local models through any MCP host. More in the FAQ.

Troubleshooting

  • "Notion auth failed" on every call: the token is missing, revoked or expired. Check NOTION_TOKEN in your client config, then that the token is still active at app.notion.com/developers/tokens. Installed with add-mcp without --env? Re-run it with the flag.
  • object_not_found / "Could not find …": an Internal Integration only sees pages Connected to it. Connect the page, or switch to a PAT.
  • "No parent page configured": pass parent in the call, or set NOTION_PAGE_ID.
  • multi_source_database: the database has several data sources. Call list_data_sources, then pass a data_source_id instead of the database_id.
  • A successful result carries warnings: the call ran. Each entry names a field that was ignored or a property name that was corrected.
  • Tools don't appear in Claude Desktop: a typo in the token (it must stay inside the quotes), or the app wasn't fully quit (Cmd+Q) before reopening.
  • Startup logs "Notion auth check failed" but tools work: the startup check is best effort; ignore it if calls succeed.
  • Docker exits at once or says "NOTION_TOKEN is not set": add -i, and write -e NOTION_TOKEN or -e NOTION_TOKEN=ntn_xxx, not -e NOTION_TOKEN ntn_xxx.

Still stuck? Check the FAQ or open a GitHub issue.

Privacy

The server runs on your machine or your own host and talks only to api.notion.com, over HTTPS, with the token you configure (or through your proxy when HTTPS_PROXY is set). No telemetry, no analytics, no server of ours in the path. The token stays where your MCP client keeps it. get_image fetches only the signed URLs Notion returns for files it hosts. upload_file reads a local file or fetches a URL only when asked to, and refuses URLs that resolve to private or loopback addresses. Notion's own handling of your data is covered by Notion's privacy policy.

Development

bash
git clone https://github.com/awkoy/notion-mcp-server.git && cd notion-mcp-servernpm install && npm run build && npm test

Architecture, running a local build in a client, and the end-to-end test against a real workspace: docs/development.md. PRs are welcome; run npm test before opening one.

License

MIT — see LICENSE.


mcp-name: io.github.awkoy/notion-mcp-server

來源:README.md,提交 8a27618

工具

3

notion_read

Notion Read

Run one Notion read operation by name. Nothing is modified. Call: { operation, payload } — payload carries that operation's fields. Common: search_pages { query }, get_page { page_id }, get_page_markdown { page_id }, query_database { database_id, where? }, get_block_children { block_id }. Responses are slimmed; pass verbose:true in payload for the raw Notion object. Every id field (page_id, block_id, database_id, view_id, …) also accepts a Notion URL, as copied from Share → Copy link. A block link's #fragment is used for block_id fields and a database link's ?v= for view_id fields. If the payload is malformed, the error response includes the schema + a working example so you can correct and retry in one round-trip. Call notion_describe(operation) ahead of time only for complex shapes (query_database filters).

輸入參數payload必填operation必填

notion_write

Notion Write

Run one Notion write operation by name. Archive, trash and delete operations remove content — confirm with the user before running them. Two ways to call: • Single: { operation: "set_page_title", payload: { page_id, title } } • Batch: { operation: "set_page_title", payload: { items: [{page_id, title}, ...], atomic?: false, idempotency_key?: "...", concurrency?: 3 } } create_page, append_blocks, update_block and update_page_markdown also take a markdown string. Responses are slimmed; pass verbose:true inside payload (single) or per item (batch) for the raw Notion object. Every id field (page_id, block_id, database_id, view_id, …) also accepts a Notion URL, as copied from Share → Copy link. If the payload is malformed, the error response includes the schema + a working example so you can correct and retry in one round-trip. Call notion_describe(operation) ahead of time only for complex shapes (block trees, database property definitions, batch_mixed_blocks).

輸入參數payload必填operation必填

notion_describe

Notion Describe

Return the JSON Schema and a working example for one operation, plus which tool runs it (notion_read or notion_write). Use this BEFORE calling the operation when the payload shape is non-trivial (query filters, structured block trees, database property definitions). For simple ops, just call it — errors carry the schema.

輸入參數operation必填

版本歷史

7
  1. v3.3.1最新Nov 6, 2026
  2. v3.3.0Oct 26, 2026
  3. v3.2.1Oct 18, 2026
  4. v3.1.2Oct 4, 2026
  5. v3.1.1Oct 1, 2026
  6. v3.1.0Sep 17, 2026
  7. v3.0.1Sep 16, 2026

評分

已滿足適用檢查項的 90%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分
  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

其他 Notion 整合