notion
mcp-name: io.github.n24q02m/better-notion-mcp
Markdown-first Notion for AI agents -- pages, databases, blocks, and comments in one call.
Table of contents
- Features
- Install
- CLI
- Remote (HTTP mode)
- Smithery
- Status
- Documentation
- Tools
- Configuration
- Comparison
- Security
- Build from Source
- Trust Model
- License
Features
- Markdown in, Markdown out -- human-readable content instead of raw JSON blocks
- 8 composite tools, 39 actions -- one call instead of chaining 2+ atomic Notion endpoints (plus
configandhelp) - Auto-pagination and bulk operations -- no manual cursor handling or looping
- Tiered token optimization -- ~77% reduction via compressed descriptions + on-demand
helptool - Dual transport -- local stdio (integration token) or remote HTTP (per-user or shared bearer token)
Install
Run with npx (Node.js >= 24) and a Notion integration token from https://www.notion.so/my-integrations (starts with ntn_):
// MCP client config (e.g. .mcp.json / Claude Code / Cursor)
{
"mcpServers": {
"notion": {
"command": "npx",
"args": ["--yes", "@n24q02m/notion@latest"],
"env": { "NOTION_TOKEN": "ntn_your_token_here" }
}
}
}
The package is @n24q02m/notion (formerly @n24q02m/better-notion-mcp;
old package receives one final release then freezes). The MCP Registry id stays
io.github.n24q02m/better-notion-mcp, and the legacy better-notion-mcp
command is kept as an alias of notion.
Or run the published Docker image (stdio):
docker run --rm -i -e NOTION_TOKEN=ntn_your_token_here n24q02m/notion:latest
Install matrix
Full per-client walkthroughs: mcp.n24q02m.com/servers/better-notion-mcp/setup/. See the Documentation section for per-client setup (Claude Code, Codex, Gemini CLI, Cursor, Windsurf) and HTTP mode.
CLI
Installing the package exposes a notion binary (plus the legacy better-notion-mcp alias; run it with npx or after a global install). With no arguments 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. Subcommands: auth stores the Notion integration token; config, status, logout, doctor, and token come from the shared hull CLI.
# Start the stdio server (default transport; requires NOTION_TOKEN)
NOTION_TOKEN=ntn_your_token_here npx --yes @n24q02m/notion@latest
# Start the remote HTTP server (bearer token) instead of stdio
npx --yes @n24q02m/notion@latest --http
See Configuration for the full environment-variable reference.
Remote (HTTP mode)
Deployed with the HTTP transport, the server is a remote endpoint gated by bearer-token auth -- no integration token in the server config. Point an MCP client that supports remote HTTP servers at the host you deployed it on:
// MCP client config -- remote HTTP (bearer token)
{
"mcpServers": {
"notion": {
"type": "http",
"url": "https://<your-host>/mcp",
"headers": { "Authorization": "Bearer <your-token>" }
}
}
}
In multi mode (default) each user is listed in the users file (MCP_USERS_FILE, default ~/.hull/users.toml) and gets their own token and credential namespace. In token mode every client shares one token whose scrypt hash is set in MCP_AUTH_TOKEN_HASH. To stand up such an instance, see Self-Hosting (Remote Mode).
Smithery
The repo ships a smithery.yaml config for Smithery. Smithery launches the server over stdio (npx -y @n24q02m/notion) and requires no install-time config -- provide your Notion credentials at runtime through NOTION_TOKEN or the config tool (see Configuration).
Status
2026-05-02 -- Architecture stabilization update
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.
Apologies for the instability period. If you encountered issues with prior versions, please update to the latest release and follow the current Setup guide -- most prior workarounds are no longer needed.
Related plugins from the same author:
- wet -- Web search + content extraction
- mnemo -- Persistent AI memory
- imagine-mcp -- Image/video understanding + generation
- email -- Email management
- telegram -- Telegram
- better-godot-mcp -- Godot Engine
- crg -- Code review knowledge graph
All plugins share the same architecture -- install once, learn pattern transfers.
Documentation
Full docs at mcp.n24q02m.com/servers/better-notion-mcp/:
- Setup -- install methods for Claude Code, Codex, Gemini CLI, Cursor, Windsurf, mcp.json
- Modes overview -- stdio (local, integration token) and HTTP (remote, bearer token)
- Multi-user setup -- per-user credential namespace (HTTP mode)
Install with AI agent -- paste this to your AI coding agent:
Install MCP server
notionfollowing the steps at https://raw.githubusercontent.com/n24q02m/claude-plugins/main/plugins/better-notion-mcp/setup-with-agent.md
Tools
Eight composite Notion tools (39 actions) plus two infrastructure tools (config, help):
MCP Resources
Configuration
Self-Hosting (Remote Mode)
Run the HTTP server on your own host and choose an auth mode with MCP_AUTH_MODE:
multi(default): list each user inMCP_USERS_FILE; each user's Notion token is stored in their own namespace (~/.better-notion/subs/<ns>/config.json).token: one shared bearer token. Mint the hash withtoken hashand pass it asMCP_AUTH_TOKEN_HASH.no-auth: no bearer check. Use only on a trusted local network.
docker run -p 8080:8080 \
-e TRANSPORT_MODE=http \
-e PORT=8080 \
-e MCP_AUTH_MODE=token \
-e MCP_AUTH_TOKEN_HASH='scrypt$...' \
n24q02m/notion:latest
Docker Compose (loopback)
docker-compose.http.yml builds the http image target and publishes it on the host loopback interface only (127.0.0.1:8081), so the server is never reachable from other machines directly:
export MCP_AUTH_MODE=token
export MCP_AUTH_TOKEN_HASH='scrypt$...'
docker compose -f docker-compose.http.yml up
The server listens on http://localhost:8081/mcp. To expose it, put your own TLS reverse proxy in front of the loopback port.
Release images are published multi-arch (amd64 + arm64) to Docker Hub (n24q02m/notion) and GHCR (ghcr.io/n24q02m/notion). There is no n24q02m-hosted HTTP endpoint.
Comparison
How notion stacks up against direct competitors in each pillar:
Security
- Bearer token auth -- per-user tokens (
multi) or one scrypt-hashed shared token (token) - Rate limiting -- 120 req/min/IP on HTTP transport
- Session owner binding -- IP check + TTL for pending token binds
- Null safety -- Handles Notion API quirks (comments.list 404, undefined rich_text)
Build from Source
git clone https://github.com/n24q02m/notion.git
cd notion
bun install
bun run dev
Trust Model
Credentials are never sent to n24q02m: there is no hosted endpoint.
License
Apache-2.0 -- See LICENSE.