iTranslated by AI

The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
🦭

nooon: A Notion MCP Server Designed for Maximum Token Efficiency

に公開

I'm K@zuki., a busy person who's been wishing for a long vacation lately.

Have you ever wanted to let an AI Agent or Coding Agent reference Notion? I'm sure there are many occasions where you want it to read documents or check the contents of a database.

However, trying to actually do this often turns out to be unexpectedly cumbersome. That is why I'd like to briefly introduce an MCP Server that prioritizes token efficiency.

https://www.npmjs.com/package/nooon
https://github.com/corrupt952/nooon

Quick Start

# Authentication (Environment variable or OAuth)
export NOTION_TOKEN=ntn_xxx

# Register to Claude Code
eval $(bunx nooon mcp install)

With just this, you'll be able to reference Notion from Claude Code. For other Agents, you can use the information provided by bunx nooon mcp config. After this, you can perform connections to Notion efficiently with your Agent.

  • "List tasks due today at {DB_URL}"
  • "What kind of pages contain '○○'?"

Why is Notion integration a hassle?

There are several ways to pass Notion information to an Agent.

The simplest method is to call the Notion API directly. You could use an official MCP server or write your own API calls. Either way, you end up getting the raw response from the Notion API.

And let me tell you, Notion API responses are incredibly verbose. When you retrieve page content, a massive amount of metadata is attached to every single block. Creation date, last edited time, author, archive status, parent block information... Even though all you really need is the text content, there is an overwhelming amount of extra information.

{
  "object": "block",
  "id": "2615e2c0-3333-2222-1111-f29e60946e44",
  "parent": {
    "type": "page_id",
    "page_id": "2615e2c0-3333-2222-1111-fbacbccd1aec"
  },
  "created_time": "2025-09-01T07:06:00.000Z",
  "last_edited_time": "2025-09-01T07:06:00.000Z",
  "created_by": { "object": "user", "id": "e1db449a-..." },
  "last_edited_by": { "object": "user", "id": "e1db449a-..." },
  "has_children": false,
  "archived": false,
  "in_trash": false,
  "type": "heading_2",
  "heading_2": {
    "rich_text": [{
      "type": "text",
      "text": { "content": "メモ", "link": null },
      "annotations": {
        "bold": false, "italic": false, "strikethrough": false,
        "underline": false, "code": false, "color": "default"
      },
      "plain_text": "メモ",
      "href": null
    }],
    "is_toggleable": false,
    "color": "default"
  }
}

The example above is just for retrieving a heading named "Memo" (Note), and it's about 850 characters long.

Furthermore, retrieving blocks requires recursively fetching children of blocks, not just page by page. You end up hitting the API repeatedly just to fetch a single page.

With a typical MCP server, the LLM must perform multiple tool calls.

As a result, you consume a huge amount of tokens. Since the Claude Code context is finite, reading just one Notion page reduces the tokens available for the actual coding work. As a lazy human, I wanted to do this more efficiently.

nooon

That's why I created nooon. It is a read-only MCP server for Notion, designed with token efficiency as the top priority.

https://github.com/corrupt952/nooon

Why read-only?

nooon is read-only. It cannot create or update pages.

This is an intentional design decision for two reasons.

The first is security. It feels a bit risky to grant Claude Code the "authority to freely rewrite Notion." It would be problematic if important documents were accidentally overwritten. By keeping it read-only, you can use it with peace of mind.

The second is technical limitations. Notion pages are not simple text. Many documents have complex structures, such as column layouts, callouts, and embedded databases. To accurately interpret and update these, one would need the specifications for Notion-flavored Markdown, which Notion uses internally. Since these specifications are not currently public, implementing a write feature is difficult (I could write it, but I don't have the energy to rewrite it every time the Notion API updates).

In reality, I believe 70% of the scenarios where you use Notion from an Agent involve "wanting to reference information." If writing is necessary, a human can handle it. If the specifications are released, I might consider support.

Retrieve entire pages in one tool call

With nooon, you can retrieve an entire page in a single MCP tool call. It recursively fetches blocks internally and returns a combined, streamlined result.

Since the LLM doesn't need to call the tool multiple times, you save both tokens and time.

Streamlining the response

I extract only the truly necessary information from the Notion API response. For blocks, I keep the type, text content, and information about child elements (if any), while discarding all other metadata. For search results, I narrow it down drastically to just the ID and title.

This alone reduces the size to a fraction of the original response. While this is an extreme example, here is a comparison:

Format Character count
Raw Notion API response (2 blocks) 1,598 chars
Streamlined JSON 68 chars
TOON format 46 chars

Reducing output size with the TOON format

nooon uses the TOON format for output.

https://github.com/toon-format/toon

TOON is a format that further lightens JSON by omitting quotes for keys and unnecessary whitespace.

results[3]{object,id,title}:
  page,709bfc50-0370-4feb-a29c-1a1c4b013286,Memory Upgrade
  page,6988285a-f99c-490a-8eae-6677adb3f835,How to use git notes to leave memos on commits
  page,28b0fb3b-c304-4599-b5d1-aa45dcf4fbc5,Meeting Minutes
has_more: true

Even with the same information, TOON is much more compact. A single search result in the raw response is about 7,000 characters, whereas 3 results in TOON format are only about 220 characters. This is sufficient as data to pass to an LLM.

For page content, it also supports Markdown output, which tends to keep token consumption even lower.

// TOON format (115 chars)
[5]{type,text}:
  heading_2,Memo
  paragraph,35th floor
  paragraph,South side
  heading_2,Location
  paragraph,Both north and south have 15F, so if you care about the view, 20F or higher is recommended

// Markdown format (45 chars)
## Memo
35th floor
South side
## Location
Both north and south have 15F, so if you care about the view, 20F or higher is recommended

Smart caching

Notion pages aren't updated that frequently when referenced by an LLM, right? If you retrieve the same page multiple times, it is more efficient to cache it.

nooon caches pages in ~/.cache/nooon/pages/. However, instead of simply expiring the cache based on time, it determines whether to update by checking the last_edited_time in Notion. If the page has not been updated, it uses the cache; if it has, it retrieves the new data.

This minimizes API calls while ensuring you always get the latest data.

Usage

Installation

It is currently built on the premise that it only runs on Bun.

bunx nooon

If you do not have Bun or want to use a pre-built binary, you can download your preferred version from Releases.

# macOS (Apple Silicon)
curl -L https://github.com/corrupt952/nooon/releases/latest/download/nooon-darwin-arm64 -o nooon
chmod +x nooon

Authentication

There are two ways to authenticate. You can choose the method you prefer.

# Simply use an API token via environment variable
# Issued at https://www.notion.so/my-integrations
export NOTION_TOKEN=ntn_xxx

# OAuth credentials (environment variables are also acceptable)
bunx nooon config --client-id <id> --client-secret <secret>
bunx nooon auth

Registering to Claude Code

I have made the registration to Claude Code as simple as possible.

eval $(bunx nooon mcp install)

This is all it takes to register nooon to Claude Code. For other tools, please refer to the results of bunx nooon mcp config to set it up.

Tools provided

nooon provides 6 tools.

Tool Purpose
nooon_search Search for pages or databases by keyword
nooon_page Retrieve page content block by block (with cache)
nooon_database Retrieve database schema and available views
nooon_data_source Retrieve data source schema (property definitions)
nooon_query Query a database with filters and sorting
nooon_clear_cache Clear the cache

The basic flow is to first use nooon_search to find the target page or database. Use nooon_page if you want to see the content of a page, and nooon_query if you want to retrieve the content of a database. nooon_page outputs in TOON format by default, but you can specify format='markdown' to output in Markdown; currently, whenever an Agent uses MCP, I almost always specify markdown to load it.

Conclusion

nooon is an MCP server for Notion that pursues token efficiency.

  • Read-only and secure
  • Retrieve an entire page in a single tool call
  • Lighten output with TOON format
  • Reduce API calls with smart caching
  • Streamline responses to extract only the necessary information

If you have frequent opportunities to reference Notion in Claude Code, please give it a try.

https://github.com/corrupt952/nooon

Discussion