Skip to main content

A better Notion integration for AI agents

Project description

better-notion-mcp

A powerful Model Context Protocol (MCP) server that connects your AI agents (Claude, Cursor, etc.) directly to your Notion workspace.

Introduction

better-notion-mcp turns your Notion workspace into a semantic long-term memory and functional toolset for AI. Instead of just reading pages, it allows your agent to:

  • Remember facts in a local database for instant recall.
  • Search & Query your entire knowledge base.
  • Create & Edit pages with rich content (markdown, tables, mermaid, code).
  • Notify you via Telegram when important updates happen.

Prerequisites

Before using this tool, ensure you have the following installed:

  1. Python 3.10 or higher: Download here.
  2. pipx (Recommended): A tool to run Python applications in isolated environments.
    • Windows: winget install pipx (or pip install pipx then pipx ensurepath)
    • macOS: brew install pipx
    • Linux: sudo apt install pipx
    • (Alternatively, you can use uv directly).

Configuration

You need to set up your credentials before configuring the MCP client.

1. Notion Setup

  • Integration Token: Go to Notion My Integrations -> New Integration -> Copy the "Internal Integration Secret".
  • Page ID: Open the Notion page you want to use as the root. Copy the alphanumeric ID from the URL. Don't forget to connect this page to your specific integration.

2. Environment Variables

Variable Description Default / Note Required
NOTION_API_KEY Your Notion Integration Secret. -
NOTION_PAGE_ID The ID of the root page for creating/listing content. -
TELEGRAM_BOT_TOKEN Token from @BotFather for alerts. Optional
TELEGRAM_CHAT_ID Your Chat ID for receiving alerts. Optional
AGENT_MEMORY_PATH Path to the local SQLite DB. Win: C:\Users\<User>\.personal-knowledge-base\data\
Mac: ~/Library/.personal-knowledge-base/data/

Client Setup

Add the following to your MCP client configuration (e.g., claude_desktop_config.json for Claude Desktop).

Using pipx (Recommended)

This method downloads and runs the latest version automatically.

{
  "mcpServers": {
    "notion": {
      "command": "pipx",
      "args": ["run", "better-notion-mcp"],
      "env": {
        "NOTION_API_KEY": "secret_...",
        "NOTION_PAGE_ID": "page_id_...",
        "TELEGRAM_BOT_TOKEN": "bot_token_...",
        "...": "..."
      }
    }
  }
}

Using uv

{
  "mcpServers": {
    "notion": {
      "command": "uvx",
      "args": ["better-notion-mcp"],
      "env": {
        "NOTION_API_KEY": "secret_...",
        "NOTION_PAGE_ID": "page_id_...",
        "TELEGRAM_BOT_TOKEN": "bot_token_...",
        "...": "..."
      }
    }
  }
}

Features & Tools

Here is a detailed list of capabilities better-notion-mcp provides to your agent.

Feature Category Tool Name Description Arguments
Page Management create_page Create a new sub-page under your root page. title (str), content (str)
list_sub_pages List all child pages of a specific page. parent_id (str, optional)
read_page_content Read and parse the content of a page as Markdown. page_id (str)
Content Editing update_page Append rich content (paragraphs, code, tables) to a page. page_id (str), title (str), content (str), type (str), language (str)
log_to_notion Fast way to append a daily log/note to the root page. title (str), content (str)
Memory remember_fact Store a text snippet in the local SQLite database. fact (str)
search_memory Semantic search over stored facts. query (str)
get_recent_memories Retrieve the most recent facts. limit (int)
Utilities send_alert Send a push notification via Telegram. message (str)
Development

To contribute or run locally:

  1. Clone: git clone https://github.com/shubhamomar/better-notion-mcp.git
  2. Dev Install: uv pip install -e . (or pip install -e .)
  3. Run:
    export NOTION_API_KEY=...
    better-notion-mcp
    

License

This project is licensed under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

better_notion_mcp-0.1.2.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

better_notion_mcp-0.1.2-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file better_notion_mcp-0.1.2.tar.gz.

File metadata

  • Download URL: better_notion_mcp-0.1.2.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.16 {"installer":{"name":"uv","version":"0.9.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for better_notion_mcp-0.1.2.tar.gz
Algorithm Hash digest
SHA256 8c91eb2611f16860e1b7d3da01d59c66ae1da1c323e0d7d9180d47bae564b567
MD5 fd46aedf71b3be29e350f27ee4f0bb5b
BLAKE2b-256 1539a50e9653348f902418efaafed18acb2c792bd4912ffefebfed7413b986e4

See more details on using hashes here.

File details

Details for the file better_notion_mcp-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: better_notion_mcp-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.16 {"installer":{"name":"uv","version":"0.9.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for better_notion_mcp-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 515ccecb86f0e16a81cbd8049ae419cf9959e344ec39bc8af0685cf5da2ec867
MD5 62da7fe09194cf81e9beaed79cc1cdd6
BLAKE2b-256 d3db4a889ae440ea00812b0f08d9c84901f0d3ca8418bf72377b72ae30c6b3ac

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page