{
  "markdown": "<div align=\"center\">\n\n[![MCP Badge](https://lobehub.com/badge/mcp/shck-dev-notion-mcp?style=plastic)](https://lobehub.com/mcp/shck-dev-notion-mcp)\n\n# @shck-dev/notion-mcp\n\n**Notion MCP Server — search, export, and import pages as markdown**\n\n[![npm version](https://img.shields.io/npm/v/@shck-dev/notion-mcp)](https://www.npmjs.com/package/@shck-dev/notion-mcp)\n[![npm downloads](https://img.shields.io/npm/dm/@shck-dev/notion-mcp)](https://www.npmjs.com/package/@shck-dev/notion-mcp)\n[![license](https://img.shields.io/npm/l/@shck-dev/notion-mcp)](https://github.com/shck-dev/notion-mcp/blob/main/LICENSE)\n\nNo workspace admin. No OAuth. No page sharing.\\\nJust paste 3 values from your browser and go.\n\n[Blog Post](https://shck.dev/blog/notion-mcp) | [GitHub](https://github.com/shck-dev/notion-mcp) | [npm](https://www.npmjs.com/package/@shck-dev/notion-mcp)\n\n</div>\n\n---\n\n## Features\n\n- **Search** — full-text search across your entire workspace\n- **Export** — download any page as clean markdown (headings, lists, to-do, code blocks, tables, links, images with viewable URLs)\n- **Import** — write markdown back to Notion pages (replaces content), from a string or local file\n- **Append** — add markdown to the end of a page without touching existing content\n- **Create** — spin up new child pages, optionally prefilled from a markdown string or file\n- **Images** — upload a local image to a page, or reference an external URL\n- **Comments** — list open discussions, add new comments, reply to threads\n- **One-command setup** — `npx @shck-dev/notion-mcp init`: paste a browser \"Copy as cURL\" and it extracts + saves your credentials\n- **Prompts & resources** — a `notion_setup` prompt and a `notion://guide` resource for in-client onboarding\n- **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\n\n## Tools\n\n| Tool | Description |\n|------|-------------|\n| `notion_search` | Full-text search across all pages in your workspace |\n| `notion_export_page` | Export any Notion page as markdown; image links resolve to viewable CDN URLs (pass `image_dir` to download images locally instead) |\n| `notion_import_page` | Write markdown to a Notion page — **replaces** all existing content |\n| `notion_import_page_from_file` | Write a local `.md` file to a page — **replaces** all content |\n| `notion_append_to_page` | Append markdown to the **end** of a page (non-destructive) |\n| `notion_append_to_page_from_file` | Append a local `.md` file to the end of a page (non-destructive) |\n| `notion_create_page` | Create a new sub-page, optionally prefilled with markdown |\n| `notion_create_page_from_file` | Create a new sub-page from a local `.md` file |\n| `notion_add_image` | Append an image to the end of a page — local file is uploaded to Notion, http(s) URL is referenced as-is |\n| `notion_list_comments` | List open discussion threads on a page |\n| `notion_add_comment` | Start a new discussion — inline (anchored to text) or block-level |\n| `notion_reply_comment` | Reply to an existing discussion thread |\n| `notion_init` | Paste a browser \"Copy as cURL\" to extract & save credentials |\n\n## Why not the official Notion API?\n\n| | This MCP server | Official Notion API |\n|---|----------|-------------------|\n| **Setup** | Paste 3 values from DevTools | Create integration, get admin approval, share pages |\n| **Page access** | Everything you can see | Only explicitly shared pages |\n| **Markdown** | Bidirectional (export + import) | Read-only blocks API |\n| **Auth** | Cookie (`token_v2`) | OAuth / integration token |\n\n**Trade-off**: The internal API is undocumented and may change. Token expires periodically (re-grab from browser).\n\n## Quick start\n\n### Easiest: interactive setup\n\n```bash\nnpx @shck-dev/notion-mcp init\n```\n\nOpen 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:\n\n```bash\nclaude mcp add notion -- npx @shck-dev/notion-mcp\n```\n\nPrefer to set the three values by hand? Steps below.\n\n### 1. Get credentials from your browser\n\n1. Open [notion.so](https://notion.so) in Chrome\n2. Press **F12** → **Application** → **Cookies** → `www.notion.so`\n3. Copy the `token_v2` cookie value → `NOTION_TOKEN`\n4. Press **F12** → **Network** tab, do any action in Notion\n5. Find a POST request to `api/v3/*`, click it\n6. From **Request Headers**: copy `x-notion-active-user-header` → `NOTION_USER_ID`\n7. From **Request Body** (Payload): find `spaceId` → `NOTION_SPACE_ID`\n\n### 2. Configure your MCP client\n\n#### Claude Code\n\n```bash\nclaude 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\n```\n\n#### Claude Desktop / Cursor / any MCP client\n\nAdd to your MCP config (`claude_desktop_config.json`, `.cursor/mcp.json`, etc.):\n\n```json\n{\n  \"mcpServers\": {\n    \"notion\": {\n      \"command\": \"npx\",\n      \"args\": [\"@shck-dev/notion-mcp\"],\n      \"env\": {\n        \"NOTION_TOKEN\": \"your_token_v2_value\",\n        \"NOTION_USER_ID\": \"your_user_id\",\n        \"NOTION_SPACE_ID\": \"your_space_id\"\n      }\n    }\n  }\n}\n```\n\n## Requirements\n\n- **Node.js ≥ 18** (for `npx`) — or [Bun](https://bun.sh). The published server is compiled to node-compatible JS, so Bun is no longer required to run it.\n\n## Limitations\n\n- **Internal API** — undocumented, may break with Notion updates\n- **Token expiry** — `token_v2` expires periodically; re-grab from browser when auth fails\n- **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\n- **Block granularity** — import replaces all content, append adds to the end (no in-place editing of individual blocks)\n- **Lossy markdown** — some complex formatting may simplify during conversion (e.g. nested lists flatten on import)\n- **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\n\n## License\n\nMIT\n",
  "bytes": 6222,
  "sha": "72580cc25a174f6505ea2c8c34d7b0921d113a8d28b56c48b3ef911f0b1060d2",
  "repo_slug": "shck-dev/notion-mcp",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_shck_dev_notion_mcp_df9af9ce/readme"
}