Notion MCP Server
Enables interaction with Notion databases through the Notion API, supporting full CRUD operations on pages and databases. Supports advanced querying, filtering, sorting, and all property types with Docker deployment for easy integration with Cursor and Claude.
README
Notion MCP Server
Notion API連携を行うMCP(Model Context Protocol)サーバー。CursorやClaudeと連携し、NotionのデータベースへのCRUD操作を可能にします。
特徴
- DDD(ドメイン駆動設計): 保守性の高いアーキテクチャ
- TDD(テスト駆動開発): 高品質なコード
- TypeScript: 型安全な実装
- Notion API統合: Notion APIの全般的な機能をサポート
- Docker対応: 環境構築不要で即座に利用可能
主な機能
ページ(レコード)操作
- ✅ ページ作成: データベースに新しいレコードを追加
- ✅ ページ取得: 指定したIDのレコードを取得
- ✅ ページ更新: レコードの各項目(プロパティ)を個別または一括更新
- テキスト、セレクト、マルチセレクト、日付、チェックボックス、数値、URL、メールアドレス、電話番号、ユーザー、関連ページなど、全てのプロパティタイプに対応
- ✅ ページ削除: レコードをアーカイブ(削除)
- ✅ ページクエリ: フィルター・ソート条件でレコードを検索
データベース操作
- ✅ データベース取得: 指定したIDのデータベース情報を取得
- ✅ データベース一覧: アクセス可能なデータベースを一覧表示
- ✅ データベース更新: データベースのタイトルやスキーマを更新
高度な機能
- 🔄 ページネーション: 大量データの自動ページング処理
- 🔍 フィルタリング: 条件に基づく柔軟な検索
- 📊 ソート: 複数条件による並び替え
- 📈 統計情報: データベースの統計取得
アーキテクチャ
src/
├── domain/ # ドメイン層(ビジネスロジック)
│ ├── entities/ # エンティティ
│ ├── repositories/ # リポジトリインターフェース
│ ├── services/ # ドメインサービス
│ └── value-objects/ # 値オブジェクト
├── infrastructure/ # インフラ層(外部システム連携)
│ ├── notion/ # Notion APIクライアント
│ └── repositories/ # リポジトリ実装
├── application/ # アプリケーション層(ユースケース)
│ └── use-cases/ # ビジネスユースケース
├── presentation/ # プレゼンテーション層(入出力)
│ └── mcp/ # MCPサーバー実装
└── shared/ # 共有コード
クイックスタート(Docker使用)🐳
最も簡単な方法はDockerを使用することです:
# Docker Hubから取得
docker pull kazuyaoda/notion-mcp:latest
# 実行
docker run -it \
-e NOTION_API_KEY=your_notion_api_key \
kazuyaoda/notion-mcp:latest
または、スクリプトを使用:
export NOTION_API_KEY=your_notion_api_key
./scripts/docker-run.sh
詳細は DOCKER.md を参照してください。
ローカル開発セットアップ
# 依存関係のインストール
npm install
# ビルド
npm run build
# テスト実行
npm test
# 開発モード
npm run dev
設定
環境変数 NOTION_API_KEY にNotion APIキーを設定してください。
export NOTION_API_KEY=your_notion_api_key
Cursor/Claudeでの使用方法
オプション1: Docker経由(推奨)
MCP設定ファイルに以下を追加:
{
"mcpServers": {
"notion": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"NOTION_API_KEY=your_notion_api_key",
"kazuyaoda/notion-mcp:latest"
]
}
}
}
オプション2: ローカル実行
{
"mcpServers": {
"notion": {
"command": "node",
"args": ["/path/to/notion-mcp/dist/index.js"],
"env": {
"NOTION_API_KEY": "your_notion_api_key"
}
}
}
}
機能
- ✅ ページの作成、取得、更新、削除
- ✅ データベースの取得と更新
- ✅ 高度なクエリ(フィルター、ソート、ページネーション)
- ✅ 統計情報の取得
- ✅ エラーハンドリング
ドキュメント
- ARCHITECTURE.md - アーキテクチャの詳細
- DOCKER.md - Docker使用ガイド
- EXAMPLES.md - 使用例
- INTEGRATION_TEST.md - 統合テストガイド
- SECURITY.md - セキュリティガイド
- QUICK_START.md - クイック公開ガイド
開発
テスト
# 全テスト実行
npm test
# カバレッジ付き
npm run test:coverage
# watch モード
npm run test:watch
Dockerビルド
# 基本ビルド
docker build -t notion-mcp:latest .
# マルチプラットフォームビルド
./scripts/docker-build.sh --multi-platform
# ビルドしてDocker Hubにプッシュ
./scripts/docker-build.sh --push --username kazuyaoda
ライセンス
MIT
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.