Skip to main content
Glama

Notion 読み取り専用 MCP サーバー

このプロジェクトは、Notion API 用に最適化された読み取り専用 MCP サーバーを実装し、AI アシスタントが Notion コンテンツを照会および取得する際のパフォーマンスと効率に重点を置いています。

主な改善点

  • 読み取り専用設計: データ取得操作のみに焦点を当て、Notion コンテンツへの安全なアクセスを保証します。

  • ツール セットの最小化: 公開されている Notion API ツールの数を 15 個以上から、ドキュメント分析に不可欠な 6 個に削減しました。

  • 並列処理: ブロック コンテンツを取得するための非同期および並列 API リクエストを実装することでパフォーマンスが向上し、応答時間が大幅に短縮されます。

  • 拡張データベース アクセス: データベース、ページ プロパティ、およびコメントの取得操作のサポートが追加されました。

  • AI アシスタント向けに最適化: ツール数を大幅に削減することで、モデルを約 40 個のツールに制限する Cursor などの AI アシスタントの「ツールが多すぎるとパフォーマンスが低下する可能性がある」問題に対処します。

Related MCP server: notion-slim

ツールの比較

この読み取り専用実装では、標準の Notion API 統合と比較して公開されるツールがはるかに少なくなり、AI アシスタントとのパフォーマンスと互換性が向上します。

Notion APIツールの比較

ツール セットを削減することで、すべての重要な機能を提供しながら、推奨ツール制限内にとどまり、AI アシスタントのパフォーマンスを最適化できます。

インストール

1. Notionでの統合の設定:

https://www.notion.so/profile/integrationsにアクセスし、新しい内部統合を作成するか、既存の統合を選択します。

Notion統合トークンの作成

Notion APIの公開範囲は読み取り専用操作に限定されていますが、LLMに公開することでワークスペースデータへのリスクがゼロではありません。セキュリティを重視するユーザーは、統合機能をさらに設定することをお勧めします。

たとえば、「構成」タブから「コンテンツの読み取り」アクセス権のみを付与することで、読み取り専用の統合トークンを作成できます。

Notion統合トークン機能でコンテンツの読み取りがチェックされていることを示す

2. クライアントに MCP 構成を追加する:

npm を使用する場合:

.cursor/mcp.jsonまたはclaude_desktop_config.jsonに次のコードを追加します (MacOS: ~/Library/Application\ Support/Claude/claude_desktop_config.json )

{
  "mcpServers": {
    "notionApi": {
      "command": "npx",
      "args": ["-y", "notion-readonly-mcp-server"],
      "env": {
        "OPENAPI_MCP_HEADERS": "{\"Authorization\": \"Bearer ntn_****\", \"Notion-Version\": \"2022-06-28\" }"
      }
    }
  }
}

Docker の使用:

.cursor/mcp.jsonまたはclaude_desktop_config.jsonに以下を追加します。

{
  "mcpServers": {
    "notionApi": {
      "command": "docker",
      "args": [
        "run",
        "--rm",
        "-i",
        "-e", "OPENAPI_MCP_HEADERS",
        "taewoong1378/notion-readonly-mcp-server"
      ],
      "env": {
        "OPENAPI_MCP_HEADERS": "{\"Authorization\":\"Bearer ntn_****\",\"Notion-Version\":\"2022-06-28\"}"
      }
    }
  }
}

ntn_****統合シークレットに置き換えることを忘れないでください。統合設定タブから確認できます。

3. コンテンツを統合に接続する:

関連するページとデータベースが統合に接続されていることを確認します。

これを行うには、ページにアクセスし、3 つのドットをクリックして、「統合に接続」を選択します。

Notion Connectionsへの統合トークンの追加

利用可能なツール

この最適化されたサーバーは、必須の読み取り専用 Notion API ツールのみを公開します。

  • API-retrieve-a-page : ページ情報を取得する

  • API-get-block-children : ページコンテンツブロックを取得する(並列処理)

  • API-retrieve-a-block : 特定のブロックの詳細を取得する

  • API-retrieve-a-database : データベース情報を取得する

  • API-retrieve-a-comment : ページまたはブロックのコメントを取得する

  • API-retrieve-a-page-property : ページから特定のプロパティ情報を取得する

  • API-get-one-pager :新機能! Notionページ全体を、そのブロック、データベース、関連コンテンツをすべて1回の呼び出しで再帰的に取得します。

標準実装では 15 個以上のツールが必要ですが、これら 7 つの必須ツールに制限することで、次のことが保証されます。

  1. ツール数制限のあるカーソルやクロードなどのAIアシスタントのパフォーマンスが向上しました

  2. 適切なツールを選択する際のAIモデルの認知負荷の軽減

  3. 考慮すべき API オプションが少なくなり、応答時間が短縮されます

  4. APIの表面積を最小化することでセキュリティを強化

自動コンテンツ探索

新しいAPI-get-one-pagerツールは、複数の API 呼び出しを必要とせずに Notion ページを探索する強力な方法を提供します。

  • 再帰検索: ネストされたブロックを含むページ構造全体を自動的に走査します

  • 並列処理: 複数のブロックとその子を同時に取得して、パフォーマンスを最大限に高めます。

  • インテリジェントキャッシュ: 取得したデータを保存して冗長なAPI呼び出しを最小限に抑えます

  • 包括的なコンテンツ: ページ、ブロック、データベース、コメント、詳細なプロパティ情報が含まれます

  • カスタマイズ可能な深さ: 再帰のレベルを制御して詳細とパフォーマンスのバランスをとる

ワンページャーツールの使用

{
  "page_id": "YOUR_PAGE_ID",
  "maxDepth": 5,               // Optional: Maximum recursion depth (default: 5)
  "includeDatabases": true,    // Optional: Include linked databases (default: true)
  "includeComments": true,     // Optional: Include comments (default: true)
  "includeProperties": true    // Optional: Include detailed page properties (default: true)
}

この自動探索機能は、数十もの個別の API 呼び出しを行わずに Notion ページのコンテンツ全体を理解する必要のある AI アシスタントにとって特に役立ち、応答の速度と効率が大幅に向上します。

非同期処理

サーバーは、大規模な Notion ドキュメントを処理するための高度な並列処理技術を実装しています。

  • 複数のリクエストがバッチ処理され、同時に処理されます

  • ブロックの子のページネーションは自動的に処理されます

  • 結果は返される前に効率的に集計されます

  • コンソールログは、応答形式に影響を与えずにプロセスを可視化します。

例

  1. 次の命令を使用します。

Get the content of page 1a6b35e6e67f802fa7e1d27686f017f2

AI はブロック コンテンツを並列処理してページの詳細を効率的に取得します。

  1. データベース情報の使用:

Get the structure of database 8a6b35e6e67f802fa7e1d27686f017f2

発達

建てる:

pnpm build

実行する:

pnpm dev

ライセンス

マサチューセッツ工科大学

AIアシスタントのパフォーマンスメリット

Cursor や Claude などの最新の AI アシスタントでは、効果的に処理できるツールの数に制限があります。

  • ほとんどのモデルは合計40個を超えるツールを尊重しない可能性があります

  • ツールが多すぎると、全体的なパフォーマンスと推論能力が低下する可能性があります

  • 複雑なツールセットは応答の遅延と意思決定の困難さを増加させる

この読み取り専用実装は、これらの制限に対処するために、Notion API のサーフェスを意図的に縮小しつつ、すべての必須機能を維持しています。その結果、次のようになります。

  • AIアシスタントからのより高速で信頼性の高い応答

  • Notionコンテンツを操作する際の精度が向上

  • 集中的なAPI設計による全体的なパフォーマンスの向上

Available Tools

8 tools
API-get-background-resultC

Retrieve the result of a background processing request

Inputs: page_id (required).

API-get-block-childrenC

Retrieve block children

Inputs: block_id (required), start_cursor, page_size.

API-get-one-pagerB

Recursively retrieve a full Notion page with all its blocks, databases, and related content

Inputs: page_id (required), maxDepth, includeDatabases, includeComments, +5 more.

API-retrieve-a-blockC

Retrieve a block

Inputs: block_id (required).

API-retrieve-a-commentC

Retrieve comments

Inputs: block_id (required), start_cursor, page_size.

API-retrieve-a-databaseC

Retrieve a database

Inputs: database_id (required).

API-retrieve-a-pageC

Retrieve a page

Inputs: page_id (required), filter_properties.

API-retrieve-a-page-propertyC

Retrieve a page property item

Inputs: page_id (required), property_id (required), page_size, start_cursor.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    C2.9/5.0

    Scored across 8 tools

    Disambiguation4/5

    Most tools have distinct purposes targeting specific Notion resources (blocks, pages, databases, comments, properties), but 'API-retrieve-a-block' and 'API-get-block-children' could cause confusion as both relate to blocks with overlapping retrieval functions. The descriptions help clarify, but the boundary isn't perfectly clear.

    Naming Consistency3/5

    The naming follows a mostly consistent 'API-[verb]-a-[noun]' pattern for seven tools, but 'API-get-background-result' and 'API-get-one-pager' deviate with different verb structures ('get' vs 'retrieve') and compound nouns. This mixed convention reduces predictability, though the names remain readable.

    Tool Count5/5

    With 8 tools, the count is well-scoped for a read-only Notion server, covering key retrieval operations without bloat. Each tool serves a clear purpose, making the set manageable and focused on the server's stated functionality.

    Completeness4/5

    For a read-only server, the tool set provides comprehensive coverage of Notion's core resources (pages, blocks, databases, comments, properties) and includes useful utilities like background result retrieval. A minor gap exists in lacking a tool for listing/searching across multiple resources, but agents can work around this with the available retrieval tools.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      A token-optimized MCP server for Notion that reduces context window usage by 73% while preserving full functionality, enabling AI assistants to interact with Notion efficiently.
      20 npm
      2
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      A lightweight, read-only MCP server for Notion that enables searching, reading pages, and querying databases with token-efficient output and smart caching.
      26 npm
      5
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Fast, read-only MCP server for Notion that reads directly from local SQLite cache, enabling instant access to Notion pages, databases, and users without API calls or rate limits.
      2
      MIT