
fr0zon3/notion-mcp
Developer toolsこのページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る
Notion mcp:マークダウンを通じてAIエージェントをNonotに接続 |Notion Markdownを読み書き
概要
本番環境向けのMCPサーバーで、AIエージェントを生のAPI JSONではなく標準のマークダウンでNotionに接続します。 エージェントはGFMマークダウンを読み書きします。サーバーはブロック変換、データベーススキーママッピング、OAuth、そしてマルチインスタンス展開のためのRedisバックアップの永続性をオプションで処理します。 - — ツールハンドラは安定した公開MCPコントラクトを維持するためにserver.tsに残ります。サポートモジュールはクロスカッティングの懸念を処理します。- — キャッシュストア抽象化により、Notionクライアントロジックを変更することなくメモリ内(デフォルト)またはRedisのバックエンドが可能になります。- — Redisが設定されているがアクセスできない場合、サーバーは警告を記録し、メモリ内/ファイルの永続性を継続します。 - Node.js 20+ - ページ共有されたNotion統合 クローンチェックアウトから実行する際に.env.exampleを.envにコピーする方法: シンムリンク作成ができないプラットフォーム(開発者モードなしのWindowsではよく見られます)では、シンリンク依存のセキュリティテストは自動的にスキップされます。 1. リポジトリをフォークし、メインからフィーチャーブランチを作成する 2.
概要(AI 翻訳)
本番環境向けのMCPサーバーで、AIエージェントを生のAPI JSONではなく標準のマークダウンでNotionに接続します。
エージェントはGFMマークダウンを読み書きします。サーバーはブロック変換、データベーススキーママッピング、OAuth、そしてマルチインスタンス展開のためのRedisバックアップの永続性をオプションで処理します。
特集ハイライト
| 能力 | 詳細 |
|---|---|
| Markdown優先I/O42のMCPツール;エージェントはNotionブロックJSONを構築しません | |
| 往復忠実度 | トグル、列、コールアウト、テーブル、アップロードを含む24種類のブロックタイプ |
| データベースのエルゴノミクス | { "Status": "Done" } を書く — スキーマ変換は自動です |
| デュアルトランスポート | Stdio(APIトークン)とHTTP(OAuthまたはベアラー保護の静的トークン) |
| セキュリティデフォルト | コンテンツ通知プレフィックス、URLサニタイズ、ワークスペースルートファイルの包含 |
| オプションRedis共有スキーマキャッシュとOAuthトークン永続化、グレースフルフォールバック | |
| CLIプロファイル | 読み取り専用/読み書きモードを使ったeasy-notionを経た低文脈Notionアクセス |
建築
ワークフローをリクエスト(ツールコール)
プロジェクト構成
デザインの決定
- 単一サーバーモジュール — ツールハンドラーはサーバー内に残ります。
このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。
README
以下は原文 README の抜粋です。原文を見る。
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
| Capability | Details |
|---|---|
| Markdown-first I/O | 42 MCP tools; agents never construct Notion block JSON |
| Round-trip fidelity | 24 block types including toggles, columns, callouts, tables, uploads |
| Database ergonomics | Write { "Status": "Done" } — schema conversion is automatic |
| Dual transport | Stdio (API token) and HTTP (OAuth or bearer-protected static token) |
| Security defaults | Content-notice prefix, URL sanitization, workspace-root file containment |
| Optional Redis | Shared schema cache and OAuth token persistence with graceful fallback |
| CLI profiles | Low-context Notion access via easy-notion with readonly/readwrite modes |
Architecture
flowchart TB
subgraph clients [MCP Clients]
CC[Claude Code / Cursor]
HTTP[HTTP MCP clients]
end
subgraph transport [Transport Layer]
STDIO[index.ts — stdio]
HTTP_SRV[http.ts — Express]
end
subgraph core [Application Core]
SRV[server.ts — MCP tools & resources]
NC[notion-client.ts — Notion SDK wrapper]
MD[markdown converters]
end
subgraph persistence [Persistence — optional]
MEM[(In-memory cache)]
REDIS[(Redis)]
FS[(Encrypted token files)]
end
CC --> STDIO
HTTP --> HTTP_SRV
STDIO --> SRV
HTTP_SRV --> SRV
SRV --> NC
SRV --> MD
NC --> MEM
NC --> REDIS
HTTP_SRV --> FS
HTTP_SRV --> REDIS
Request workflow (tool call)
sequenceDiagram
participant Agent
participant MCP as MCP Server
participant Cache as Cache Store
participant Notion as Notion API
Agent->>MCP: tools/call (e.g. read_page)
MCP->>Notion: blocks.children.list (paginated)
Notion-->>MCP: block tree
MCP->>MCP: blocks → markdown
MCP-->>Agent: { markdown, warnings? }
Agent->>MCP: tools/call (add_database_entry)
MCP->>Cache: get schema:dbId
alt cache miss
Cache->>Notion: dataSources.retrieve
Notion-->>Cache: schema
Cache-->>MCP: schema
else cache hit
Cache-->>MCP: schema
end
MCP->>MCP: convert property values
MCP->>Notion: pages.create
Notion-->>MCP: page
MCP-->>Agent: { id, url }
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
インストール
npx -y easy-notion-mcp設定
{
"mcpServers": {
"notion": {
"command": "npx",
"args": ["-y", "easy-notion-mcp"],
"env": {
"NOTION_TOKEN": "ntn_your_integration_token"
}
}
}
}