notion-mcp

notion-mcp

MCP server with 23 tools for full Notion integration, enabling database, page, block, user, search, comment, template, and duplication operations through natural language.

Category
访问服务器

README

notion-mcp

npm version Coverage

MCP server with full Notion capabilities (23 tools)

npm: https://www.npmjs.com/package/@west10tech/notion-mcp

Available Tools

This MCP server provides 23 tools:

Database Tools

  • notion_get_database: Get database by ID
  • notion_query_database: Query database pages
  • notion_create_database: Create a new database
  • notion_update_database: Update database properties

Page Tools

  • notion_get_page: Get page by ID
  • notion_create_page: Create a new page
  • notion_update_page: Update page properties
  • notion_get_page_property: Get page property by ID

Block Tools

  • notion_get_block_children: Get block children
  • notion_append_block_children: Append blocks to a parent block
  • notion_get_block: Get block by ID
  • notion_update_block: Update block content
  • notion_delete_block: Delete a block

User Tools

  • notion_list_users: List all users
  • notion_get_user: Get user by ID
  • notion_get_me: Get current bot user

Search & Comments

  • notion_search: Search pages and databases
  • notion_create_comment: Create a comment on a page or block
  • notion_get_comments: Get comments for a page or block

Template Tools

  • notion_create_page_from_template: Create a new page by copying blocks from a template page
  • notion_create_database_from_template: Create a new database by copying schema from a template database

Duplication Tools

  • notion_duplicate_page: Duplicate an existing page with its content blocks
  • notion_duplicate_database: Duplicate an existing database with its schema

Installation

npm install @west10tech/notion-mcp

Environment Setup

Create a .env file with the following variables:

NOTION_ACCESS_TOKEN=your_notion_access_token_here

Getting a Notion API Key

  1. Go to https://www.notion.so/my-integrations
  2. Click "New integration"
  3. Give it a name (e.g. "MCP Server") and select the workspace
  4. Under Capabilities, enable the permissions your integration needs (read content, update content, etc.)
  5. Click Submit and copy the Internal Integration Secret — this is your NOTION_ACCESS_TOKEN
  6. Important: Share pages/databases with your integration by clicking the ... menu on a page → Connections → select your integration

Usage

Running the server (stdio)

# Development mode
npm run dev

# Production mode
npm run build && npm start

Running with HTTP/SSE transport

# Start with HTTP transport
TRANSPORT_MODE=http PORT=3000 npm start

Environment variables for HTTP mode:

Variable Default Description
TRANSPORT_MODE stdio Set to http for HTTP/SSE transport
PORT 3000 HTTP server port
CORS_ORIGIN * Allowed CORS origin

HTTP endpoints:

  • POST / — MCP JSON-RPC messages
  • GET /health — Health check ({"status":"ok","server":"notion-mcp"})

Using with Claude Desktop

Add this to your Claude Desktop configuration:

{
  "mcpServers": {
    "notion-mcp": {
      "command": "npx",
      "args": ["@west10tech/notion-mcp"],
      "env": {
        "NOTION_ACCESS_TOKEN": "your_notion_access_token_here"
      }
    }
  }
}

Template & Duplication Workflows

Creating a page from a template

Use notion_create_page_from_template to copy the block structure of an existing page:

{
  "template_page_id": "abc123...",
  "parent": { "page_id": "def456..." },
  "title": "My New Page"
}

This reads all blocks from the template page and creates a new page with the same content.

Creating a database from a template

Use notion_create_database_from_template to copy the property schema of an existing database:

{
  "template_database_id": "abc123...",
  "parent": { "page_id": "def456..." },
  "title": "My New Database"
}

Duplicating a page

Use notion_duplicate_page to create an exact copy of a page (properties + blocks):

{
  "page_id": "abc123...",
  "title": "Custom Title"
}

If no title is provided, defaults to "Copy of {original title}". If no parent is provided, uses the same parent as the original.

Duplicating a database

Use notion_duplicate_database to copy a database's schema:

{
  "database_id": "abc123...",
  "title": "My Copy"
}

Advanced Features

Request Cancellation

This MCP server supports request cancellation according to the MCP cancellation specification. Clients can cancel in-progress requests by sending a notifications/cancelled message with the request ID.

When a request is cancelled:

  • The server immediately stops processing the request
  • Any ongoing API calls are aborted
  • Resources are cleaned up
  • No response is sent for the cancelled request

Progress Notifications

The server supports progress notifications for long-running operations according to the MCP progress specification.

To receive progress updates:

  1. Include a progressToken in your request metadata
  2. The server will send notifications/progress messages with:
    • Current progress value
    • Total value (when known)
    • Human-readable status messages

Progress is reported for:

  • Multi-step operations
  • Batch processing
  • Long-running API calls
  • Template and duplication operations

Example progress notification:

{
  "method": "notifications/progress",
  "params": {
    "progressToken": "operation-123",
    "progress": 45,
    "total": 100,
    "message": "Processing item 45 of 100..."
  }
}

TypeScript Types

All tool parameters are fully typed. Import types from @west10tech/notion-mcp/types:

  • GetDatabaseParams, QueryDatabaseParams, CreateDatabaseParams, UpdateDatabaseParams
  • GetPageParams, CreatePageParams, UpdatePageParams, GetPagePropertyParams
  • GetBlockChildrenParams, AppendBlockChildrenParams, GetBlockParams, UpdateBlockParams, DeleteBlockParams
  • ListUsersParams, GetUserParams
  • SearchParams, CreateCommentParams, GetCommentsParams
  • CreatePageFromTemplateParams, CreateDatabaseFromTemplateParams
  • DuplicatePageParams, DuplicateDatabaseParams
  • ToolResponse

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选