notion-private-api-mcp
Provides full read/write access to any Notion page visible to your account, allowing search, create, edit, and delete operations on pages and blocks using Notion's private API.
Notion Private API MCP Server
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 Notion | None — just your browser cookie | Create an integration + share each page |
Access scope | Everything your account can see | Only pages explicitly shared with the integration |
Auth |
| Integration token / OAuth |
Best for | Personal automation, full-workspace agents | Production 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.
Related MCP server: notion-full-mcp
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 startThen register it in your MCP client (Claude Desktop / Claude Code).
Tools
Tool | Description |
| Read a page block and its metadata |
| Read a single block |
| Read the direct child blocks of a page or block |
| Catalog of supported block types & inline annotations (call before composing complex pages) |
| Preview how Markdown parses into the simplified block JSON |
| Create a child page under another page, from blocks or Markdown |
| Append blocks/Markdown to a page (at the end, or after a given block) |
| Replace the direct child blocks of a page |
| Replace the plain-text content of a block (e.g. a code block) |
| Remove (archive) direct child blocks from a page |
| Create or replace a page from a local Markdown file |
Tool parameters are defined in
src/server.js.
Configuration
Configured entirely through environment variables:
Variable | Required | Description |
| ✅ | Your Notion session cookie ( |
| — | API base URL (default: |
Getting your token_v2
Log in to Notion in your browser: https://www.notion.so
Open DevTools (F12) → Application → Cookies →
https://www.notion.soCopy the value of the
token_v2cookie.
🔒 Treat it like a password. Keep it in your shell env or an untracked
.env— never commit it.
cp .env.example .env # then edit .envUsage 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.jsThe 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.mdinto 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_documentationContributing
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.
Available Tools
11 toolsappend_blocksAppend BlocksB
Append simplified blocks or Markdown to a page. Inserts at the end by default; pass after_block_id to insert immediately after a specific direct child block.
Inputs: page_id (required), markdown, blocks, after_block_id.
create_pageCreate Notion PageB
Create a child page under another page from blocks or Markdown.
Inputs: parent_page_id (required), title (required), markdown, blocks.
delete_blocksDelete BlocksA
Remove direct child blocks from a page and archive those blocks.
Inputs: page_id (required), block_ids (required).
get_blockGet Notion BlockB
Read a single Notion block through the private API.
Inputs: block_id (required).
get_block_childrenGet Notion Block ChildrenB
Read direct child blocks for a page or block through the private API.
Inputs: block_id (required).
get_pageGet Notion PageC
Read a Notion page through the Notion private API.
Inputs: page_id (required).
get_style_documentationNotion Style DocumentationA
Return the catalog of supported block types, inline annotations (bold/italic/code/link/color/mention), Markdown-to-Notion mapping and block format hints used by this MCP server. Call this before composing complex pages to know what styles you can produce.
Inputs: no named parameters.
markdown_to_blocksMarkdown To BlocksB
Convert Markdown into the simplified block JSON format.
Inputs: markdown (required).
replace_page_contentReplace Page ContentB
Replace direct child blocks of a page with blocks or Markdown.
Inputs: page_id (required), markdown, blocks.
sync_markdown_fileSync Markdown FileB
Create a new page or replace an existing page from a local Markdown file.
Inputs: file_path (required), page_id, parent_page_id, title.
update_block_textUpdate Block TextA
Replace the plain text content of a block (e.g. code block). Inline markdown is NOT parsed — text is stored verbatim.
Inputs: block_id (required), text (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 11 tools
Each tool targets a distinct operation: page vs block CRUD, content replacement, style documentation, and markdown conversion. No meaningful overlap exists between any two tools.
Most tools follow a verb_noun pattern (e.g., get_page, delete_blocks). However, markdown_to_blocks deviates by using a descriptor format, breaking the uniform convention.
With 11 tools, the set covers core Notion page and block operations, plus supporting utilities. The count is well-scoped for the private API's capabilities without being excessive.
The set covers basic content creation, reading, and modification, but lacks page metadata updates, page deletion, and search. These gaps may hinder some workflows but core content operations are present.
Maintenance
Related MCP Connectors
Hosted Notion MCP server for Claude, ChatGPT and Cursor, with each action switched per account.
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
MCP-native open-source Notion alternative: read & write pages, databases and kanban boards.
Official Fibery MCP server: query and update your workspace from any AI client via OAuth.
Related MCP Servers
- AlicenseCqualityDmaintenanceA Model Context Protocol (MCP) server that exposes the official Notion SDK, allowing AI models to interact with Notion workspaces.1733 npm10Apache 2.0
- AlicenseAqualityBmaintenanceFull-featured Notion MCP server enabling deep page reading, block editing, snapshot/restore, file uploads, table manipulation, page restore, and destructive page copying.33MIT
- AlicenseAqualityCmaintenanceRead-only MCP server that exposes your local Notion backups to AI agents — query databases, read pages, search a backed-up workspace. Offline by default: no LLM calls, no telemetry, no cloud.61MIT
- AlicenseBqualityBmaintenanceA lightweight MCP server for Notion that enables natural language management of pages, databases, and blocks through the current Notion API.12MIT