Notion MCP server

Integrates with Notion workspaces to enable database operations, page management, block manipulation, and search functionality for seamless document creation and knowledge management workflows.
Back to servers
Setup instructions
Provider
Emmanuel Systems
Release date
Mar 17, 2025
Language
TypeScript
Stats
1 star

This Model Context Protocol (MCP) server creates a bridge between Claude and other AI assistants and your Notion workspace, allowing them to interact with databases, pages, and blocks in real-time. The integration enables AI assistants to search, create, and update content in your Notion environment.

Installation Requirements

Prerequisites

  • Node.js (version 14 or higher)
  • A Notion account
  • Claude Desktop app (if using with Claude)

Getting Your Notion API Key

  1. Go to https://www.notion.so/my-integrations
  2. Click the blue "+ New integration" button
  3. Fill in the details:
    • Name: Choose a name like "Claude Assistant" or "AI Helper"
    • Logo: Optional
    • Associated workspace: Select your Notion workspace
  4. Click "Submit"
  5. On the next page, find the "Internal Integration Token" section
  6. Click "Show" and copy the token (it starts with secret_)

Setting Up the Server

  1. Download the repository to your computer:

    git clone [repository-url]
    

    Or download and extract the ZIP file

  2. Open a command prompt or terminal:

    • Windows: Press Win+R, type cmd, and press Enter
    • Mac: Open Terminal from Applications > Utilities
  3. Navigate to the downloaded folder:

    cd path/to/notion-mcp-server
    
  4. Install the required dependencies:

    npm install
    
  5. Create a configuration file:

    • Make a copy of .env.example and name it .env
    • Open the .env file in a text editor
    • Replace your_notion_api_key_here with the token you copied earlier
    • Save the file

Connecting to Notion Pages

For security, Notion requires explicitly granting access to each page or database:

  1. Open Notion and navigate to a page or database you want the AI to access
  2. Click the "•••" (three dots) in the top-right corner
  3. Select "Add connections"
  4. Find and select the integration you created earlier
  5. Repeat for any other pages or databases you want to make accessible

Connecting to Claude Desktop

  1. Locate your Claude Desktop configuration file:

    • Windows: %APPDATA%\Claude\claude_desktop_config.json
    • Mac: ~/Library/Application Support/Claude/claude_desktop_config.json
  2. Open the file in a text editor. If it doesn't exist, create it with the following content:

    {
      "mcpServers": {
        "notion": {
          "command": "node",
          "args": [
            "C:\\path\\to\\notion-mcp-server\\server.js"
          ],
          "env": {
            "NOTION_API_KEY": "your_notion_api_key_here"
          }
        }
      }
    }
    
  3. Replace:

    • C:\\path\\to\\notion-mcp-server\\server.js with the actual path to the server.js file
      • Windows: Use double backslashes (\) in the path
      • Mac: Use forward slashes (/)
    • your_notion_api_key_here with your Notion API key
  4. Save the file and restart Claude Desktop

Usage

Testing the Connection

  1. Start a new conversation in Claude
  2. Ask Claude to interact with your Notion workspace, for example:
    • "Show me a list of my Notion databases"
    • "Create a new page in my Tasks database with title 'Test Task'"

Available Tools

The server provides these tools to AI assistants:

  • list-databases: View all accessible databases
  • query-database: Get entries from a database
  • create-page: Add a new page to a database
  • update-page: Modify an existing page
  • create-database: Create a new database
  • update-database: Modify a database structure
  • get-page: View a specific page
  • get-block-children: View content blocks
  • append-block-children: Add content to a page
  • update-block: Edit content blocks
  • get-block: View a specific block
  • search: Find content across your workspace

Troubleshooting

Common Issues

  • "Connection failed" in Claude

    • Make sure the server path in claude_desktop_config.json is correct
    • Check that your Notion API key is valid
    • Ensure Node.js is installed correctly
  • "Access denied" when accessing Notion content

    • Make sure you've shared the page/database with your integration
    • Check that your API key has the necessary permissions
  • Server won't start

    • Ensure all dependencies are installed (npm install)
    • Check that the .env file exists with your API key

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "notion" '{"command":"node","args":["path/to/notion-mcp-server/server.js"],"env":{"NOTION_API_KEY":"your_notion_api_key_here"}}'

See the official Claude Code MCP documentation for more details.

For 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 > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "notion": {
            "command": "node",
            "args": [
                "path/to/notion-mcp-server/server.js"
            ],
            "env": {
                "NOTION_API_KEY": "your_notion_api_key_here"
            }
        }
    }
}

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 explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "notion": {
            "command": "node",
            "args": [
                "path/to/notion-mcp-server/server.js"
            ],
            "env": {
                "NOTION_API_KEY": "your_notion_api_key_here"
            }
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

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