Notion MCP server

Provides a flexible API for querying, searching, creating, updating, and deleting Notion workspaces, enabling developers and knowledge workers to interact with their data through natural language or automated workflows.
Back to servers
Provider
Gabriel Hubner
Release date
Mar 17, 2025
Language
TypeScript
Stats
4 stars

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.

Installation

Prerequisites

  • Node.js (v16 or higher)
  • Notion API Key from your Notion integrations
  • Connected Notion workspace with appropriate permissions

Setup Steps

  1. Clone the repository:

    git clone https://github.com/yourusername/notion-mcp-server.git
    cd notion-mcp-server
    
  2. Install dependencies:

    npm install
    
  3. 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
    
  4. Build the project:

    npm run build
    
  5. Start the server:

    npm start
    

Integration with Claude for Desktop

Configuration

  1. Ensure Claude for Desktop is installed and updated to the latest version

  2. Open Claude for Desktop's configuration file:

    • On macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • On Windows: %APPDATA%\Claude\claude_desktop_config.json
  3. 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"
          }
        }
      }
    }
    
  4. Save the file and restart Claude for Desktop

Available Resources

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

Pre-configured Prompts

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

Using with Claude

After connecting Claude to the MCP server, you can ask natural language questions about your Notion workspace:

  • "What tasks are due today in my workspace?"
  • "Show me the status of Project X"
  • "Create a new page in my 'Ideas' database with title 'New Feature Concept'"
  • "Update the status of task Y to 'Completed'"
  • "What changes were made to my workspace in the last 24 hours?"
  • "Summarize the upcoming deadlines for the next week"
  • "Show me all backups for page abc123"
  • "Restore page abc123 from the backup file page_abc123_2023-01-01.json"

Troubleshooting

Checking Logs

If you encounter issues, check the server logs:

  • Claude for Desktop Logs: Look in the Claude logs directory for MCP-related logs
  • Server Output: Check standard output and error streams for server logs

How to add this MCP server to Cursor

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.

Adding an MCP server to Cursor globally

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"
            ]
        }
    }
}

Adding an MCP server to a project

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.

How to use the MCP server

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.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later