Notion MCP server

Integrates with Notion to enable searching, retrieving, creating, and updating pages and databases for natural language-driven knowledge management and collaborative document creation.
Back to servers
Provider
Shaheer Ahmad
Release date
Mar 04, 2025
Language
TypeScript
Stats
3 stars

The Notion MCP Server enables Claude and other LLMs to interact with your Notion workspace through the Model Context Protocol, providing capabilities like searching, creating, and updating pages and databases.

Installation

Prerequisites

  • Node.js installed on your system
  • A Notion integration with API key

Installation Steps

  1. Clone the repository

  2. Install dependencies

    npm install
    
  3. Configure your Notion API key

    • Create an integration in the Notion Developers portal
    • Copy your API key
    • Either edit the .env file or pass it directly in the Claude Desktop configuration (recommended)
  4. Build the server

    npm run build
    
  5. Start the server

    npm start
    

Setting Up with Claude for Desktop

  1. Install Claude for Desktop if you haven't already

  2. Locate or create your Claude for Desktop App configuration file:

    • On macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  3. Add the Notion server to your configuration:

    {
      "mcpServers": {
        "notion": {
          "command": "node",
          "args": [
            "/path/to/your/notion-mcp-server/dist/index.js",
            "--notion-api-key=YOUR_ACTUAL_API_KEY_HERE"
          ]
        }
      }
    }
    

    Make sure to replace:

    • /path/to/your/notion-mcp-server with the full path to your project directory
    • YOUR_ACTUAL_API_KEY_HERE with your actual Notion API key
  4. Restart Claude for Desktop

Usage

Once configured, you can interact with your Notion workspace by asking Claude questions. The server automatically selects the appropriate tool based on your request.

Search Notion

Search across your entire Notion workspace:

Search for "meeting notes" in my Notion workspace

Page Operations

Get Page Content

Get the content of my Notion page with ID 1aaada269d1b8003adceda69cf7bcd97

Create a New Page

Create a new page in Notion with title "Weekly Report" and content "This week we accomplished the following tasks..."

Update an Existing Page

Update my Notion page with ID 1aaada269d1b8003adceda69cf7bcd97 with content "Adding this new information to the page."

You can also update the title:

Update my Notion page with ID 1aaada269d1b8003adceda69cf7bcd97 with title "New Title" and content "New content to add."

Database Operations

Create a New Database

Create a new database in my Notion page with ID 1aaada269d1b8003adceda69cf7bcd97 with title "Task Tracker" and properties {
  "Task Name": { "title": {} },
  "Status": {
    "select": {
      "options": [
        { "name": "Not Started", "color": "red" },
        { "name": "In Progress", "color": "yellow" },
        { "name": "Completed", "color": "green" }
      ]
    }
  },
  "Priority": {
    "select": {
      "options": [
        { "name": "Low", "color": "blue" },
        { "name": "Medium", "color": "yellow" },
        { "name": "High", "color": "red" }
      ]
    }
  },
  "Due Date": { "date": {} }
}

Query a Database

Query my Notion database with ID 1aaada269d1b8003adceda69cf7bcd97 with filter {
  "property": "Status",
  "select": {
    "equals": "Completed"
  }
}

You can also add sorting:

Query my Notion database with ID 1aaada269d1b8003adceda69cf7bcd97 with sort {
  "property": "Due Date",
  "direction": "ascending"
}

Update Database Entry

Update properties of an existing database entry:

{
  "tool_name": "update-database-entry",
  "tool_params": {
    "pageId": "page_id_of_database_entry",
    "properties": {
      "Status": {
        "select": {
          "name": "Completed"
        }
      },
      "Priority": {
        "select": {
          "name": "High"
        }
      },
      "Due Date": {
        "date": {
          "start": "2023-12-31"
        }
      }
    }
  }
}

Create Database Row

Add a new row to an existing database:

{
  "tool_name": "create-database-row",
  "tool_params": {
    "databaseId": "your_database_id_here",
    "properties": {
      "Name": {
        "title": [
          {
            "text": {
              "content": "New Task"
            }
          }
        ]
      },
      "Status": {
        "select": {
          "name": "Not Started"
        }
      },
      "Priority": {
        "select": {
          "name": "Medium"
        }
      },
      "Due Date": {
        "date": {
          "start": "2023-12-15"
        }
      },
      "Notes": {
        "rich_text": [
          {
            "text": {
              "content": "This is a new task created via the API"
            }
          }
        ]
      }
    }
  }
}

Troubleshooting

  • If tools aren't showing up, check the Claude for Desktop logs:

    tail -n 20 -f ~/Library/Logs/Claude/mcp*.log
    
  • Ensure your Notion API key is correctly set and that your integration has been granted access to the pages you want to interact with.

  • If you see "Unexpected token" errors in the logs, console.log statements might be interfering with the MCP protocol.

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