Notion MCP Server
Not MCP 服务器
用于 Notion 集成的模型上下文协议 (MCP) 服务器实现,提供与 Notion API 交互的标准化接口。兼容 Claude Desktop 和其他 MCP 客户端。
特征
列出并查询 Notion 数据库
创建和更新页面
在 Notion 工作区中搜索
获取数据库详细信息并阻止子项
通过 httpx 提供完整的 async/await 支持
使用 Pydantic v2 模型实现类型安全
通过详细的日志记录正确处理错误
与 MCP 1.6.0 兼容
Related MCP server: Notion MCP Server
安装
克隆存储库:
git clone https://github.com/ccabanillas/notion-mcp.git
cd notion-mcp创建虚拟环境并安装依赖项(使用 uv):
uv venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
uv pip install -e .或者,使用标准 venv:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -e .在项目根目录中创建一个
.env文件:
NOTION_API_KEY=your_notion_integration_token用法
测试服务器(它应该正常运行):
python -m notion_mcp要将其与 Claude Desktop 一起使用,请调整您的
claude_desktop_config.json文件(位于 macOS 上的~/Library/Application Support/Claude/claude_desktop_config.json):
{
"servers": {
"notion-mcp": {
"command": "/Users/username/Projects/notion-mcp/.venv/bin/python",
"args": ["-m", "notion_mcp"],
"cwd": "/Users/username/Projects/notion-mcp"
}
}
}请务必将/Users/username/替换为您的实际主目录路径。
发展
项目结构
notion-mcp/
├── src/
│ └── notion_mcp/
│ ├── models/
│ │ ├── __init__.py
│ │ └── notion.py # Pydantic models for Notion objects
│ ├── __init__.py
│ ├── __main__.py # Entry point
│ ├── client.py # Notion API client
│ └── server.py # MCP server implementation
├── .env # Environment variables (add your Notion API key here)
├── .gitignore
├── pyproject.toml # Project dependencies
└── README.md运行测试
pytest配置
服务器需要 Notion 集成令牌。设置方法如下:
创建具有适当功能的新集成(根据需要读/写)
复制集成令牌
将其添加到项目根目录中的
.env文件中:
NOTION_API_KEY=your_notion_integration_token通过集成共享您的 Notion 数据库(从数据库的“共享”菜单)
贡献
分叉存储库
创建你的功能分支(
git checkout -b feature/amazing-feature)提交您的更改(
git commit -m 'Add some amazing feature')推送到分支(
git push origin feature/amazing-feature)打开拉取请求
执照
MIT 许可证 - 使用风险自负
故障排除
常见问题
连接错误:请确保您的 Notion API 密钥正确并且您可以访问互联网
权限错误:确保您的集成已获得您尝试访问的数据库的访问权限
Claude Desktop 集成:如果 Claude Desktop 未连接,请检查您的配置路径是否正确,以及服务器是否正在运行且未记录到 stdout
致谢
专为与 Claude Desktop 和其他 MCP 客户端配合使用而设计
使用 Notion 的 API(最新兼容版本 2022-02-22)
保持 MCP 1.6.0 兼容性
特别感谢danhilse ,我参考了他的notion-mcp-server项目
This server cannot be deployed
Maintenance
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
A Model Context Protocol server for Wix AI tools
MCP-native open-source Notion alternative: read & write pages, databases and kanban boards.
Model Context Protocol server for the Apideck Unified API. Connect any MCP-compatible agent framework to 100+ accounting systems, HRIS platforms, file storage providers, and more through one integration. More information https://www.apideck.com/mcp-server
Related MCP Servers
- AlicenseDqualityDmaintenanceA Model Context Protocol server that enables Claude and other LLMs to interact with Notion workspaces, providing capabilities like searching, retrieving, creating and updating pages, as well as managing databases.101,0693MIT
- AlicenseCqualityDmaintenanceA Model Context Protocol (MCP) server that exposes the official Notion SDK, allowing AI models to interact with Notion workspaces.173510Apache 2.0
- AlicenseAqualityDmaintenanceA Model Context Protocol server that connects AI assistants like Claude to Notion workspaces, enabling them to view, search, create, and update Notion databases, pages, and content blocks.121,0691MIT
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that provides a standardized interface for AI models to access, query, and modify content in Notion workspaces.1,0694MIT