Notion MCPのロゴ

Notion MCP

コミュニティ
FR0ZON3

Notion mcp to connect AI agents to notion through markdown | Read and write notion markdown

公開者FR0ZON3
リポジトリnotion-mcp
言語TypeScript
フォーク
3
スター
119
利用可能なツール
0
通信方式stdio
ライセンスMIT
リンク
  • ツールをAIワークフローに接続

    Notion MCPは、対応するAIクライアントやAIエージェントから利用できるMCP機能を提供します。

  • 利用可能なツール(0個)

    呼び出し可能なアクションを以下で確認できます。サーバーから提供されている場合は、名前や説明も表示されます。

  • コピーして使える設定

    セットアップ用の設定例を使って、お好みのMCPクライアントにこのサーバーを設定できます。

  • オープンソースプロジェクトの注目度

    リンク先のリポジトリには119件のスターと3件のフォークがあります。

easy-notion-mcp

Production-oriented MCP server that connects AI agents to Notion through standard markdown instead of raw API JSON.

Agents read and write GFM markdown. The server handles block conversion, database schema mapping, OAuth, and optional Redis-backed persistence for multi-instance deployments.


Feature highlights

CapabilityDetails
Markdown-first I/O42 MCP tools; agents never construct Notion block JSON
Round-trip fidelity24 block types including toggles, columns, callouts, tables, uploads
Database ergonomicsWrite { "Status": "Done" } — schema conversion is automatic
Dual transportStdio (API token) and HTTP (OAuth or bearer-protected static token)
Security defaultsContent-notice prefix, URL sanitization, workspace-root file containment
Optional RedisShared schema cache and OAuth token persistence with graceful fallback
CLI profilesLow-context Notion access via easy-notion with readonly/readwrite modes

Architecture

Request workflow (tool call)


Project structure

easy-notion-mcp/
├── src/
│   ├── index.ts              # Stdio entry point
│   ├── http.ts               # HTTP/OAuth entry point
│   ├── cli.ts                # Profile-based CLI
│   ├── server.ts             # MCP tool & resource handlers
│   ├── notion-client.ts      # Notion SDK integration
│   ├── config/env.ts         # Typed environment parsing
│   ├── logging/logger.ts     # Structured logging
│   ├── persistence/          # Cache + Redis integration
│   │   ├── cache-store.ts
│   │   ├── init.ts
│   │   └── redis/
│   └── auth/                   # OAuth token storage
├── tests/                    # Vitest unit & integration tests
├── docs/AUDIT.md             # Engineering audit notes
├── skills/                   # Agent skill definitions
└── dist/                     # Compiled output (generated)

Design decisions

  • Single server module — tool handlers remain in server.ts to preserve the stable public MCP contract; supporting modules handle cross-cutting concerns.
  • Pluggable cache — CacheStore abstraction allows in-memory (default) or Redis backends without changing Notion client logic.
  • Fail-open Redis — if Redis is configured but unreachable, the server logs a warning and continues with in-memory/file persistence.

Installation

Prerequisites

From source

bash
git clone https://github.com/Grey-Iris/easy-notion-mcp.git
cd easy-notion-mcp
npm install
npm run build

Via npx (published package)

bash
npx -y easy-notion-mcp

MCP client configuration (stdio)

json
{
  "mcpServers": {
    "notion": {
      "command": "npx",
      "args": ["-y", "easy-notion-mcp"],
      "env": {
        "NOTION_TOKEN": "ntn_your_integration_token"
      }
    }
  }
}

Configuration

Copy .env.example to .env when running from a cloned checkout:

bash
cp .env.example .env

Core variables

VariableRequiredDefaultDescription
NOTION_TOKENYes (stdio)—Notion integration token
NOTION_ROOT_PAGE_IDNo—Default parent for create_page
NOTION_TRUST_CONTENTNofalseDisable content-notice prefix on reads
NOTION_MCP_WORKSPACE_ROOTNocwdRoot for local file:// uploads
LOG_LEVELNoinfoLogging verbosity

Redis persistence (optional)

VariableDefaultDescription
REDIS_ENABLEDfalseEnable Redis when true or when REDIS_URL is set
REDIS_URL—Full connection URL
REDIS_HOST127.0.0.1Host (when URL not set)
REDIS_PORT6379Port
REDIS_PASSWORD—Auth password
REDIS_DB0Database index
REDIS_KEY_PREFIXeasy-notion:Key namespace prefix
REDIS_CONNECT_TIMEOUT_MS10000Connection timeout
REDIS_MAX_RETRIES3Retry attempts before fallback

Example with local Redis:

bash
REDIS_ENABLED=true REDIS_URL=redis://127.0.0.1:6379/0 npm start

HTTP transport

VariableRequiredDefaultDescription
NOTION_MCP_BEARERYes (static HTTP)—Shared secret for /mcp requests
NOTION_OAUTH_CLIENT_IDOAuth mode—Public integration client ID
NOTION_OAUTH_CLIENT_SECRETOAuth mode—OAuth client secret
PORTNo3333Listen port
NOTION_MCP_BIND_HOSTNo127.0.0.1Bind address

Development

bash
# Install dependencies
npm install

# Watch mode
npm run dev

# Run stdio server locally
NOTION_TOKEN=ntn_... npm start

# Run HTTP server
NOTION_TOKEN=ntn_... NOTION_MCP_BEARER=$(openssl rand -hex 32) npm run start:http

Quality gates

bash
npm run build      # Compile TypeScript
npm run typecheck  # Type check without emit
npm run lint       # ESLint
npm test           # Vitest unit tests

Testing

bash
# Full unit suite (~850 tests)
npm test

# Watch mode
npm run test:watch

# Live Notion E2E (requires dedicated test workspace)
cp .env.example .env   # set E2E_ROOT_PAGE_ID
npm run test:e2e

Symlink-dependent security tests are automatically skipped on platforms where symlink creation is unavailable (common on Windows without Developer Mode).


Troubleshooting

SymptomLikely causeFix
NOTION_TOKEN is requiredMissing env varSet token in MCP config env block or .env
401 invalid_token (HTTP)Missing/wrong bearerSet NOTION_MCP_BEARER on server; send Authorization: Bearer …
outside the allowed workspace rootFile path escapes rootSet NOTION_MCP_WORKSPACE_ROOT or use absolute paths inside it
Redis warning on startupRedis unreachableStart Redis or set REDIS_ENABLED=false
Unknown property nameStale/wrong schemaCall get_database first; check case sensitivity
Symlink tests skippedOS restrictionEnable Windows Developer Mode or run on Linux/macOS

Enable debug logging:

bash
LOG_LEVEL=debug npm start

Contributing

  1. Fork the repository and create a feature branch from main
  2. Make focused changes with tests where behavior changes
  3. Run npm run build && npm run lint && npm test
  4. Open a pull request with a clear description and test plan

See docs/AUDIT.md for architecture context and known improvement areas.


FAQ

How is this different from the official Notion MCP server?
The official server returns raw Notion JSON (~6–7× more tokens per page read). This server converts to markdown agents already understand, with round-trip fidelity for 24 block types.

Do I need Redis?
No. Redis is optional and improves horizontal scaling (shared schema cache, OAuth tokens across HTTP instances). Single-process stdio deployments work fine without it.

Is markdown round-trip lossless?
For supported block types, yes. Unsupported native blocks (e.g. synced_block, embedded databases) emit warnings so agents avoid destructive rewrites.

Does file upload work over HTTP?
No. file:// uploads are stdio-only for security. Use HTTPS URLs or stdio transport for local files.

What Node version is required?
Node.js 20 or later.


License

MIT — see LICENSE.

Notion MCPのMCPを複数のAIモデルで活用

TypingMindはワークスペース単位でMCPツールに接続します。そのため、一度Notion MCPに接続すれば、モデルごとに個別に設定することなく、TypingMind内のさまざまなAIモデルで利用できます。 このMCPは、デバイス上のTypingMind MCPコネクタを通じてローカルで動作します。

ローカルコネクタのセットアップガイド

MCPサーバーが、お使いのコンピューター上のローカルファイル、アプリ、非公開リソースにアクセスする必要がある場合は、この方法を使います。

1

MCP設定を開く

TypingMindで「設定」→「詳細設定」→「Model Context Protocol」の順に進み、「コネクタを設定」を選択してください。

  1. ブラウザでTypingMindを開いてください。
  2. 設定アイコンをクリックしてください。
  3. 「詳細設定」に移動してください。
  4. 「Model Context Protocol」セクションを開いてください。
  5. 「コネクタを設定」をクリックし、「このデバイス」を選択してください。
「このデバイス」が選択されたTypingMindのMCPコネクタ設定画面
2

コネクタのコマンドを実行

「このデバイス」を選択し、TypingMindからコマンドをコピーしてターミナルで実行してください。MCPの使用中は、プロセスを実行したままにしてください。

  1. TypingMindに表示されるセットアップコマンドをコピーしてください。
  2. macOSではターミナルを、WindowsではWindows Terminalを開いてください。
  3. コマンドを貼り付けて実行してください。
  4. ターミナルで続行の確認を求められた場合は、パッケージのインストールを承認してください。
  5. MCPツールの使用中は、ターミナルウィンドウを開いたまま、プロセスの実行を継続してください。
3

Notion MCPをサーバーとして追加

コネクタのステータスが「準備完了」になったら、「サーバーを編集」をクリックし、MCPサーバーの設定を貼り付けてください。

  1. コネクタのステータスが「準備完了」になるまでお待ちください。
  2. 「サーバーを編集」をクリックしてください。
  3. Notion MCPのMCPサーバー設定を貼り付けてください。
  4. サーバー一覧を保存してください。
  5. コネクタのステータスが「準備完了」のままか確認するには、画面を更新してください。
稼働中のサーバーと「サーバーを編集」ボタンが表示されたTypingMindのMCP設定画面
{
  "mcpServers": {
    "fr0zon3-notion-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

複数のモデルで同じ接続を使用

サーバー一覧を保存し、「プラグイン」を開いてNotion MCPのMCPツールを有効にしてください。その後、TypingMindで対応するAIモデルを選択し、チャットでツールを使うか、AIエージェントに割り当ててください。

  1. TypingMindの「プラグイン」ページを開いてください。
  2. Notion MCPのMCPツールを有効にしてください。
  3. チャットを開始し、使用するAIモデルを選択してください。
  4. MCPツールをチャットで使うか、AIエージェントに割り当ててください。
  5. MCPに再接続することなく、必要に応じて別のAIモデルに切り替えられます。
選択したAIモデルと有効なMCPツールを使用したTypingMindのチャット
Notion MCPを使ってこのタスクを手伝ってもらえますか?
Notion MCP
はい、読みました。
Notion MCPで調べた結果をお伝えします。

よくある質問

Notion MCP MCPサーバーは何に使いますか?

Notion MCPは、対応するAIクライアントを外部ツールやコンテキストに接続するためのMCPサーバーです。TypingMindでは、このMCPサーバーを一度追加するだけで、AIワークスペース内でそのツールを利用できるようになります。

TypingMindでは、複数のAIモデルでNotion MCP MCPを利用できますか?

はい。TypingMindはワークスペース単位でMCPツールに接続するため、モデルごとにMCPサーバーを設定する必要はありません。Claude、ChatGPT、Geminiや、TypingMindで設定したその他のAIモデルでNotion MCPを利用できます。

TypingMindでNotion MCP MCPを使うメリットは何ですか?

TypingMindは、複数のAIモデル、プロンプト、プラグイン、AIエージェント、APIキー、MCPツールを1つのワークスペースにまとめられる、LLMチャット向けのトップクラスのフロントエンドです。Notion MCPを接続すると、TypingMindでチャットのワークフローを整理しながら、お好みのモデルでそのMCPツールを利用できます。

Notion MCP MCPをTypingMindに接続するにはどうすればよいですか?

Notion MCPはTypingMindのローカルMCPコネクタ経由で動作します。MCPサーバーがコンピューター上のローカルファイル、デスクトップアプリ、コマンドラインツール、プライベートリソースにアクセスする必要がある場合に最適です。

TypingMindでNotion MCP MCPのどのようなツールを利用できますか?

Notion MCPはMCP機能を提供しています。TypingMindのプラグインページで有効にすると、チャットで使用したり、AIエージェントに割り当てたりできます。

Notion MCP MCPを使うには、APIキーをTypingMindと共有する必要がありますか?

いいえ。TypingMindはローカルファーストの設計で、モデルプロバイダー、APIキー、プロンプト、MCP設定をご自身で管理できます。Notion MCPで認証が必要な場合は、接続の作成時に、そのMCPサーバーに必要なヘッダー、OAuth設定、またはローカル設定を追加してください。

関連するMCPサーバー

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇