{
  "markdown": "# Better Notion MCP\n\nmcp-name: io.github.n24q02m/better-notion-mcp\n\n**Markdown-first Notion for AI agents -- pages, databases, blocks, and comments in one call.**\n\n<!-- Badge Row 1: Status -->\n[![CI](https://github.com/n24q02m/better-notion-mcp/actions/workflows/ci.yml/badge.svg)](https://github.com/n24q02m/better-notion-mcp/actions/workflows/ci.yml)\n[![codecov](https://codecov.io/gh/n24q02m/better-notion-mcp/graph/badge.svg?token=D7FSDVVTAN)](https://codecov.io/gh/n24q02m/better-notion-mcp)\n[![npm](https://img.shields.io/npm/v/@n24q02m/better-notion-mcp?logo=npm&logoColor=white)](https://www.npmjs.com/package/@n24q02m/better-notion-mcp)\n[![Docker](https://img.shields.io/docker/v/n24q02m/better-notion-mcp?label=docker&logo=docker&logoColor=white&sort=semver)](https://hub.docker.com/r/n24q02m/better-notion-mcp)\n[![License: Apache-2.0](https://img.shields.io/github/license/n24q02m/better-notion-mcp)](LICENSE)\n\n<!-- Badge Row 2: Tech -->\n[![TypeScript](https://img.shields.io/badge/TypeScript-3178C6?logo=typescript&logoColor=white)](#)\n[![Node.js](https://img.shields.io/badge/Node.js-5FA04E?logo=nodedotjs&logoColor=white)](#)\n[![Notion](https://img.shields.io/badge/Notion_API-000000?logo=notion&logoColor=white)](#)\n[![semantic-release](https://img.shields.io/badge/semantic--release-e10079?logo=semantic-release&logoColor=white)](https://github.com/python-semantic-release/python-semantic-release)\n[![Renovate](https://img.shields.io/badge/renovate-enabled-1A1F6C?logo=renovatebot&logoColor=white)](https://developer.mend.io/)\n\n<!-- BEGIN: AUTO-GENERATED-CROSS-PROMO -->\n<details>\n  <summary><strong>Sister projects from n24q02m</strong> (click to expand)</summary>\n\n| Project | Tagline | Tag |\n|---|---|---|\n| [agent-chat-plugin](https://github.com/n24q02m/agent-chat-plugin) | Peer AI agents chat in a shared folder — no human relay, no orchestrator, wor... | Tooling |\n| [better-code-review-graph](https://github.com/n24q02m/better-code-review-graph) | Knowledge graph for token-efficient code reviews -- semantic search and call-... | MCP |\n| [better-drive](https://github.com/n24q02m/better-drive) | 2-way Google Drive sync with .driveignore filter — rclone engine, Windows tray | Tooling |\n| [better-email-mcp](https://github.com/n24q02m/better-email-mcp) | IMAP/SMTP email for AI agents -- read, send, organize folders, and manage att... | MCP |\n| [better-godot-mcp](https://github.com/n24q02m/better-godot-mcp) | Composite MCP server for Godot Engine -- 17 composite tools for AI-assisted g... | MCP |\n| [better-notion-mcp](https://github.com/n24q02m/better-notion-mcp) | Markdown-first Notion for AI agents -- pages, databases, blocks, and comments... | MCP |\n| [better-semantic-release](https://github.com/n24q02m/better-semantic-release) | Drop-in python-semantic-release fork with built-in release-safety guards (orp... | Tooling |\n| [better-telegram-mcp](https://github.com/n24q02m/better-telegram-mcp) | Telegram for AI agents -- messages, chats, media, and contacts across both bo... | MCP |\n| [better-workspace-mcp](https://github.com/n24q02m/better-workspace-mcp) | Google Workspace MCP server (Docs/Drive/Calendar/Gmail/Sheets/Slides/Tasks/Ch... | MCP |\n| [claude-plugins](https://github.com/n24q02m/claude-plugins) | Claude Code plugin marketplace for the n24q02m MCP servers -- install web sea... | Marketplace |\n| [imagine-mcp](https://github.com/n24q02m/imagine-mcp) | Image and video understanding + generation for AI agents -- across Gemini, Op... | MCP |\n| [jules-task-archiver](https://github.com/n24q02m/jules-task-archiver) | Chrome Extension for bulk operations on Jules tasks via batchexecute API -- a... | Tooling |\n| [mcp-core](https://github.com/n24q02m/mcp-core) | Shared foundation for building MCP servers -- Streamable HTTP transport, OAut... | MCP |\n| [mnemo-mcp](https://github.com/n24q02m/mnemo-mcp) | Persistent AI memory with hybrid search and embedded sync. Open, free, unlimi... | MCP |\n| [qwen3-embed](https://github.com/n24q02m/qwen3-embed) | Lightweight Qwen3 text embedding and reranking via ONNX Runtime and GGUF | Library |\n| [skret](https://github.com/n24q02m/skret) | Secrets without the server. | CLI |\n| [tacet](https://github.com/n24q02m/tacet) | A self-distilling neuro-symbolic cascade that amortises LLM cost across knowl... | Tooling |\n| [web-core](https://github.com/n24q02m/web-core) | Shared web infrastructure package for search, scraping, HTTP security, and st... | Library |\n| [wet-mcp](https://github.com/n24q02m/wet-mcp) | Open-source MCP server for AI agents: web search, content extraction, and lib... | MCP |\n\n</details>\n<!-- END: AUTO-GENERATED-CROSS-PROMO -->\n\n## Table of contents\n\n- [Features](#features)\n- [Install](#install)\n- [CLI](#cli)\n- [Remote (HTTP mode)](#remote-http-mode)\n- [Smithery](#smithery)\n- [Status](#status)\n- [Documentation](#documentation)\n- [Tools](#tools)\n- [Configuration](#configuration)\n- [Deploy to Cloudflare](#deploy-to-cloudflare)\n- [Comparison](#comparison)\n- [Security](#security)\n- [Build from Source](#build-from-source)\n- [Trust Model](#trust-model)\n- [License](#license)\n\n\n\n<a href=\"https://glama.ai/mcp/servers/n24q02m/better-notion-mcp\">\n  <img width=\"380\" height=\"200\" src=\"https://glama.ai/mcp/servers/n24q02m/better-notion-mcp/badge\" alt=\"Better Notion MCP server\" />\n</a>\n\n## Features\n\n- **Markdown in, Markdown out** -- human-readable content instead of raw JSON blocks\n- **8 composite tools, 39 actions** -- one call instead of chaining 2+ atomic Notion endpoints (plus `config`, `help`, and a relay-setup tool)\n- **Auto-pagination and bulk operations** -- no manual cursor handling or looping\n- **Tiered token optimization** -- ~77% reduction via compressed descriptions + on-demand `help` tool\n- **Dual transport** -- local stdio (integration token) or remote HTTP (OAuth 2.1, no token to paste)\n\n## Install\n\nRun with `npx` (Node.js >= 24) and a Notion integration token from <https://www.notion.so/my-integrations> (starts with `ntn_`):\n\n```jsonc\n// MCP client config (e.g. .mcp.json / Claude Code / Cursor)\n{\n  \"mcpServers\": {\n    \"better-notion-mcp\": {\n      \"command\": \"npx\",\n      \"args\": [\"--yes\", \"@n24q02m/better-notion-mcp@latest\"],\n      \"env\": { \"NOTION_TOKEN\": \"ntn_your_token_here\" }\n    }\n  }\n}\n```\n\nOr run the published Docker image (stdio):\n\n```bash\ndocker run --rm -i -e NOTION_TOKEN=ntn_your_token_here n24q02m/better-notion-mcp:latest\n```\n\nSee the [Documentation](#documentation) section for per-client setup (Claude Code, Codex, Gemini CLI, Cursor, Windsurf) and HTTP/OAuth mode.\n\n## CLI\n\nInstalling the package exposes a `better-notion-mcp` binary (run it with `npx` or after a global install). It has **no subcommands** -- running it starts the MCP server and speaks the protocol over stdin/stdout, so it is normally launched by an MCP client rather than by hand.\n\n```bash\n# Start the stdio server (default transport; requires NOTION_TOKEN)\nNOTION_TOKEN=ntn_your_token_here npx --yes @n24q02m/better-notion-mcp@latest\n\n# Start the remote HTTP server (OAuth 2.1) instead of stdio\nnpx --yes @n24q02m/better-notion-mcp@latest --http\n```\n\n| Argument / env | Effect |\n|:---------------|:-------|\n| _(none)_ | stdio transport (default); requires `NOTION_TOKEN` |\n| `--http` | HTTP transport with OAuth 2.1 (equivalent to `TRANSPORT_MODE=http` / `MCP_TRANSPORT=http`) |\n\nSee [Configuration](#configuration) for the full environment-variable reference.\n\n## Remote (HTTP mode)\n\nDeployed with the HTTP transport, the server is a remote endpoint gated by OAuth 2.1 -- no integration token to paste. Point an MCP client that supports remote HTTP servers at the host you deployed it on:\n\n```jsonc\n// MCP client config -- remote HTTP (OAuth 2.1)\n{\n  \"mcpServers\": {\n    \"better-notion-mcp\": {\n      \"type\": \"http\",\n      \"url\": \"https://<your-host>/mcp\"\n    }\n  }\n}\n```\n\nOn first connect the client opens Notion's OAuth consent screen; per-user access tokens are held in-process only (see [Trust Model](#trust-model)). To stand up such an instance, see [Self-Hosting (Remote Mode)](#self-hosting-remote-mode) and [Deploy to Cloudflare](#deploy-to-cloudflare).\n\n## Smithery\n\nThe repo ships a [`smithery.yaml`](smithery.yaml) config for [Smithery](https://smithery.ai). Smithery launches the server over stdio (`npx -y @n24q02m/better-notion-mcp`) and requires no install-time config -- provide your Notion credentials at runtime through the server's own setup flow (`NOTION_TOKEN` env, or the relay form; see [Configuration](#configuration)).\n\n## Status\n\n> **2026-05-02 -- Architecture stabilization update**\n>\n> Past months saw significant churn around credential handling and the daemon-bridge auto-spawn pattern. This caused multi-process races, browser tab spam, and inconsistent setup UX across plugins. **The architecture is now stable**: 2 clean modes (stdio + HTTP), no daemon-bridge layer, no auto-spawn from stdio.\n>\n> Apologies for the instability period. If you encountered issues with prior versions, please update to the latest release and follow the current [Setup guide](https://mcp.n24q02m.com/servers/better-notion-mcp/setup/) -- most prior workarounds are no longer needed.\n>\n> **Related plugins from the same author**:\n> - [wet-mcp](https://github.com/n24q02m/wet-mcp) -- Web search + content extraction\n> - [mnemo-mcp](https://github.com/n24q02m/mnemo-mcp) -- Persistent AI memory\n> - [imagine-mcp](https://github.com/n24q02m/imagine-mcp) -- Image/video understanding + generation\n> - [better-email-mcp](https://github.com/n24q02m/better-email-mcp) -- Email management\n> - [better-telegram-mcp](https://github.com/n24q02m/better-telegram-mcp) -- Telegram\n> - [better-godot-mcp](https://github.com/n24q02m/better-godot-mcp) -- Godot Engine\n> - [better-code-review-graph](https://github.com/n24q02m/better-code-review-graph) -- Code review knowledge graph\n>\n> All plugins share the same architecture -- install once, learn pattern transfers.\n\n## Documentation\n\nFull docs at **[mcp.n24q02m.com/servers/better-notion-mcp/](https://mcp.n24q02m.com/servers/better-notion-mcp/)**:\n\n- [Setup](https://mcp.n24q02m.com/servers/better-notion-mcp/setup/) -- install methods for Claude Code, Codex, Gemini CLI, Cursor, Windsurf, mcp.json\n- [Modes overview](https://mcp.n24q02m.com/get-started/modes-overview/) -- stdio (local, integration token) and HTTP (remote, OAuth 2.1)\n- [Multi-user setup](https://mcp.n24q02m.com/get-started/multi-user/) -- per-JWT-sub credential model (HTTP mode)\n\n**Install with AI agent** -- paste this to your AI coding agent:\n\n> Install MCP server `better-notion-mcp` following the steps at\n> https://raw.githubusercontent.com/n24q02m/claude-plugins/main/plugins/better-notion-mcp/setup-with-agent.md\n\n## Tools\n\nEight composite Notion tools (39 actions) plus three infrastructure tools (`config`, `config__open_relay`, `help`):\n\n| Tool | Actions | Description |\n|:-----|:--------|:------------|\n| `pages` | `create`, `get`, `get_property`, `update`, `move`, `archive`, `restore`, `duplicate` | Create, read, update, and organize pages |\n| `databases` | `create`, `get`, `query`, `create_page`, `update_page`, `delete_page`, `create_data_source`, `update_data_source`, `update_database`, `list_templates` | Database CRUD and page management within databases |\n| `blocks` | `get`, `children`, `append`, `update`, `delete` | Read and manipulate block content |\n| `users` | `list`, `get`, `me`, `from_workspace` | List and retrieve user information |\n| `workspace` | `info`, `search` | Workspace metadata and cross-workspace search |\n| `comments` | `list`, `get`, `create` | Page comments and discussion replies |\n| `content_convert` | `markdown-to-blocks`, `blocks-to-markdown` | Convert between Markdown and Notion blocks (uses a `direction` parameter) |\n| `file_uploads` | `create`, `send`, `complete`, `retrieve`, `list` | Upload files to Notion (single or multi-part) |\n| `config` | `status`, `setup_status`, `setup_start`, `setup_reset`, `setup_complete`, `set`, `cache_clear` | Inspect and manage credential state and configuration lifecycle |\n| `config__open_relay` | - | Open the relay configuration form in the browser and return the relay URL + credential state |\n| `help` | - | Get full documentation for any composite tool (`tool_name` parameter) |\n\n### MCP Resources\n\n| URI | Description |\n|:----|:------------|\n| `notion://docs/pages` | Page operations reference |\n| `notion://docs/databases` | Database operations reference |\n| `notion://docs/blocks` | Block operations reference |\n| `notion://docs/users` | User operations reference |\n| `notion://docs/workspace` | Workspace operations reference |\n| `notion://docs/comments` | Comment operations reference |\n| `notion://docs/content_convert` | Content conversion reference |\n| `notion://docs/file_uploads` | File upload reference |\n\n## Configuration\n\n| Variable | Required | Default | Description |\n|:---------|:---------|:--------|:------------|\n| `NOTION_TOKEN` | Yes (stdio) | - | Notion integration token |\n| `TRANSPORT_MODE` / `MCP_TRANSPORT` | No | `stdio` | Set either to `http` for remote mode (or pass `--http`) |\n| `PUBLIC_URL` | No (http) | - | Server's public URL for OAuth redirect links |\n| `NOTION_OAUTH_CLIENT_ID` | Yes (http) | - | Notion Public Integration client ID (or `--oauth-client-id=<id>` CLI flag, which overrides the env var) |\n| `NOTION_OAUTH_CLIENT_SECRET` | Yes (http) | - | Notion Public Integration client secret (or `--oauth-client-secret=<secret>` CLI flag, which overrides the env var) |\n| `MCP_AUTH_DISABLE` | No (http) | - | Set to `1` to skip Bearer JWT verification when behind an external auth gateway |\n| `PORT` | No | `0` (OS-assigned) | Server port; set explicitly (e.g. `8080`) to bind a fixed port |\n| `HOST` | No | - | Bind address (http mode) |\n\n### Self-Hosting (Remote Mode)\n\nYou can self-host the remote server with your own Notion OAuth app.\n\n**Prerequisites:**\n1. Create a **Public Integration** at <https://www.notion.so/my-integrations>\n2. Set the redirect URI to `https://your-domain.com/callback`\n3. Note your `client_id` and `client_secret`\n\n```bash\ndocker run -p 8080:8080 \\\n  -e TRANSPORT_MODE=http \\\n  -e PORT=8080 \\\n  -e PUBLIC_URL=https://your-domain.com \\\n  -e NOTION_OAUTH_CLIENT_ID=your-client-id \\\n  -e NOTION_OAUTH_CLIENT_SECRET=your-client-secret \\\n  n24q02m/better-notion-mcp:latest\n```\n\n## Deploy to Cloudflare\n\n[![Deploy to Cloudflare](https://deploy.workers.cloudflare.com/button)](https://deploy.workers.cloudflare.com/?url=https://github.com/n24q02m/better-notion-mcp)\n\nRun your own multi-user better-notion-mcp serverless on Cloudflare (Worker + Container + KV).\n\n**Prerequisites:** a Cloudflare account on the **Workers Paid plan** — required for Containers (the Cloudflare free tier does not include Containers) — and the `wrangler` CLI.\n\n1. `git clone https://github.com/n24q02m/better-notion-mcp && cd better-notion-mcp`\n2. `wrangler login`\n3. Provision the KV namespace and paste its id into `wrangler.jsonc`:\n   ```\n   wrangler kv namespace create better-notion-kv\n   ```\n4. Set secrets:\n   ```\n   wrangler secret put CREDENTIAL_SECRET\n   wrangler secret put NOTION_OAUTH_CLIENT_ID\n   wrangler secret put NOTION_OAUTH_CLIENT_SECRET\n   ```\n   `CREDENTIAL_SECRET` is REQUIRED: it derives a deterministic OAuth signing key so\n   user identity survives container recreation.\n5. Push the http image to the CF managed registry and deploy:\n   ```\n   wrangler containers push better-notion-mcp:beta\n   wrangler deploy\n   ```\n6. Complete the Notion OAuth flow in the browser at your Worker domain.\n\nPer-user Notion access tokens are encrypted into KV (`MCP_STORAGE_BACKEND=cf-kv`),\nso they survive scale-to-zero. Do NOT set `MCP_AUTH_DISABLE` on a shared/public\ndeployment — it collapses all users into a single token bucket.\n\n## Comparison\n\nHow better-notion-mcp stacks up against direct competitors in each pillar:\n\n| Capability | better-notion-mcp | makenotion/notion-mcp-server | suekou/mcp-notion-server | awkoy/notion-mcp-server |\n|---|---|---|---|---|\n| Markdown in / out | Yes (round-trip on pages + blocks) | No (raw Notion JSON) | partial (experimental, append + opt-in convert) | Yes (round-trip + GFM) |\n| Composite tool design | Yes (8 composite tools, 39 actions) | No (22 endpoint-mapped tools) | partial (simplified + raw JSON tools) | Yes (2 dispatch tools, 35+ ops) |\n| File uploads to Notion | Yes (`file_uploads`, single + multi-part) | No | No | Yes (`upload_file`, single + multi-part) |\n| Comments | Yes (`comments`: list/get/create) | Yes | Yes | Yes |\n| Remote HTTP + OAuth 2.1 transport | Yes (per-JWT-sub multi-user) | partial (HTTP + bearer token, no OAuth) | No (stdio token only) | No (stdio token only) |\n| Self-hostable | Yes (Docker, own OAuth app) | Yes | Yes | Yes |\n| License | Apache-2.0 | ? | MIT | MIT |\n\n## Security\n\n- **OAuth 2.1 + PKCE S256** -- Secure authorization with code challenge\n- **Rate limiting** -- 120 req/min/IP on HTTP transport\n- **Session owner binding** -- IP check + TTL for pending token binds\n- **Null safety** -- Handles Notion API quirks (comments.list 404, undefined rich_text)\n\n## Build from Source\n\n```bash\ngit clone https://github.com/n24q02m/better-notion-mcp.git\ncd better-notion-mcp\nbun install\nbun run dev\n```\n\n## Trust Model\n\nThis plugin implements **TC-NearZK** (in-memory, ephemeral). See [the trust model reference](https://mcp.n24q02m.com/servers/mcp-core/trust-model/) for full classification.\n\n| Mode | Storage | Encryption | Who can read your data? |\n|---|---|---|---|\n| HTTP n24q02m-hosted (default) | In-memory `Map<sub, OAuthToken>` | In-process only | Server process (cleared on restart) |\n| HTTP self-host | Same as hosted | Same | Only you (admin = user) |\n| stdio (local) | `config.enc` in the OS config dir (`%APPDATA%\\mcp\\Config\\config.enc` on Windows, `~/.config/mcp/config.enc` on Linux/macOS) | AES-GCM, machine-bound key | Only your OS user |\n\n## License\n\nApache-2.0 -- See [LICENSE](LICENSE).\n",
  "bytes": 17902,
  "sha": "694a7dfadcea05c2684d53bee49d110152fbc03e663ddd5202a62bdd651e4b48",
  "repo_slug": "n24q02m/better-notion-mcp",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_n24q02m_better_notion_mcp_26c8e9d8/readme"
}