Marshal1l/mcp-notion-server
If you are the rightful owner of mcp-notion-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
A Python-based MCP server for integrating with the Notion API, enabling operations on Notion databases, pages, blocks, users, and comments via MCP tool calls.
MCP Notion Server
一个基于 Python 的 MCP (Model Context Protocol) 服务器,用于与 Notion API 集成,支持通过 MCP 工具调用对 Notion 数据库、页面、块、用户及评论的操作。
功能
-
通过 MCP 调用 Notion 工具:
- 增删改查块(block)
- 查询及更新页面(page)
- 查询、创建及更新数据库(database)
- 创建数据库条目(database item)
- 创建及查询评论(comment)
- 搜索 Notion 内容
- 列出及检索用户
-
支持 Markdown 转换 输出
-
支持 Streamable HTTP 传输,用于与 MCP 客户端集成
安装
- 克隆仓库
git clone https://github.com/Marshal1l/mcp-notion-server.git
cd mcp-notion-server
- 创建虚拟环境(推荐)
python -m venv venv
venv\Scripts\activate # Windows
# source venv/bin/activate # macOS / Linux
- 安装依赖
pip install mcp notion_client starlette uvicorn python-dotenv
配置
安全地设置 Notion Token
不要把 token 写入代码,推荐使用环境变量:
在 PowerShell 设置(只对当前用户有效):
setx NOTION_API_TOKEN "你的_notion_token"
运行
python notionMcpServer.py
默认监听 0.0.0.0:8000,MCP 客户端可以连接 /mcp 路径。
工具列表
以下 MCP 工具可用(需在 enabled_tools_set 中开启):
notion_append_block_childrennotion_retrieve_blocknotion_retrieve_block_childrennotion_delete_blocknotion_update_blocknotion_retrieve_pagenotion_update_page_propertiesnotion_list_all_usersnotion_retrieve_usernotion_retrieve_bot_usernotion_query_databasenotion_create_databasenotion_retrieve_databasenotion_update_databasenotion_create_database_itemnotion_create_commentnotion_retrieve_commentsnotion_search
测试
- Cherry Studio 提供 hosts 和 mcp-client 进行测试
- Cherry Studio 项目地址:https://github.com/CherryHQ/cherry-studio

引用
作者:Marshal1l 项目地址:https://github.com/Marshal1l/mcp-notion-server
参考:Official Notion MCP Server:https://github.com/makenotion/notion-mcp-server