Notion API MCP server

Bridges to the Notion API for searching content, querying databases, and managing pages and comments without requiring complex API interaction code
Back to servers
Setup instructions
Provider
Notion
Release date
Apr 11, 2025
Language
TypeScript
Package
Stats
330.3K downloads
3.2K stars

The Notion MCP Server provides a way to connect AI assistants to your Notion workspace through the Model Context Protocol (MCP). It enables AI agents to interact with your Notion content through a standardized interface.

Installation

Setting up a Notion Integration

  1. Go to Notion's integrations page and create a new internal integration or select an existing one.

  2. For security, consider limiting the integration's capabilities. You can create a read-only integration by selecting only "Read content" access in the "Configuration" tab.

Connecting Content to Your Integration

Ensure relevant pages and databases are connected to your integration by:

  1. Visiting the Access tab in your internal integration settings
  2. Editing access and selecting the pages you want to use

Alternatively, grant access to individual pages by:

  1. Visiting the target page
  2. Clicking the 3 dots menu
  3. Selecting "Connect to integration"

Adding MCP Configuration to Your Client

Using npm

For Cursor & Claude:

Add the following to your .cursor/mcp.json or claude_desktop_config.json (MacOS: ~/Library/Application\ Support/Claude/claude_desktop_config.json)

Option 1: Using NOTION_TOKEN (recommended)

{
  "mcpServers": {
    "notionApi": {
      "command": "npx",
      "args": ["-y", "@notionhq/notion-mcp-server"],
      "env": {
        "NOTION_TOKEN": "ntn_****"
      }
    }
  }
}

Option 2: Using OPENAPI_MCP_HEADERS (for advanced use cases)

{
  "mcpServers": {
    "notionApi": {
      "command": "npx",
      "args": ["-y", "@notionhq/notion-mcp-server"],
      "env": {
        "OPENAPI_MCP_HEADERS": "{\"Authorization\": \"Bearer ntn_****\", \"Notion-Version\": \"2022-06-28\" }"
      }
    }
  }
}

For Zed:

Add the following to your settings.json

{
  "context_servers": {
    "some-context-server": {
      "command": {
        "path": "npx",
        "args": ["-y", "@notionhq/notion-mcp-server"],
        "env": {
          "OPENAPI_MCP_HEADERS": "{\"Authorization\": \"Bearer ntn_****\", \"Notion-Version\": \"2022-06-28\" }"
        }
      },
      "settings": {}
    }
  }
}

Using Docker

Option 1: Using the official Docker Hub image:

Add to your .cursor/mcp.json or claude_desktop_config.json:

{
  "mcpServers": {
    "notionApi": {
      "command": "docker",
      "args": [
        "run",
        "--rm",
        "-i",
        "-e", "NOTION_TOKEN",
        "mcp/notion"
      ],
      "env": {
        "NOTION_TOKEN": "ntn_****"
      }
    }
  }
}

Option 2: Building the Docker image locally:

First, build the Docker image:

docker compose build

Then add to your .cursor/mcp.json or claude_desktop_config.json:

{
  "mcpServers": {
    "notionApi": {
      "command": "docker",
      "args": [
        "run",
        "--rm",
        "-i",
        "-e",
        "NOTION_TOKEN=ntn_****",
        "notion-mcp-server"
      ]
    }
  }
}

Remember to replace ntn_**** with your actual integration secret from the integration configuration tab.

Installing via Smithery

To install Notion API Server for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install @makenotion/notion-mcp-server --client claude

Transport Options

STDIO Transport (Default)

The default transport mode uses standard input/output:

# Run with default stdio transport
npx @notionhq/notion-mcp-server

# Or explicitly specify stdio
npx @notionhq/notion-mcp-server --transport stdio

Streamable HTTP Transport

For web-based applications or clients that prefer HTTP:

# Run with HTTP transport on default port 3000
npx @notionhq/notion-mcp-server --transport http

# Run on a custom port
npx @notionhq/notion-mcp-server --transport http --port 8080

# Run with a custom authentication token
npx @notionhq/notion-mcp-server --transport http --auth-token "your-secret-token"

Authentication for HTTP Transport

Three options for authentication:

Option 1: Auto-generated token (for development)

npx @notionhq/notion-mcp-server --transport http

Option 2: Custom token via command line (for production)

npx @notionhq/notion-mcp-server --transport http --auth-token "your-secret-token"

Option 3: Custom token via environment variable (for production)

AUTH_TOKEN="your-secret-token" npx @notionhq/notion-mcp-server --transport http

Making HTTP Requests

Include the bearer token in the Authorization header:

curl -H "Authorization: Bearer your-token-here" \
     -H "Content-Type: application/json" \
     -H "mcp-session-id: your-session-id" \
     -d '{"jsonrpc": "2.0", "method": "initialize", "params": {}, "id": 1}' \
     http://localhost:3000/mcp

Usage Examples

Example 1: Comment on a Page

Using the instruction:

Comment "Hello MCP" on page "Getting started"

The AI will execute API calls to v1/search and v1/comments to complete this task.

Example 2: Create a New Page

Using the instruction:

Add a page titled "Notion MCP" to page "Development"

The AI will create a new page named "Notion MCP" under the "Development" page.

Example 3: Reference Content by ID

Using the instruction:

Get the content of page 1a6b35e6e67f802fa7e1d27686f017f2

The AI will retrieve the content of the specified page using its ID.

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 "notionApi" '{"command":"npx","args":["-y","@notionhq/notion-mcp-server"],"env":{"OPENAPI_MCP_HEADERS":"{\"Authorization\": \"Bearer ntn_****\", \"Notion-Version\": \"2022-06-28\" }"}}'

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": {
        "notionApi": {
            "command": "npx",
            "args": [
                "-y",
                "@notionhq/notion-mcp-server"
            ],
            "env": {
                "OPENAPI_MCP_HEADERS": "{\"Authorization\": \"Bearer ntn_****\", \"Notion-Version\": \"2022-06-28\" }"
            }
        }
    }
}

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": {
        "notionApi": {
            "command": "npx",
            "args": [
                "-y",
                "@notionhq/notion-mcp-server"
            ],
            "env": {
                "OPENAPI_MCP_HEADERS": "{\"Authorization\": \"Bearer ntn_****\", \"Notion-Version\": \"2022-06-28\" }"
            }
        }
    }
}

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