kirvigen/notion-private-api-mcp

πŸ› οΈ Other Tools and Integrations
0 Views
0 Installs

πŸ“‡ 🏠 🍎 πŸͺŸ 🐧 - Unofficial Notion server via the private API (tokenv2): full read/write across your entire workspace with no integration token and no per-page sharing.

Quick Install

One-Click IDE Configuration
claude_desktop_config.json
{
  "mcpServers": {
    "kirvigen-notion-private-api-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "kirvigen-notion-private-api-mcp"
      ]
    }
  }
}
Or

Using an AI coding agent (Claude Code, Cursor, etc.)? Copy a ready-made prompt that tells it to fetch the setup instructions and install this server for you.

Documentation Overview

Notion Private API MCP Server

License: MIT Node.js MCP PRs Welcome

An unofficial Notion MCP server built on Notion's private API (token_v2). It gives Claude Desktop, Claude Code, Cursor and any other MCP client full read/write access to your entire Notion workspace β€” with no integration token and without sharing pages one by one.

Unlike servers built on the official Notion API, this one authenticates with your browser session cookie, so an LLM agent can search, read, create and edit any page your account can see β€” instantly, with zero setup in Notion. Built on the official @modelcontextprotocol/sdk (stdio transport).


Why this server?

This server (private API)Official Notion API / MCP
Setup in NotionNone β€” just your browser cookieCreate an integration + share each page
Access scopeEverything your account can seeOnly pages explicitly shared with the integration
Authtoken_v2 session cookieIntegration token / OAuth
Best forPersonal automation, full-workspace agentsProduction apps, multi-user, official support
Stability⚠️ Fragile, undocumentedβœ… Stable, supported

If you just want an agent over your own workspace without fighting integration permissions, this is the fastest path. For production / multi-tenant apps, use the official Notion MCP server.


Table of contents


⚠️ Important: this uses Notion's private API

This server talks to Notion's undocumented internal API (https://www.notion.so/api/v3), not the official public API:

  • Auth is your browser cookie (token_v2) β€” effectively your account password. Never commit it.
  • Notion can change or break this API at any time, and using it may be against Notion's ToS.
  • It is inherently fragile and not for production β€” use at your own risk, with your own data.

Quick start

git clone https://github.com/kirvigen/notion-private-api-mcp.git
cd notion-private-api-mcp
npm install
export NOTION_TOKEN_V2='your_token_v2'   # see "Configuration" below
npm start

Then register it in your MCP client (Claude Desktop / Claude Code).


Tools

ToolDescription
get_pageRead a page block and its metadata
get_blockRead a single block
get_block_childrenRead the direct child blocks of a page or block
get_style_documentationCatalog of supported block types & inline annotations (call before composing complex pages)
markdown_to_blocksPreview how Markdown parses into the simplified block JSON
create_pageCreate a child page under another page, from blocks or Markdown
append_blocksAppend blocks/Markdown to a page (at the end, or after a given block)
replace_page_contentReplace the direct child blocks of a page
update_block_textReplace the plain-text content of a block (e.g. a code block)
delete_blocksRemove (archive) direct child blocks from a page
sync_markdown_fileCreate or replace a page from a local Markdown file

Tool parameters are defined in src/server.js.


Configuration

Configured entirely through environment variables:

VariableRequiredDescription
NOTION_TOKEN_V2βœ…Your Notion session cookie (token_v2)
NOTION_PRIVATE_API_BASEβ€”API base URL (default: https://www.notion.so)

Getting your token_v2

  1. Log in to Notion in your browser: https://www.notion.so
  2. Open DevTools (F12) β†’ Application β†’ Cookies β†’ https://www.notion.so
  3. Copy the value of the token_v2 cookie.

πŸ”’ Treat it like a password. Keep it in your shell env or an untracked .env β€” never commit it.

cp .env.example .env   # then edit .env

Usage with MCP clients

Claude Desktop

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "notion-private": {
      "command": "node",
      "args": ["/absolute/path/to/notion-private-api-mcp/src/server.js"],
      "env": { "NOTION_TOKEN_V2": "your_token_v2" }
    }
  }
}

Claude Code

claude mcp add notion-private \
  --scope local \
  --env NOTION_TOKEN_V2='your_token_v2' \
  -- node /absolute/path/to/notion-private-api-mcp/src/server.js

The helper scripts ./run-desktop.sh and ./run-codex.sh resolve the repo path automatically and log to /tmp.


Example prompts

Once connected, just talk to your agent:

  • "Find my 'Q3 Roadmap' page in Notion and summarize it."
  • "Create a child page under titled 'Meeting notes' with today's action items."
  • "Append a TODO list to with these three tasks…"
  • "Sync my local CHANGELOG.md into the release-notes page."

Writing content

Tools that write accept a plain-JSON simplified block format:

[
  { "type": "heading_1", "text": "Release Notes" },
  { "type": "paragraph", "text": "First paragraph." },
  { "type": "to_do", "text": "Ship the feature", "checked": true },
  { "type": "toggle", "text": "Details", "children": [
    { "type": "bulleted_list_item", "text": "Item one" }
  ]}
]

Supported types: paragraph, heading_1/2/3, bulleted_list_item, numbered_list_item, to_do, toggle, quote, callout, code, divider.

You can also pass Markdown (a stable subset: headings, paragraphs, bullet/numbered lists, task items, blockquotes, fenced code, horizontal rules). Call get_style_documentation from your client for the authoritative, machine-readable catalog. Nested lists, tables and inline formatting are not implemented yet.


Troubleshooting / FAQ

Where do I get token_v2? See Getting your token_v2.

NOTION_TOKEN_V2 is required β€” the env var isn't set in the process that launches the server (check your MCP client's env block, not just your shell).

My token stopped working β€” token_v2 expires when your Notion session ends (logout, password change, long inactivity). Grab a fresh cookie and update it.

MemcachedCrossCellError β€” a transient Notion routing error on multi-cell workspaces. The client already retries and falls back to loadPageChunk; just retry the call if it surfaces.

Is this against Notion's ToS? It uses an undocumented internal API. Use only with your own account and data, at your own risk.


Project layout

src/
β”œβ”€β”€ server.js         # MCP server: tool registration + stdio transport
β”œβ”€β”€ notion-client.js  # Private-API client (cookie auth, transactions, retries)
β”œβ”€β”€ notion-blocks.js  # Builds Notion block trees from simplified blocks
β”œβ”€β”€ markdown.js       # Markdown β†’ simplified-block parser
└── style-docs.js     # Catalog returned by get_style_documentation

Contributing

Issues and PRs are welcome. If this saved you time, please ⭐ the repo β€” it genuinely helps others discover it.


License

MIT Β© kir.vigen

Disclaimer

Not affiliated with Notion Labs, Inc. Relies on an undocumented internal API; by using it you accept all risks, including possible account restrictions and breakage when the API changes. Use only with your own data.

Related MCP Servers

modelcontextprotocol/server-everythingVerified

πŸ“‡ 🏠 - MCP server that exercises all the features of the MCP protocol

πŸ› οΈ Other Tools and Integrations1 views
0xMassi/webclaw

πŸ¦€ 🏠 🍎 🐧 - Web content extraction for AI agents. 10 tools: scrape, crawl, map, batch, extract, summarize, diff, brand, search, research. TLS fingerprinting bypasses anti-bot without a browser. 67% fewer tokens than raw HTML. npx create-webclaw auto-configures Claude, Cursor, Windsurf, Codex, OpenCode.

πŸ› οΈ Other Tools and Integrations0 views
2niuhe/plantuml_web

🐍 🏠 ☁️ 🍎 πŸͺŸ 🐧 - A web-based PlantUML frontend with MCP server integration, enable plantuml image generation and plantuml syntax validation.

πŸ› οΈ Other Tools and Integrations0 views
2niuhe/qrcode_mcp

🐍 🏠 🍎 πŸͺŸ 🐧 - A QR code generation MCP server that converts any text (including Chinese characters) to QR codes with customizable colors and base64 encoding output.

πŸ› οΈ Other Tools and Integrations0 views

Engagement

Views
0
Installs
0
Upvotes
0

Views and upvotes are unique per visitor network (hashed IP). Installs count copy actions.

Status

Health: Not checked yet

We have not completed a health check for this listing yet.

No check timestamp yet.

Unclaimed listing (imported or pending owner verification). Claim it β†’
β˜… Spotlight Slot

Feature Your MCP Server

Get maximum visibility for your server across our directory, search results, and detail pages.

Spotlight Your Server

Own this project?

This directory is pre-filled from public sources. Claim via GitHub README, site badge, or DNS TXT to get the verified badge and attach your website.

Claim this listing

Promote this listing

Optional paid placement. Free listings stay free forever.

Share & Embed

Add our SVG badge (dark/light directory styles) or embeddable widget to your site.