Skip to content

Conversation

@njbrake
Copy link
Contributor

@njbrake njbrake commented Nov 20, 2025

As mentioned in makenotion/notion-mcp-server#142 by @jamiecool, the official open-sourced Notion MCP server does not work well. One of the most significant issues is that it returns the raw JSON response from the Notion API, which is way too verbose. This fork of the Notion Server converts read responses to usable Markdown content which is more token efficient.

Description

This PR adds a fork of the official Notion MCP Server that transforms raw Notion API JSON responses into LLM-optimized markdown output.

Server Details

  • Server: Notion API (fork)
  • Changes to: Response formatting - all tool responses are now returned as formatted markdown instead of raw JSON
  • Type: Enhancement/Alternative implementation

Motivation and Context

The official Notion MCP server returns raw JSON responses that include deeply nested objects, verbose property schemas, and rich text arrays. This creates several problems:

  1. Token inefficiency: LLMs must process large JSON structures to extract simple information
  2. Poor readability: Raw JSON is difficult for LLMs to parse semantically
  3. Context waste: Verbose responses consume valuable context window space (especially when I'm using a local LLM!)

This fork solves these issues by intelligently formatting responses based on endpoint type:

  • Pages/Blocks → Markdown with formatting preserved
  • Databases → Property schemas in readable format
  • Search results → Bulleted lists with visual indicators
  • Users/Comments → Concise text summaries

The inline ID tags ensure all relationship information is preserved for follow-up queries.

How Has This Been Tested?

Unit Tests: 19 tests covering all formatters (100% pass rate)

  • markdown-converter.test.ts: 8 tests for rich text conversion
  • block-formatters.test.ts: 7 tests for block type formatting
  • notion-response-formatter.test.ts: 4 tests for endpoint detection and routing

Build Tests: TypeScript compilation successful with no errors

Integration:

  • Successfully builds and runs with both stdio and HTTP transports
  • Compatible with existing MCP client configurations (Claude Desktop, Cursor)
  • Same authentication methods as original (NOTION_TOKEN, OPENAPI_MCP_HEADERS)

I also published it to ghcr https://github.com/njbrake/notion-mcp-server/pkgs/container/notion-mcp-server and pulled it into my own use case, verifying that it works great 💪

Breaking Changes

None. It's a drop in replacement, the only difference would be that now instead of a big verbose JSON object you get markdown.

Types of changes

  • [ x] Bug fix (non-breaking change which fixes an issue)
  • [ x] New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • [x ] Documentation update

Checklist

  • [ x] I have read the MCP Protocol Documentation
  • [x ] My changes follows MCP security best practices
  • [x ] I have updated the server's README accordingly
  • [x ] I have tested this with an LLM client
  • [x ] My code follows the repository's style guidelines
  • [x ] New and existing tests pass locally
  • [x ] I have added appropriate error handling
  • [x ] I have documented all environment variables and configuration options

Additional context

As mentioned in makenotion/notion-mcp-server#142 by @jamiecool, the official open-sourced Notion MCP server does not work well. It returns the raw JSON response from the Notion API, which is way to verbose. This fork of the Notion Server converts read responses to usable Markdown content which is more token efficient.
@domdomegg domdomegg merged commit e3372c7 into modelcontextprotocol:main Nov 25, 2025
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants