CN

ccabanillas/notion-mcp

Developer tools

Эта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал

111 stars 23 forks Качество 61 Тренд 15MIT

ccabanillas/notion-mcp — это кандидат на сервер MCP, импортированный из https://github.com/ccabanillas/notion-mcp.

Обзор

ccabanillas/notion-mcp — это кандидат на сервер MCP, импортированный из https://github.com/ccabanillas/notion-mcp.

Обзор (машинный перевод)

Реализация сервера Model Context Protocol (MCP) для интеграции с Notion, обеспечивающая стандартизированный интерфейс для взаимодействия с API Notion. Совместима с Claude Desktop и другими клиентами MCP.

Особенности

  • Список и запрос баз данных Notion
  • Создание и обновление страниц
  • Поиск по рабочему пространству Notion.
  • Получить данные базы данных и блокировать потомки
  • Полная поддержка async/await с httpx
  • Типография с моделями Pydantic v2
  • Правильная обработка ошибок с подробным логированием
  • Совместимость с MCP 1.6.0

Установка

Установка через Smithery

Чтобы автоматически установить Notion Integration Server для Claude Desktop через Smithery:

Ручная установка

  1. Клонировать репозиторий:

  2. Создайте виртуальную среду и установите зависимости (с использованием uv):

Альтернативно, используя стандартный venv:

  1. Создайте файл .env в корне проекта:

Использование

  1. Проверьте сервер (он должен работать без ошибок):

  2. Чтобы использовать его с Claude Desktop, настройте ваш файл claude_desktop_config.json (расположенный в ~/Library/Application Support/Claude/claude_desktop_config.json на macOS):

Обязательно замените /Users/username/ на ваш настоящий путь домашней директории.

Развитие

Структура проекта

Эта страница переведена автоматически. Технические детали смотрите в оригинале.

README

Показан фрагмент оригинального README. Открыть оригинал.

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

Installing via Smithery

To install Notion Integration Server for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install @ccabanillas/notion-mcp --client claude

Manual 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
Открыть полный README на GitHub

Установка

npx -y @smithery/cli install @ccabanillas/notion-mcp --client claude
Новичок в MCP? Начните с руководства на mcpskill.org →