Notion MCP 服务添加福利群:解决AI开发者的「MCP实战痛点」一个用于 Notion 集成的模型上下文协议(MCP)服务器实现,提供与 Notion API 交互的标准化接口。兼容 Claude Desktop 和其他 MCP 客户端。
通过 Smithery自动安装 Claude Desktop 的 Notion 集成服务器:
npx -y @smithery/cli install @ccabanillas/notion-mcp --client claude
git clone https://github.com/ccabanillas/notion-mcp.git
cd notion-mcp

uv venv
source .venv/bin/activate # 在 Windows 上:.venv\Scripts\activate
uv pip install -e .

或者,使用标准的 venv:
python -m venv venv
source venv/bin/activate # 在 Windows 上:venv\Scripts\activate
pip install -e .

.env 文件:NOTION_API_KEY=your_notion_integration_token
python -m notion_mcp
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 # Notion 对象的 Pydantic 模型 │ ├── __init__.py │ ├── __main__.py # 入口点 │ ├── client.py # Notion API 客户端 │ └── server.py # MCP 服务器实现 ├── .env # 环境变量(在此添加您的 Notion API 密钥) ├── .gitignore ├── pyproject.toml # 项目依赖 └── README.md
pytest
服务器需要一个 Notion 集成令牌。要进行设置:
.env 文件中:NOTION_API_KEY=your_notion_integration_token
git checkout -b feature/amazing-feature)git commit -m '添加一些很棒的功能')git push origin feature/amazing-feature)MIT 许可证 - 使用风险自负