Notion MCP Server

Notion MCP Server

Stateless MCP server exposing the full Notion API as 33 tools, enabling users to manage pages, databases, blocks, comments, users, and file uploads using their own integration token.

Category
访问服务器

README

Notion MCP Server

Version 0.1.0

Stateless MCP server exposing the full Notion API as 33 tools over streamable-http transport. No server-side secrets — each user passes their own Notion integration token via Authorization header.

Prerequisites

  • Notion Integration Token — required for every user who connects
  • Docker (for deployment) or Python 3.13+ with uv (for local development)

Notion Integration Setup

Every user needs their own Notion integration token. Create one per user:

  1. Go to https://www.notion.so/profile/integrations
  2. Click "New integration"
  3. Give it a name (e.g., "MCP - John")
  4. Select the workspace
  5. Click Submit — you'll get a token starting with ntn_
  6. Share pages with the integration: open each page/database in Notion, click the ... menu → ConnectionsAdd connection → select your integration name

The integration only has access to pages explicitly shared with it. Without sharing, search_pages returns nothing.

Deploy with Docker

git clone https://github.com/LRGEX/notion-mcp.git
cd notion-mcp
docker compose build
docker compose up -d

Server starts on port 9201. Verify it's running:

curl -X POST http://localhost:9201/mcp \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{"jsonrpc":"2.0","method":"initialize","params":{"protocolVersion":"2025-03-26","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}},"id":1}'

Expected response: JSON with "result" containing server capabilities.

Connect an MCP Client

Oh My Pi

Add to ~/.omp/agent/mcp.json or .omp/mcp.json:

{
  "$schema": "https://raw.githubusercontent.com/can1357/oh-my-pi/main/packages/coding-agent/src/config/mcp-schema.json",
  "mcpServers": {
    "notion": {
      "type": "http",
      "url": "http://YOUR_SERVER_IP:9201/mcp",
      "headers": {
        "Authorization": "Bearer ntn_your_integration_token_here",
        "Accept": "application/json, text/event-stream"
      }
    }
  }
}

Replace YOUR_SERVER_IP with the server address (e.g., 192.168.1.101). Replace ntn_your_integration_token_here with your actual ntn_ token from the integration setup above.

Claude Desktop / Other MCP Clients

For any MCP client that supports streamable-http transport, point it at:

  • Endpoint: http://YOUR_SERVER_IP:9201/mcp

Pass the token in the Authorization: Bearer ntn_xxx header.

Multi-User

Multiple users can connect to the same server simultaneously. Each user provides their own ntn_ token in the Authorization header. The server is fully stateless — no sessions, no stored tokens, no .env file.

10 users = 10 different tokens, same Docker container, same port.

Run Locally (without Docker)

Requires Python 3.13+ and uv:

git clone https://github.com/LRGEX/notion-mcp.git
cd notion-mcp
uv sync
uv run notion-mcp

Server starts on http://0.0.0.0:9201.

Tools (33)

All tools automatically use the token from the request's Authorization header. No token parameter is needed in any tool call.

Meta

Tool Description
list_notion_tools List all available Notion tools and their descriptions

Search

Tool Description
search_pages Search pages by title, with sort/filter/pagination

Pages

Tool Description
create_page Create page with properties, content, icon, cover
retrieve_page Get page by ID
update_page Update page properties, content, icon, cover
trash_page Move page to trash
move_page Move page to new parent
retrieve_page_as_markdown Get page content as markdown
update_page_markdown Update page content via markdown string

Data Sources (Databases)

Tool Description
create_data_source Create a data source
retrieve_data_source Get data source by ID
update_data_source Update data source properties
query_data_source Query with filters/sorts/pagination
list_data_source_templates List available templates

Databases

Tool Description
retrieve_database Get database metadata and schema

Blocks

Tool Description
retrieve_block Get block by ID
retrieve_block_children List child blocks
append_block_children Append blocks to parent
update_block Update a block
delete_block Delete a block

Comments

Tool Description
create_comment Create a comment
list_comments List comments with filters
retrieve_comment Get comment by ID
update_comment Update comment text
delete_comment Delete a comment

Users

Tool Description
list_users List workspace users
retrieve_user Get user by ID
retrieve_self Get authenticated user info

File Uploads

Tool Description
create_file_upload Initiate file upload
send_file_upload Send file data
complete_file_upload Finalize upload
list_file_uploads List file uploads
retrieve_file_upload Get upload status

Architecture

  • Stateless — no stored tokens, no sessions, no .env file
  • Auth via header — reads Authorization: Bearer ntn_xxx from every request
  • Multi-user — different tokens per connection, zero shared state
  • Transport — streamable-http
  • Framework — FastMCP from the official mcp Python SDK
  • API clientnotion-client v3.1.0 (official Notion async client)

Port Allocation

Port MCP Service
9201 Notion
9202 (reserved)
9203 (reserved)

Project Structure

notion_mcp/
├── Dockerfile
├── docker-compose.yml
├── pyproject.toml
├── README.md
├── src/notion_mcp/
│   ├── __init__.py            # Package metadata
│   ├── client.py              # create_client(token) — stateless factory
│   ├── server.py              # FastMCP server — all 33 tool definitions
│   └── tools/                 # (unused — tools are inline in server.py)
│       ├── blocks.py
│       ├── comments.py
│       ├── data_sources.py
│       ├── databases.py
│       ├── files.py
│       ├── pages.py
│       ├── search.py
│       └── users.py
└── mcp_configs/
    └── notion.json            # MCP client config reference

Dependencies

Package Version Purpose
mcp >=1.6.0 MCP framework (FastMCP, transports)
notion-client >=3.1.0 Official Notion API async client
pydantic >=2.0.0 Parameter validation

License Apache-2.0 license

Proprietary — LRGEX. All rights reserved.

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选