Notion MCP Integration
A simple Model Context Protocol (MCP) server that integrates with Notionβs API to manage my personal todo list through Claude. This is a basic implementation tailored specifically for my minimalist todo list setup in Notion.
Important Note
This is a personal project designed for a very specific use case: my simple Notion todo list that has just three properties:
- Task (title)
- When (select with only two options: βtodayβ or βlaterβ)
- Checkbox (marks if completed)
While you can use this as a starting point for your own Notion integration, youβll likely need to modify the code to match your specific database structure and requirements.
Features
- Add new todo items
- View all todos
- View todayβs tasks
- Check off a task as complete
Prerequisites
- Python 3.10 or higher
- A Notion account
- A Notion integration (API key)
- A Notion database that matches the exact structure described above (or willingness to modify the code for your structure)
Setup
- Clone the repository:
git clone https://github.com/yourusername/notion-mcp.git
cd notion-mcp
- Set up Python environment:
python -m venv .venv
source .venv/bin/activate # On Windows use: .venv\Scripts\activate
uv pip install -e .
-
Create a Notion integration:
- Go to https://www.notion.so/my-integrationsβ
- Create new integration
- Copy the API key
-
Share your database with the integration:
- Open your todo database in Notion
- Click ββ¦β menu β βAdd connectionsβ
- Select your integration
-
Create a
.env
file:
NOTION_API_KEY=your-api-key-here
NOTION_DATABASE_ID=your-database-id-here
- Configure Claude Desktop:
{
"mcpServers": {
"notion-todo": {
"command": "/path/to/your/.venv/bin/python",
"args": ["-m", "notion_mcp"],
"cwd": "/path/to/notion-mcp"
}
}
}
Running the Server
The server can be run in two ways:
- Directly from the command line:
# From the project directory with virtual environment activated
python -m notion_mcp
- Automatically through Claude Desktop (recommended):
- The server will start when Claude launches if configured correctly in
claude_desktop_config.json
- No manual server management needed
- Server stops when Claude is closed
Note: When running directly, the server wonβt show any output unless thereβs an error - this is normal as itβs waiting for MCP commands.
Usage
Basic commands through Claude:
- βShow all my todosβ
- βWhatβs on my list for today?β
- βAdd a todo for today: check emailsβ
- βAdd a task for later: review projectβ
Limitations
- Only works with a specific Notion database structure
- No support for complex database schemas
- Limited to βtodayβ or βlaterβ task scheduling
- No support for additional properties or custom fields
- Basic error handling
- No advanced features like recurring tasks, priorities, or tags
Customization
If you want to use this with a different database structure, youβll need to modify the server.py
file, particularly:
- The
create_todo()
function to match your database properties - The todo formatting in
call_tool()
to handle your data structure - The input schema in
list_tools()
if you want different options
Project Structure
notion_mcp/
βββ pyproject.toml
βββ README.md
βββ .env # Not included in repo
βββ src/
βββ notion_mcp/
βββ __init__.py
βββ __main__.py
βββ server.py # Main implementation
License
MIT License - Use at your own risk
Acknowledgments
- Built to work with Claude Desktop
- Uses Notionβs API