Purpose
This Notion MCP server is designed to provide AI agents or chatbots with a standard interface for interacting with Notion workspaces, and is part of the Agentic Longterm Memory system. It exposes Notion operation capabilities through the Model Context Protocol (MCP) and a REST API, enabling AI applications to search, read, create, and update Notion pages and database content.
Key Capabilities
- Core Operations: Search pages and databases (with advanced filtering support), create/read/update pages, add paragraphs, headings, bulleted lists, to-dos, links, and bookmarks, and list and query databases.
- Advanced Content Types: Supports bookmarks (external website links with URL validation) and in-page links (link_to_page), as well as all major Notion block types; long content is automatically split (2000+ characters).
- Analytics and Insights: Workspace analytics (total page count, database count, recent activity), content structure analysis, activity tracking, and performance metrics (configurable timeouts).
- Bulk Operations: Smart pagination prevents timeouts, supports bulk adding of content blocks and bulk creation and management of pages, with configurable limits and whether to count blocks.
- API Interfaces: FastAPI REST API (production-ready HTTP endpoints), interactive CLI, MCP compatible, and a unified endpoint for AI agents.
- Production Features: Comprehensive input validation and error handling, environment-based configuration management, intelligent error recovery, health checks and capability detection, structured logging, CORS support, and dynamic timeouts based on operation complexity.
- Testing and Quality: A 46KB test suite (1,158 lines) covering 13+ test categories (core, content, bulk, links, analytics, edge cases, etc.), including validation tests, performance tests, and JSON reports.
Usage
- Prepare a Notion account and integration token (starting with ntn_), and share the target pages/databases with the integration.
- Install dependencies (pip or conda), and create a .env file in the project root to configure environment variables.
- Start the FastAPI server (default port 8081); you can visit /docs for API documentation and /health for health checks.
- You can also use the interactive CLI or integrate via Python code.
- The agent integration endpoint supports actions such as search, read_page, create_page, add_content, bulk_add_content, analytics, and bulk_operations.
- Run python test_server.py to execute the comprehensive test suite.
Applicable Scenarios
Suitable for scenarios that require deep integration of AI agents' or chatbots' long-term memory with Notion workspaces, such as automatically organizing notes, retrieving knowledge bases, bulk updating page content, and analyzing workspace activity.
Limitations
- A valid Notion integration token is required, and pages/databases must be shared with the integration.
- Content block length is limited to 2000 characters; content exceeding this is automatically split.
- Bulk operations require attention to pagination limits (1-50 pages) and timeout settings.
- Bookmark URLs must be valid HTTP/HTTPS addresses.
- The project does not provide clear license information; confirm before use.
- Details such as fees, pricing, and platform support are not yet provided.