nbjm-mcp
Provides read/write access to a Notion workspace, including page and database reading, search, block mutations, database row and schema management, table operations, and image block creation via the Notion API.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
nbjm-mcp
Deprecated — no longer maintained. Use Notion's hosted MCP server at
https://mcp.notion.com/mcpinstead. The code stays for reference; the server still prints a warning on startup.
This MCP server gives Claude full read/write access to your Notion workspace.
Token-efficient — a typical Notion page is 50-100KB of JSON from the API. This server compresses that to 2-5KB of readable text (87-92% reduction), so Claude can work with large workspaces without blowing through context.
Parallel read/write — mutations execute concurrently with async rate limiting. Batch edits to a page happen in parallel, not one block at a time.
Broad block type coverage — 16 block types, inline formatting, database CRUD, table read/write, column layouts, and database schema management. Not universal yet (synced blocks and media are read-only).
How it works
Doesn't Notion basically feel like fancy markdown? Well, that's the entire idea here. When you read a Notion page through this server, you get back something that looks like this:
R4kQ # Potential names for my cat
t9Xm > Serious contenders
pL3n - **Gerald**
vB8s - Very distinguished
J2wE - **Margaret** :red[(vetoed @date:2026-02-14)]
hA3z > Backups
dR5v - **Dr. Philip Hoffmann III**
wU6j # Potential names for my newborn
bT1y - :blue[Mr. Beans] (current frontrunner)
xF4p - Pros: already responds to it
gN9s - Cons: none
kD2r - Mittens
eP5m - *Does this sound too much like a cat?*
gI7N - See @p:R4kQThere are many small differences from markdown — > is a toggle (foldable section), @p:R4kQ is a page mention, and following Streamlit, :red[...] is colored text — but the format is designed to be immediately readable without learning anything new. For the full specification covering all block types, inline formatting, mutation commands, and error codes, see docs/nbjm-spec.md.
One big departure from markdown is those four-character codes on the left (R4kQ, t9Xm, ...). Each one is a token-efficient reference to a Notion block. The MCP server manages these IDs across reads and writes so that edits target the correct blocks.
Related MCP server: notion-mcp-server
Prerequisites
Claude Code or Codex (untested) or another MCP client
A Notion account with an API integration
uv (Python package manager)
Note: Only tested on Ubuntu so far.
Setup
1. Get a Notion API token
Create an internal integration at notion.so/profile/integrations. It needs Read, Update, and Insert content capabilities. You'll get a token starting with ntn_.
Then share the pages/databases you want accessible: open each top-level page in Notion, go to ... → Connections, and add your integration. Child pages inherit access.
2. Save the token to a file
mkdir -p ~/.config/nbjm-mcp
echo "ntn_YOUR_TOKEN_HERE" > ~/.config/nbjm-mcp/token3. Add to Claude Code
Add this to ~/.claude/settings.json (or a project .mcp.json):
{
"mcpServers": {
"nbjm-mcp": {
"type": "stdio",
"command": "uvx",
"args": [
"--refresh",
"--from",
"git+https://github.com/newknew/nbjm-mcp",
"nbjm-mcp",
"--token-file",
"~/.config/nbjm-mcp/token"
]
}
}
}Restart Claude Code. You should see five new tools: notion_read, notion_apply, notion_search, notion_check_auth, and notion_get_url. Ask Claude to run notion_check_auth to verify the connection.
3b. Add to Codex (untested)
Note: These instructions have not been tested. If you run into issues, please open an issue.
Add this to ~/.codex/config.toml (or a project-scoped .codex/config.toml):
[mcp_servers.nbjm-mcp]
command = "uvx"
args = [
"--refresh",
"--from", "git+https://github.com/newknew/nbjm-mcp",
"nbjm-mcp",
"--token-file", "~/.config/nbjm-mcp/token",
]Or use the CLI:
codex mcp add nbjm-mcp -- uvx --refresh --from git+https://github.com/newknew/nbjm-mcp nbjm-mcp --token-file ~/.config/nbjm-mcp/tokenNot yet supported
Synced blocks — displayed as placeholder, can't create
Video/file blocks — displayed as
!file~etc.; can't be created via the API (use!imgfor images)Block equations — read-only (inline
:eq[expr]works)
Changelog
v0.7.2 — 2026-10-25
Deprecated — superseded by Notion's hosted MCP server. Startup prints a deprecation warning to stderr.
v0.7.0 — 2026-04-29
Image block creation via
!img—notion_applyscripts can now create image blocks inline. Two forms:!img url=https://example.com/x.png(external URL, externally hosted) and!img path=/abs/local/file.png(local file uploaded via Notion's/file_uploadsAPI, ≤20 MB single-part). Addcaption="…"for inline captions with full rich-text support. Previously agents had to upload PNGs to Drive and link to them, which broke inline rendering. Existing image blocks still render as!image~on read for backwards compatibility.
v0.5.0 — 2026-04-15
Refuse misplaced row-update payloads as titles — every path that sets a page, row, or database title (
+page,+db,+rowName column,upage,cpage,uon page/database,urow,u <rowID>Name column) now refuses values that look like a row-update payload landing in the wrong place. Two bright-line checks: the value contains a literal tab character (tabs are the DSL's column separator for row updates — a title with a tab is almost certainly a misplaced update), or the value starts with aCapitalizedKey=Valuepattern (e.g.Last contact=2026-04-10). Rejections come back asSUSPICIOUS_TITLEwith a specific reason and a suggestedurowrewrite. Regression for the contact-db corruption that produced dozens of rows with titles likeLast contact=2026-04-10\tLast platform=WhatsAppacross prior sessions — the earlier u-on-row fix closed one path, this closes the perimeter.
v0.4.0 — 2026-04-14
Relation property writes —
+row,urow, andu <rowID>now write torelationcolumns. Values are comma-separated page references (short ID, dashed UUID, or dashless UUID); a single relation isWho=N2jf, multi-target isTags=N2jf, R4kQ. Previously_build_property_valuehad no case for"relation"and returnedNone, so the row builder silently skipped relation columns —+row ... Who=N2jfreportedokbut the relation was empty, andurow/ureturnedNo valid properties to updateeven when a valid relation was in the payload.No more silent drops in row-property builds —
_build_row_propertiesnow returns(props, unresolved), whereunresolvedlists every input key that didn't apply (unknown column, or value that couldn't be converted for the column's type).+row,urow, andu <rowID>all surfaceROW_UPDATE_NO_MATCHwith a per-key explanation (e.g.unknown column 'Who' (available: Date, Name)orcolumn 'Count' (number): value 'x' couldn't be converted). This makes failures like the relation-write bug impossible to miss — previously the relation-missing bug went unnoticed across many sessions because the error was hidden behind a generic "No valid properties to update" message.
v0.3.0 — 2026-04-11
@b:shortIDblock mentions — inline references to specific blocks now parse and render as links to the block's Notion URL. Works in paragraphs, bullets, and table cells (the original scenario where the bug was reported — table cells use the same parse pipeline as everything else, so fixing@b:at the parser level fixes tables for free). Also supports[custom text](b:shortID)explicit link syntax.u <rowID>as a synonym forurow— callinguon a database row now auto-routes to row-property update semantics (parse the tab-separatedkey=valuepayload, match columns, PATCH the row). Previouslyuon a row silently overwrote the Name/title with the raw payload string, quietly corrupting contact records and similar databases across many sessions.Quoted keys in row updates —
"Last contact"=2026-04-10\t"Last platform"=WhatsApp(the natural form when column names have spaces) now parses correctly. Surrounding double quotes are stripped from both keys and values. Previously keys kept their literal quotes and never matched any column, making the update a silent no-op.Database rename via
upage/u—upage <dbID> = "New Name" icon=📚andu <dbShortID> = "New Name"now correctlyPATCH /databases/{id}with the Notion databases API's top-leveltitlerich_text shape. Previously both routed to/pages/{id}and returned 404 for database UUIDs.Clean refusal for database moves —
mormpageon a database now returnsDB_MOVE_UNSUPPORTEDwith a pointer to the Notion UI. The Notion API has no way to move databases programmatically; previously callers hit the move endpoint and got a raw validation error.notion_readdispatch for block-level refs — reading a block short ID (toggle, bullet, heading) now correctly falls through/pages/→/databases/→/blocks/on 400 responses, not just 404. Previously Notion's "Provided database_id..." validation error short-circuited withHTTP_ERROR, forcing agents to re-read entire parent pages to verify a single child.cpagesurfaces the new page short ID — copy operations now return the new page's short ID in the apply result (+SHORT_ID), so follow-up ops likempage <copyID> -> parent=<originalID>have a target. Previouslycpagereturned justok, making the copy unreachable in the same batch.Pipe rows missing outer pipes warn — content like
Camp | For | Ages(intended as a table row but missing the leading/trailing pipes) now emits a warning explaining why it became a paragraph instead of a table. Joins the existing@tableand bare-!tableguardrail warnings.All apply-script parse errors surface — submitting multiple invalid commands in one script now reports one error per bad line. Previously
execute_apply_scriptgrabbedparse_result.errors[0]and silently dropped the rest, hiding anything past the first mistake.
v0.2.0 — 2026-03-31
Flexible update syntax —
u/enow accepts three forms: quoted (u ID = "text"), unquoted (u ID = text), and indented (u IDwith content on the next indented line). Previously only quoted was supported.Syntax error hints — when a known command is used with wrong syntax, the error now shows the expected format and an example, instead of reporting it as an unknown command.
Code fence language with spaces — code blocks now accept multi-word language hints (e.g.,
```plain text), which were previously rejected.Server version in auth check —
notion_check_authnow includes the server version (from pyproject.toml) in its response for easier debugging.
v0.1.3 — 2026-03-30
Null-field stripping on write — block data returned by the Notion API sometimes contains
null-valued fields (e.g.,icon: null). These are now stripped before writing, since the API rejects explicit nulls but accepts absent fields. Fixes errors when cloning or moving certain block types.
v0.1.2 — 2026-03-29
ealias for block updates —e ID = "text"is now accepted as an alias foru, matching natural "edit" intent.helpcommand —script="help"returns a compact command reference without executing anything.Smarter unknown-command errors — unrecognized commands now get fuzzy-matched against valid commands and common natural-language aliases (e.g.,
edit→u,delete→x), with "did you mean?" suggestions.Explicit
!table Nchild rows — when using!table Nwith indented pipe rows, the rows are now correctly attached as children of the explicit table block instead of being wrapped in a second synthetic table.Table creation guardrails — warnings for common mistakes:
@table(read-only format, not a write command),!tablewithout a column count, and pipe rows missing outer pipes.Typed creation responses —
+results now include block types (e.g.,+A1b2(paragraph) +C3d4(to_do)), with a type summary in the footer.Parse error suggestions — error messages now include suggestion text inline, so the fix is visible without inspecting the structured error.
v0.1.1 — 2026-03-14
Equation syntax — inline equations now use
:eq[expr]directive instead of$expr$. Dollar signs are treated as literal text, so$50no longer triggers equation parsing.Stable move IDs — moving a block preserves its short ID instead of assigning a new one, so references to moved blocks remain valid.
+dbresponse metadata —+dbresults now include the database short ID and property names (e.g.,+db=7QI8 props: Name, Status, Due).+rowresponse format —+rowresults now return created IDs as a list, consistent with other creation commands.ID registry reassign — new
reassign()method on the ID registry supports re-pointing a short ID to a different UUID, used internally by move operations.
v0.1.0 — 2026-02-20
Missing payload diagnostics —
+row,urow, and+dbnow detect missing or non-indented payloads and produce actionable error messages with autofix suggestions, instead of silently accepting incomplete commands.Sequential schema execution — consecutive schema operations (
+prop,xprop,uprop) on the same database now execute sequentially to avoid race conditions, using the same chaining mechanism as consecutive moves.Expanded tool docstrings —
notion.readandnotion.applydocstrings updated with table operations, relative date filter examples, typed refs, and clearer parameter descriptions.
v0.0.3 — 2026-02-17
Database creation and management —
+dbcreates databases with typed property definitions,+propadds properties,xpropdeletes properties, anduproprenames properties. Property definitions use a compactName(type: config)syntax supporting select options, number formats, relation targets, and dual relations.Full table support — tables are no longer opaque placeholders. They render as pipe-delimited rows (
| cell | cell |) with full read/write roundtrip. Consecutive table rows auto-group into a table parent, and Markdown separator rows are silently dropped.Structural block notation — column layouts and tables use a new
!type Nnotation (!cols 3,!col 1,!table 4) that exposes their structure for editing, replacing the old opaque rendering of columns.Page positioning —
+pagenow acceptsafter=<block_id>andpos=startto control where new pages appear within their parent.Variable-length code fences — code blocks now support 3+ backticks, with the closing fence required to match the opening length.
Improved
!-prefix disambiguation — callout, opaque, and structural blocks all start with!and are now disambiguated in a clear priority order: colored callouts → opaque (!type~) → structural (!type N) → default callout.Auto-refresh install — the recommended
uvxconfig now includes--refreshso Claude Code always uses the latest version.
v0.0.2 — 2026-02-14
Better searching and filtering over databases —
notion_readnow acceptsfilter,sort, andcolumnsparameters. The filter DSL supports comparison operators (=,!=,~,!~,<,>,<=,>=), unary checks (?empty,!?not empty), boolean logic (&,|), parenthesized grouping, quoted property names, and relative dates (-14d). Sort takes compact specs likeDue desc, Status asc. Columns selects which properties to return (Name, Status, Due). Schema-aware compilation validates property names and coerces types.Parallel reads — each entry in the
pageslist can now overridedepth,limit,filter,sort, andcolumnsindependently, enabling batch reads that mix pages and filtered databases in a single call.More block type coverage — database mentions,
link_mention(rich URL embeds),link_preview(integration embeds), andtemplate_mentiontypes are now rendered instead of silently dropped. Annotations (bold, italic, color, etc.) are applied to mention output. Page and row icons (emoji or external URL) are included in NBJM output.Better move semantics — moving blocks that contain Notion-hosted files (images, videos, PDFs) now re-uploads the file via the File Upload API to get a permanent reference. Move commands pre-flight check whether a block can be moved, returning clear errors for synced blocks, tables, breadcrumbs, and other non-portable types. Consecutive moves to the same parent execute sequentially with auto-chaining to preserve script order.
m X -> after=Ywithoutparent=now returns a helpful error instead of silently failing.Renamed MCP config key — the recommended key in
.mcp.json/settings.jsonis nownbjm-mcp(wasnotion-mcp), to avoid conflicts with other Notion MCP servers.
License
Apache 2.0
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
Related MCP Connectors
MCP-native open-source Notion alternative: read & write pages, databases and kanban boards.
Hosted Notion MCP server for Claude, ChatGPT and Cursor, with each action switched per account.
MCP-native collaborative markdown editor with real-time AI document editing
Linked markdown notes as memory for AI apps: search, read, save and link notes over MCP.
Related MCP Servers
- AlicenseNot gradedqualityAmaintenanceEnables MCP clients such as Claude, Cursor and ChatGPT to read and write in Notion using a single token, covering search, page creation and editing, database queries, comments and file uploads through natural language. It also supports headless use in automation and CI, with batched, idempotent writes and compact context cost.8,094 npmMIT
- AlicenseNot gradedqualityAmaintenanceGives MCP clients such as Claude, Cursor, VS Code and Codex token-authenticated read/write access to a Notion workspace, so agents can search, create and edit pages, query databases, manage blocks and comments, and upload files in plain language. It is built for unattended automation with batched, idempotent writes, markdown round-tripping, retry on rate limits, and a low context footprint.8,094 npmMIT
- AlicenseNot gradedqualityAmaintenanceEnables MCP clients such as Claude, Cursor, and VS Code to read and write Notion with a single token, including searching, creating and editing pages, querying databases, commenting, and uploading files.8,094 npmMIT
- AlicenseNot gradedqualityBmaintenanceGives MCP clients like Claude, Cursor, VS Code and Codex token-authenticated read/write access to Notion, so agents can search, create and edit pages, query databases, comment and upload files in plain language. It supports batched, idempotent writes with rollback, markdown round-tripping, and headless use in CI or self-hosted environments.8,094 npmMIT