Skip to main content
Glama

Notion MCP Server

Docker Image License: MIT

Notion API連携を行うMCP(Model Context Protocol)サーバー。CursorやClaudeと連携し、NotionのデータベースへのCRUD操作を可能にします。

特徴

  • DDD(ドメイン駆動設計): 保守性の高いアーキテクチャ

  • TDD(テスト駆動開発): 高品質なコード

  • TypeScript: 型安全な実装

  • Notion API統合: Notion APIの全般的な機能をサポート

  • Docker対応: 環境構築不要で即座に利用可能

Related MCP server: Notion MCP Server

主な機能

ページ(レコード)操作

  • ✅ ページ作成: データベースに新しいレコードを追加

  • ✅ ページ取得: 指定した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"
      }
    }
  }
}

機能

  • ✅ ページの作成、取得、更新、削除

  • ✅ データベースの取得と更新

  • ✅ 高度なクエリ(フィルター、ソート、ページネーション)

  • ✅ 統計情報の取得

  • ✅ エラーハンドリング

ドキュメント

開発

テスト

# 全テスト実行
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

Available Tools

8 tools
create_pageA

Creates a new page (record) in a Notion database. Use this to add new entries such as tasks, projects, notes, etc. to any database. You can set properties like title, status, date, assignee, and more when creating the page.

Inputs: databaseId (required), properties (required).

delete_pageA

Deletes (archives) a Notion page (database record). In Notion, deletion is actually an archive operation and can be restored later. Use this to organize completed tasks, finished projects, etc.

Inputs: pageId (required).

get_databaseA

Retrieves detailed information about a specific Notion database by its ID. Returns database title, schema (property definitions), creation time, last edited time, and more. Use this to understand database structure.

Inputs: databaseId (required).

get_pageA

Retrieves detailed information about a specific Notion page (database record) by its ID. Returns all properties (fields), creation time, last edited time, archive status, and more.

Inputs: pageId (required).

list_databasesA

Lists all Notion databases accessible to the integration. Returns each database's ID, title, creation time, and archive status. Use this to discover available databases.

Inputs: no named parameters.

query_pagesB

Queries and retrieves pages (records) from a Notion database. Supports filtering and sorting. Examples: "tasks with status In Progress", "projects due this week", "tasks assigned to me". Retrieve pages matching specific conditions.

Inputs: databaseId (required), filter, sorts, startCursor, +1 more.

update_databaseA

Updates the database itself (not individual records). Can change database title or update schema (add/modify/delete properties/columns). Note: To update individual records, use update_page instead.

Inputs: databaseId (required), title, schema.

update_pageA

Updates properties (fields) of a Notion page (database record). Supports ALL property types: title, status, date, checkbox, number, select, multi-select, URL, email, phone number, people, relations, and more. You can update individual properties or multiple properties simultaneously. Examples: change status to "Completed", update progress to 80%, set deadline to next Friday, change assignee, etc.

Inputs: pageId (required), properties (required).

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A4.2/5.0

    Scored across 8 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose with no overlap: create_page and delete_page handle page lifecycle, get_database and get_page retrieve specific resources, list_databases and query_pages provide listing/querying capabilities, and update_database and update_page target database vs. page updates. The descriptions explicitly differentiate tools like update_database (for schema) vs. update_page (for record properties).

    Naming Consistency5/5

    All tools follow a consistent verb_noun pattern (e.g., create_page, delete_page, get_database, list_databases, query_pages, update_database, update_page). The naming is uniform throughout, using snake_case and clear action verbs aligned with the resource type, making the set predictable and easy to navigate.

    Tool Count5/5

    With 8 tools, this server is well-scoped for managing Notion databases and pages. It covers core operations (CRUD, querying, listing) without being overly sparse or bloated. Each tool serves a distinct and necessary function in the domain, making the count appropriate for the server's purpose.

    Completeness5/5

    The tool set provides complete CRUD/lifecycle coverage for Notion databases and pages: create_page, get_page, update_page, and delete_page handle page operations; get_database, list_databases, and update_database manage databases; and query_pages enables filtering. There are no obvious gaps, supporting full agent workflows from discovery to modification.

    Related MCP Connectors

    Related MCP Servers