Notion MCP server

Integrates with Notion to enable database and page operations, content management, and AI-powered analysis for enhanced productivity workflows.
Back to servers
Setup instructions
Provider
Gabor Nyerges
Release date
Dec 11, 2024
Language
TypeScript
Package
Stats
399 downloads

This MCP server creates a bridge between Claude and Notion, allowing you to interact with Notion databases and pages directly through Claude. It provides tools for creating, reading, updating, and deleting Notion content as well as AI-powered analysis of your Notion content.

Installation

Prerequisites

  • Node.js 18 or higher
  • Notion API Key and Integration setup
  • Claude Desktop application

Setting Up Notion Integration

  1. Visit the Notion Your Integrations page
  2. Click "New Integration"
  3. Name your integration and select appropriate permissions (e.g., "Read content", "Update content")
  4. Copy the "Internal Integration Token" from your integration
  5. Add the integration to your workspace:
    • Open the page or database you want the integration to access in Notion
    • Click the navigation button in the top right corner
    • Click "Connect to" button and select your integration

Configuring Claude Desktop

Add the server configuration to Claude Desktop by editing the configuration file:

For MacOS:

~/Library/Application Support/Claude/claude_desktop_config.json

For Windows:

%APPDATA%/Claude/claude_desktop_config.json

Add the following configuration to the file:

{
  "mcpServers": {
   "mcp-notion-server": {
      "command": "npx",
      "args": [
        "-y",
        "@gabornyerges/mcp-notion-server"
      ],
      "env": {
        "NOTION_API_KEY": "your-notion-api-key"
      }
    }
  }
}

Make sure to replace "your-notion-api-key" with your actual Notion API key.

Usage

Database Operations

The MCP server provides several tools for working with Notion databases:

Listing Databases

Use the list_databases tool to see all accessible Notion databases.

Creating Databases

Create new databases with custom properties using the create_database tool.

Querying Databases

Search and filter database entries with the query_database tool.

Updating Databases

Modify database properties and schema with the update_database tool.

Page Operations

Several tools are available for working with Notion pages:

Creating Pages

Use create_page to create new pages in databases or as subpages, with support for:

  • Title
  • Properties
  • Markdown content

Updating Pages

Modify existing page properties with the update_page tool.

Retrieving Pages

Get page content and metadata using the get_page tool.

Deleting Pages

Remove pages from databases or parent pages with the delete_page tool.

Block Operations

Manage content blocks within pages:

Adding Blocks

Add new blocks to a page with the append_blocks tool.

Removing Blocks

Delete blocks from a page using the delete_blocks tool.

Retrieving Block Content

Get block content with the get_blocks tool.

Modifying Blocks

Update existing block content using the update_blocks tool.

AI-Powered Prompts

The server includes special prompts for content analysis:

  • summarize_notes - Generate concise summaries of your notes
  • analyze_content - Get insights and analysis of page content
  • suggest_tags - Receive recommendations for relevant tags based on content

Troubleshooting

Since MCP servers communicate over stdio, debugging can be challenging. You can use the MCP Inspector to help with debugging:

npm run inspector

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 "mcp-notion-server" '{"command":"npx","args":["-y","@gabornyerges/mcp-notion-server"],"env":{"NOTION_API_KEY":"your-notion-api-key"}}'

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": {
        "mcp-notion-server": {
            "command": "npx",
            "args": [
                "-y",
                "@gabornyerges/mcp-notion-server"
            ],
            "env": {
                "NOTION_API_KEY": "your-notion-api-key"
            }
        }
    }
}

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": {
        "mcp-notion-server": {
            "command": "npx",
            "args": [
                "-y",
                "@gabornyerges/mcp-notion-server"
            ],
            "env": {
                "NOTION_API_KEY": "your-notion-api-key"
            }
        }
    }
}

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