A better Notion integration for AI agents
Project description
better-notion-mcp
A Model Context Protocol (MCP) server for a better Notion integration for AI agents.
Features
- Standard MCP Support: connect with Claude Desktop, Cursor, and other MCP clients.
- Configurable: Easy setup via environment variables or configuration files.
- Tools:
- List databases
- Query database contents
- Get page content (as Markdown)
- Create pages
- Append blocks to pages
- Search
Installation
Using uv (Recommended)
uv tool install better-notion-mcp
Using pip
pip install better-notion-mcp
Usage
Notion Setup
- Integration Token:
- Go to Notion My Integrations.
- Create a new integration.
- Copy the "Internal Integration Secret" (
NOTION_API_KEY).
- Page ID:
- Open the Notion page you want to use as the root/parent.
- Copy the Page ID from the URL (the alphanumeric string at the end).
- Share this page with your integration (click "..." > Connect to > Your Integration).
- Set this as
NOTION_PAGE_ID.
Database Configuration (Optional)
The MCP server maintains a local SQLite database for agent memory (agent_memory.db). You can configure its location using the AGENT_MEMORY_PATH environment variable.
Default Locations:
- Windows:
C:\Users\<username>\.personal-knowledge-base\data\agent_memory.db - macOS:
~/Library/.personal-knowledge-base/data/agent_memory.db - Linux:
~/.personal-knowledge-base/data/agent_memory.db
Telegram Setup (Optional)
- Create a bot using @BotFather to get your
TELEGRAM_BOT_TOKEN. - Get your
TELEGRAM_CHAT_ID(you can use@userinfobot).
Claude Desktop Configuration
Add the following to your ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"notion": {
"command": "uv",
"args": [
"tool",
"run",
"better-notion-mcp"
],
"env": {
"NOTION_API_KEY": "secret_...",
"NOTION_PAGE_ID": "page_id_...",
"TELEGRAM_BOT_TOKEN": "bot_token_...",
"TELEGRAM_CHAT_ID": "chat_id_...",
"AGENT_MEMORY_PATH": "/path/to/custom/agent_memory.db"
}
}
}
}
}
If you installed via pip/venv, point to the executable:
{
"mcpServers": {
"notion": {
"command": "better-notion-mcp",
"env": {
"NOTION_API_KEY": "secret_...",
"NOTION_PAGE_ID": "page_id_...",
"TELEGRAM_BOT_TOKEN": "bot_token_...",
"TELEGRAM_CHAT_ID": "chat_id_...",
"AGENT_MEMORY_PATH": "/path/to/custom/agent_memory.db"
}
}
}
}
}
Development
- Clone the repository.
- Install dependencies:
pip install -e .
- Run locally:
export NOTION_API_KEY=secret_... export NOTION_PAGE_ID=page_id_... # Optional export TELEGRAM_BOT_TOKEN=... export TELEGRAM_CHAT_ID=... better-notion-mcp
License
MIT
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file better_notion_mcp-0.1.0.tar.gz.
File metadata
- Download URL: better_notion_mcp-0.1.0.tar.gz
- Upload date:
- Size: 5.9 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
89f25c6973cd26eedd18b7cb38dae9b7ce3f0ccbb35c9cf958f84426f2fd8005
|
|
| MD5 |
49765f215c2b34ce74633b75f232f622
|
|
| BLAKE2b-256 |
c55937c9a6bbd64284507b685ed99b74351b1ebb70beeafc03fe10be60c88c06
|
File details
Details for the file better_notion_mcp-0.1.0-py2.py3-none-any.whl.
File metadata
- Download URL: better_notion_mcp-0.1.0-py2.py3-none-any.whl
- Upload date:
- Size: 6.5 kB
- Tags: Python 2, 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
67561f0476073ffc7140264db91e285edb4ba36b5ddb78867597f173de99ed0e
|
|
| MD5 |
91848a724ad143336c7a3f4fbe1b5d1b
|
|
| BLAKE2b-256 |
dcabf8a2078d98725169634c4195dbf2732f6dadc8accb9d0f81be6c990cbf17
|