notion-mcp-server
by: awkoy
**Notion MCP Server** is a Model Context Protocol (MCP) server implementation that enables AI assistants to interact with Notion's API. This production-ready server provides a complete set of tools.
πOverview
Purpose: The Notion MCP Server aims to facilitate interactions between AI assistants and Notion's API, allowing users to manage Notion content via natural language.
Overview: This production-ready server is designed to help developers integrate AI functionalities with Notion, offering a robust set of tools and endpoints for manipulating Notion's data structure efficiently.
Key Features:
-
π Notion Integration: Allows seamless interaction with Notion databases, pages, and blocks to enhance content management.
-
π Universal MCP Compatibility: Supports various MCP clients including Cursor, Claude Desktop, and others, ensuring versatility.
-
π Data Retrieval: Users can fetch information from Notion, enabling their AI assistants to access and utilize relevant data.
-
βοΈ Content Creation: Enables users to create and update pages and blocks within Notion using just their voice or text commands.
-
π Block Management: Provides features to append, update, and delete blocks within Notion pages, streamlining content organization.
-
πΎ Database Operations: Facilitates the creation, querying, and updating of databases for efficient project tracking.
-
π Batch Operations: Empowers users to perform multiple operations in a single request, optimizing interaction efficiency.
-
ποΈ Archive & Restore: Allows users to archive and restore pages as needed, enhancing data management capabilities.
-
π Search Functionality: Supports searching for pages and databases by title, making information retrieval quick and user-friendly.
Notion MCP Server
Notion MCP Server is a Model Context Protocol (MCP) server implementation that enables AI assistants to interact with Notion's API. This production-ready server provides tools and endpoints for reading, creating, and modifying Notion content through natural language interactions.
π§ Active Development: Database support is now available! Comments and user management tools have been added. If you find this project useful, please consider giving it a star to support further development.
π Table of Contents
- Getting Started & Integration
- Setup Process
- Cursor Integration
- Claude Desktop Integration
- Features
- Documentation
- Available Tools
- Available Resources
- Development
- Technical Details
- Troubleshooting
- Contributing
- License
π Getting Started & Integration
Setup Process
-
Obtain a Notion API Key
- Create an integration at Notion Developers
- Copy your API key
-
Enable Integration for Your Pages
- Select or create a page in Notion
- Click the "..." menu in the top right corner
- Go to "Connections"
- Find and enable your integration from the list
-
Choose Your Integration Method
- Follow one of the integration options below based on your preferred MCP client
-
Ask Your AI Assistant to Interact with Notion
- Example commands:
- "Create a new page with today's tasks"
- "Update my meeting notes in Notion"
- "Add bullet points to my meeting notes page"
- "Create a new database for tracking projects"
- "Add new entries to my task database"
- "Add a comment to my project page"
- "Show me all comments on this document"
- "List all users in my workspace"
- "Get information about a specific user"
- Example commands:
Cursor Integration
Method 1: Using mcp.json
- Create or edit the
.cursor/mcp.json
file in your project directory:
{
"mcpServers": {
"notion-mcp-server": {
"command": "env NOTION_TOKEN=YOUR_KEY NOTION_PAGE_ID=YOUR_PAGE_ID npx",
"args": ["-y", "notion-mcp-server"]
}
}
}
- Replace
YOUR_KEY
andYOUR_PAGE_ID
with your actual Notion API key and page ID - Restart Cursor to apply the changes
Method 2: Manual Mode
- Open Cursor settings
- In the "MCP" or "Model Context Protocol" section, add a new server
- Enter the following command:
env NOTION_TOKEN=YOUR_KEY NOTION_PAGE_ID=YOUR_PAGE_ID npx -y notion-mcp-server
- Replace
YOUR_KEY
andYOUR_PAGE_ID
accordingly - Save and restart Cursor if necessary
Claude Desktop Integration
- Create or edit the
mcp.json
file in your configuration directory:
{
"mcpServers": {
"notion-mcp-server": {
"command": "npx",
"args": ["-y", "notion-mcp-server"],
"env": {
"NOTION_TOKEN": "YOUR_KEY",
"NOTION_PAGE_ID": "YOUR_PAGE_ID"
}
}
}
}
- Replace
YOUR_KEY
andYOUR_PAGE_ID
with actual values - Restart Claude Desktop to apply changes
π Features
- Notion Integration: interact with databases, pages, and blocks
- Universal MCP Compatibility: supports Cursor, Claude Desktop, Cline, and Zed
- Data Retrieval: fetch data from pages, blocks, and databases
- Content Creation: create and update pages and blocks
- Block Management: append, update, delete blocks
- Database Operations: create, query, update databases
- Batch Operations: multiple operations in a single request
- Archive & Restore functionality for pages
- Search by title in pages and databases
- Comments Management: get, create, reply to comments
- User Management: retrieve workspace users and user details
π Documentation
Available Tools
notion_pages
Operations include creating pages, updating properties, archiving/restoring pages, searching by title.
Example:
{
"payload": {
"action": "create_page",
"params": {
// parameters for action
}
}
}
notion_blocks
Manage blocks: retrieve content and children, append, update, delete blocks, batch operations.
Example:
{
"payload": {
"action": "append_block_children",
"params": {
// parameters
}
}
}
notion_database
Create, query, and update databases.
Example:
{
"payload": {
"action": "create_database",
"params": {
// parameters
}
}
}
notion_comments
Manage comments: get comments, add page comments, reply to discussions.
Example:
{
"payload": {
"action": "get_comments",
"params": {
// parameters
}
}
}
notion_users
Access user information: list users, get user details, bot info.
Example:
{
"payload": {
"action": "list_users",
"params": {
// parameters
}
}
}
Available Resources
The server currently focuses on tool-based operations and does not expose additional resources.
π Development
- Clone the repository:
git clone https://github.com/awkoy/notion-mcp-server.git
cd notion-mcp-server
- Install dependencies:
npm install
- Set environment variables in
.env
:
NOTION_TOKEN=your_notion_api_key
NOTION_PAGE_ID=your_notion_page_id
- Build project:
npm run build
- Run inspector:
npm run inspector
π§ Technical Details
- Built with TypeScript and MCP SDK v1.7.0+
- Uses official Notion API client (@notionhq/client v2.3.0+)
- Implements Model Context Protocol specification
- Tools support CRUD operations on pages, blocks, databases
- Supports batch operations for efficiency
- Input/output validated using Zod schemas
β Troubleshooting
-
Authentication Errors: Verify Notion token permissions and integration enabled on pages/databases
-
Page Access Issues: Ensure integration is added to accessed pages
-
Rate Limiting: Use batch requests to optimize Notion API calls
-
For help:
- Create an issue on the GitHub repository
- Check Notion API documentation
- Visit MCP community channels
π€ Contributing
Contributions are welcome:
- Fork the repo
- Create a feature branch:
git checkout -b feature/amazing-feature
- Commit your changes:
git commit -m 'Add some amazing feature'
- Push branch:
git push origin feature/amazing-feature
- Open a Pull Request
π License
This project is licensed under the MIT License. See the LICENSE file for details.