About Notion MCP Client
Notion MCP Client performs page and database operations through the Notion API for users managing Notion from AI tools. It supports asynchronous requests, retries, and concurrency control, with an HTTP fallback when MCP is unavailable.
Key features
- 01Asynchronous Notion API operations
- 02Retries and concurrency control
- 03Environment and JSON configuration
- 04HTTP fallback when MCP is unavailable
Use cases
- 01Fill URL fields across Notion pages
- 02Run configured operations on Notion databases
- 03Call the service over HTTP where MCP is unavailable
MCP support
The project can run as an MCP server for AI tools to connect to and operate on Notion. It can also fall back to a standard HTTP server when MCP is unavailable.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
Tools
Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.
Details
From the project READMENotion MCP Client
A Model Context Protocol (MCP) client for interacting with the Notion API. This client is designed to be used in modern AI tools like Claude that support MCP for extended functionality.
Features
- Asynchronous API operations with retry logic
- Concurrency control to respect Notion API rate limits
- Environment-based configuration
- JSON-based operation configuration
- Flexible server implementation with MCP support
- Fall back to standard HTTP API when MCP is not available
Installation
pip install notion-mcp
Or install from source:
git clone https://github.com/yourusername/notion-mcp.git
cd notion-mcp
pip install -e .
For MCP support, install with the MCP extra:
pip install notion-mcp[mcp]
Configuration
Create a .env file with your Notion API credentials and configuration:
NOTION_TOKEN=your_notion_token_here
ROOT_PAGE_ID=your_root_page_id_here
MAX_RETRIES=3
RETRY_DELAYS=1,3,5
CONCURRENCY_LIMIT=5
TIMEOUT_MS=30000
Usage
Command Line
Run with default configuration:
notion-mcp
Run with a custom JSON configuration file:
notion-mcp config.json
Server
Start the server (with MCP support if available):
notion-mcp-server --host 0.0.0.0 --port 8000
The server will attempt to use the MCP protocol if available. If not, it will fall back to a standard HTTP server that accepts POST requests at /notion.
HTTP API
When using the HTTP API, send a POST request to /notion with a JSON body:
{
"root_page_id": "your_page_id_here",
"database_filter": ["Articles", "Resources"],
"operation": {
"type": "fill_web_url",
"params": {
"web_field": "网址"
}
}
}
Example using curl:
curl -X POST http://localhost:8000/notion \
-H "Content-Type: application/json" \
-d '{"root_page_id": "your_page_id_here", "operation": {"type": "fill_web_url"}}'
JSON Configuration
Create a JSON configuration file to customize the behavior:
{
"root_page_id": "your_page_id_here",
"database_filter": ["Articles", "Resources"],
"operation": {
"type": "fill_web_url",
"params": {
"web_field": "网址"
}
}
}
Using with Claude
To use this MCP client with Claude, you'll need to set up the server and then configure Claude to use it. Here's an example of how to do that:
{
"mcp_configurations": [
{
"name": "notion",
"endpoint": "http://localhost:8000/notion",
"description": "Access and manipulate Notion databases and pages"
}
]
}
Then, in your conversation with Claude, you can ask it to perform Notion operations like this:
Claude, please use the notion MCP to fill the web URL field in all pages of my Articles database.
Integration with Other Frameworks
The NotionRequestHandler class provides a flexible way to integrate with different frameworks:
from notion_mcp.handler import notion_handler
# Create an adapter for your framework
async def my_framework_handler(request):
# Extract data from your framework's request object
input_data = await request.json()
# Process with Notion handler
result = await notion_handler.handle_request(input_data)
# Return in your framework's response format
return MyFrameworkResponse(json=result)
Available Operations
fill_web_url: Finds URL fields in a page and copies values to a specified target URL field- More operations coming soon!
Development
To contribute to this project:
- Fork the repository
- Create a virtual environment:
python -m venv venv - Activate the environment:
source venv/bin/activate(Linux/Mac) orvenv\Scripts\activate(Windows) - Install development dependencies:
pip install -e ".[dev]" - Make your changes
- Run tests:
pytest - Submit a pull request
License
MIT
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.