Cover image
Try Now
2025-04-10

一个模型上下文协议(MCP)服务器实现概念集成,为与Intion的API进行交互提供了标准化的接口。

3 years

Works with Finder

3

Github Watches

15

Github Forks

92

Github Stars

Notion MCP Server

A Model Context Protocol (MCP) server implementation for Notion integration, providing a standardized interface for interacting with Notion's API. Compatible with Claude Desktop and other MCP clients.

Features

  • List and query Notion databases
  • Create and update pages
  • Search across Notion workspace
  • Get database details and block children
  • Full async/await support with httpx
  • Type-safe with Pydantic v2 models
  • Proper error handling with detailed logging
  • Compatibility with MCP 1.6.0

Installation

  1. Clone the repository:
git clone https://github.com/ccabanillas/notion-mcp.git
cd notion-mcp
  1. Create a virtual environment and install dependencies (using uv):
uv venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
uv pip install -e .

Alternatively, using standard venv:

python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
pip install -e .
  1. Create a .env file in the project root:
NOTION_API_KEY=your_notion_integration_token

Usage

  1. Test the server (it should run without errors):
python -m notion_mcp
  1. To use it with Claude Desktop, adjust your claude_desktop_config.json file (located at ~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
{
  "servers": {
    "notion-mcp": {
      "command": "/Users/username/Projects/notion-mcp/.venv/bin/python",
      "args": ["-m", "notion_mcp"],
      "cwd": "/Users/username/Projects/notion-mcp"
    }
  }
}

Be sure to replace /Users/username/ with your actual home directory path.

Development

Project Structure

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

Running Tests

pytest

Configuration

The server requires a Notion integration token. To set this up:

  1. Go to https://www.notion.so/my-integrations
  2. Create a new integration with appropriate capabilities (read/write as needed)
  3. Copy the integration token
  4. Add it to your .env file in the project root directory:
NOTION_API_KEY=your_notion_integration_token
  1. Share your Notion databases with the integration (from the database's "Share" menu)

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

MIT License - Use at your own risk

Troubleshooting

Common Issues

  • Connection Errors: Make sure your Notion API key is correct and you have internet access
  • Permission Errors: Ensure your integration has been given access to the databases you're trying to access
  • Claude Desktop Integration: If Claude Desktop isn't connecting, check that your config path is correct and that the server is running without logging to stdout

Acknowledgments

  • Built to work with Claude Desktop and other MCP clients
  • Uses Notion's API (latest compatible version 2022-02-22)
  • MCP 1.6.0 compatibility maintained
  • Special thanks to danhilse, I referenced his notion-mcp-server project

相关推荐

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Alexandru Strujac
  • Efficient thumbnail creator for YouTube videos

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • lumpenspace
  • Take an adjectivised noun, and create images making it progressively more adjective!

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • Yusuf Emre Yeşilyurt
  • I find academic articles and books for research and literature reviews.

  • Carlos Ferrin
  • Encuentra películas y series en plataformas de streaming.

  • https://zenepic.net
  • Embark on a thrilling diplomatic quest across a galaxy on the brink of war. Navigate complex politics and alien cultures to forge peace and avert catastrophe in this immersive interstellar adventure.

  • apappascs
  • 发现市场上最全面,最新的MCP服务器集合。该存储库充当集中式枢纽,提供了广泛的开源和专有MCP服务器目录,并提供功能,文档链接和贡献者。

  • ShrimpingIt
  • MCP系列GPIO Expander的基于Micropython I2C的操作,源自ADAFRUIT_MCP230XX

  • ravitemer
  • 一个功能强大的Neovim插件,用于管理MCP(模型上下文协议)服务器

  • jae-jae
  • MCP服务器使用剧作《无头浏览器》获取网页内容。

  • pontusab
  • 光标与风浪冲浪社区,查找规则和MCP

  • patruff
  • Ollama和MCP服务器之间的桥梁,使本地LLMS可以使用模型上下文协议工具

  • av
  • 毫不费力地使用一个命令运行LLM后端,API,前端和服务。

  • appcypher
  • 很棒的MCP服务器 - 模型上下文协议服务器的策划列表

  • chongdashu
  • 使用模型上下文协议(MCP),启用Cursor,Windsurf和Claude Desktop等AI助手客户,以通过自然语言控制虚幻引擎。

  • Mintplex-Labs
  • 带有内置抹布,AI代理,无代理构建器,MCP兼容性等的多合一桌面和Docker AI应用程序。

    Reviews

    4 (1)
    Avatar
    user_jfxjKGtY
    2025-04-16

    As a dedicated user of notion-mcp, I can confidently say it has revolutionized my workflow management. The seamless integration within Notion boosts productivity and efficiency. ccabanillas has done an exceptional job with this tool, making it easy to navigate and highly functional. I highly recommend checking out notion-mcp on GitHub for anyone looking to streamline their tasks and projects.