This server implements the Model Context Protocol (MCP) for Notion workspaces, allowing AI models to seamlessly interact with your Notion content. By providing a standardized interface, it enables querying, retrieving, and modifying Notion pages and databases through natural language requests.
Clone the repository:
git clone https://github.com/yourusername/notion-mcp-server.git
cd notion-mcp-server
Install dependencies:
npm install
Create a .env
file in the root directory:
# Required
NOTION_API_KEY=your_notion_api_key_here
# Optional settings
DEBUG=false
REQUIRE_CONFIRMATION_FOR_CREATE=true
REQUIRE_CONFIRMATION_FOR_UPDATE=true
REQUIRE_CONFIRMATION_FOR_DELETE=true
UPDATE_POLLING_INTERVAL=60000
MAX_BLOCK_DEPTH=3
BACKUP_DIR=./backups
BACKUP_RETENTION_DAYS=30
MAX_BACKUPS_PER_PAGE=5
Build the project:
npm run build
Start the server:
npm start
Ensure Claude for Desktop is installed and updated to the latest version
Open Claude for Desktop's configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
Add the server configuration:
{
"mcpServers": {
"notion": {
"command": "node",
"args": ["/path/to/notion-mcp-server/build/index.js"],
"env": {
"NOTION_API_KEY": "your_notion_api_key_here"
}
}
}
}
Save the file and restart Claude for Desktop
The server exposes these resources for interaction:
Resource URI | Description |
---|---|
notion://databases |
Lists all databases in the workspace |
notion://databases/{databaseId}/schema |
Retrieves the schema of a specific database |
notion://databases/{databaseId}/content |
Retrieves all pages/items from a specific database |
notion://pages/{pageId} |
Retrieves the content of a specific page |
notion://updates |
Retrieves recent updates and changes in the workspace |
The server includes these ready-to-use prompts:
Prompt Name | Description |
---|---|
upcoming-deadlines |
Get a list of upcoming deadlines |
project-status |
Summarize the status of a project |
daily-tasks |
Get a list of tasks for today |
After connecting Claude to the MCP server, you can ask natural language questions about your Notion workspace:
If you encounter issues, check the server logs:
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.