Notion MCP Server
N

Notion MCP Server

Set up the Notion API key and permissions, and interact with Notion through a Python script.
2 points
8.6K

Installation

Copy the following command to your Client for configuration
Note: Your key is sensitive information, do not share it with anyone.

🚀 Configuring Notion API Keys and Permissions

This guide offers a detailed walk - through on configuring Notion API keys and permissions, along with code examples and setup instructions in Claude.

✨ Features

  • Step - by - step guide to create a Notion API key.
  • Instructions for configuring page permissions to use the integration.
  • Code updates and examples for using the Notion API.
  • Setup guidance in Claude, including installing tools and setting environment variables.
  • Installation instructions for the Notion library.
  • Examples of generating docstrings for functions.

📦 Installation

Install the Notion Library

Use pip to install the notion - client:

pip install notion - client

💻 Usage Examples

Create a Notion API Key

  1. Access Notion Integrations:
    • Visit [Notion Integrations](https://www.notion.so/my - integrations) and log in with your Notion account.
  2. Create a New Integration:
    • Click "New Integration", fill in the required fields (e.g., integration name), and select the workspace you want to connect.
  3. Save the Integration:
    • After submission, an API key will be generated. Copy and securely save this key for subsequent API request authentication.
  4. Retrieve the API Key:
    • Copy the generated API key and ensure its security.

Configure Page Permissions to Use the Integration

  1. Open a Notion Page:
    • Open the Notion page to which you want to grant permissions.
  2. Share the Page:
    • Click the "Share" button at the top - right of the page.
  3. Invite the Integration:
    • Enter your integration name in the "Invite" text box and select it from the dropdown list. This will grant the integration access to the page.
  4. Set Permissions:
    • Ensure that the integration has the necessary permissions to perform the required operations (e.g., read, write).

Code Updates

In the notion_sdk.py file, update PAGE_ID to the ID of the page you created earlier. You can obtain this ID by copying the page link.

Example Notion Page ID

https://www.notion.so/MCP - Parent - Page - 1d21f7216bdb80789f88fccd964b5031

Curl Example

The following is an example of using the Notion API to create a new page:

curl --location --request POST 'https://api.notion.com/v1/pages' \
--header 'Authorization: Bearer $NOTION_API_KEY' \
--header 'Content - Type: application/json' \
--header 'Notion - Version: 2021 - 05 - 13' \
--data '{
"parent": { "page_id": "1d21f7216bdb80789f88fccd964b5031" },
"properties": {
    "title": [
        {
            "text": {
                "content": "New Page Title"
            }
        }
    ]
}
'

Setup in Claude

Install the uv Tool

If you are using a Mac, install it via the following command:

brew install uv

Verify the installation:

uv --version

Run a Python script:

uv run <script>.py

Set Environment Variables

In Claude, you need to add NOTION_API_KEY to the environment variables. For example:

export NOTION_API_KEY=your_api_key_here

Alternatively, specify the executable file path in the configuration file:

{
  "executors": {
    "default_python": {
      "command": "/usr/bin/python3",
      "env": {
        "NOTION_API_KEY": "your_api_key"
      }
    }
  }
}

Generate Docstring Examples

The following are examples of docstrings for functions to help LLMs and humans understand the usage and parameters of the tools:

Example Function and Its Docstring

def get_page_content(page_id: str) -> dict:
    """
    Get the content of a specified page.
    
    Args:
        page_id (str): The ID of the page whose content needs to be retrieved.
        
    Returns:
        dict: The page content, including the title and other attributes.
    """
    # Specific implementation code

Another Example

def create_new_page(parent_id: str, title: str) -> str:
    """
    Create a new page under a specified parent page.
    
    Args:
        parent_id (str): The ID of the parent page.
        title (str): The title of the new page.
        
    Returns:
        str: The ID of the newly created page.
    """
    # Specific implementation code

Usage Notes

  • Summary: Briefly describe the purpose of the function.
  • Parameters: Explain each input parameter, its type, and its purpose in detail.
  • Return Value: Clearly define the type and meaning of the return value.

By following these specifications, you can ensure that docstrings are both human - friendly and model - friendly.

Alternatives

A
Acemcp
Acemcp is an MCP server for codebase indexing and semantic search, supporting automatic incremental indexing, multi-encoding file processing, .gitignore integration, and a Web management interface, helping developers quickly search for and understand code context.
Python
9.1K
5 points
B
Blueprint MCP
Blueprint MCP is a chart generation tool based on the Arcade ecosystem. It uses technologies such as Nano Banana Pro to automatically generate visual charts such as architecture diagrams and flowcharts by analyzing codebases and system architectures, helping developers understand complex systems.
Python
7.0K
4 points
M
MCP Agent Mail
MCP Agent Mail is a mail - based coordination layer designed for AI programming agents, providing identity management, message sending and receiving, file reservation, and search functions, supporting asynchronous collaboration and conflict avoidance among multiple agents.
Python
8.4K
5 points
M
MCP
The Microsoft official MCP server provides search and access functions for the latest Microsoft technical documentation for AI assistants
11.9K
5 points
A
Aderyn
Aderyn is an open - source Solidity smart contract static analysis tool written in Rust, which helps developers and security researchers discover vulnerabilities in Solidity code. It supports Foundry and Hardhat projects, can generate reports in multiple formats, and provides a VSCode extension.
Rust
10.6K
5 points
D
Devtools Debugger MCP
The Node.js Debugger MCP server provides complete debugging capabilities based on the Chrome DevTools protocol, including breakpoint setting, stepping execution, variable inspection, and expression evaluation.
TypeScript
8.9K
4 points
S
Scrapling
Scrapling is an adaptive web scraping library that can automatically learn website changes and re - locate elements. It supports multiple scraping methods and AI integration, providing high - performance parsing and a developer - friendly experience.
Python
10.6K
5 points
M
Mcpjungle
MCPJungle is a self-hosted MCP gateway used to centrally manage and proxy multiple MCP servers, providing a unified tool access interface for AI agents.
Go
0
4.5 points
N
Notion Api MCP
Certified
A Python-based MCP Server that provides advanced to-do list management and content organization functions through the Notion API, enabling seamless integration between AI models and Notion.
Python
17.5K
4.5 points
M
Markdownify MCP
Markdownify is a multi-functional file conversion service that supports converting multiple formats such as PDFs, images, audio, and web page content into Markdown format.
TypeScript
28.3K
5 points
G
Gitlab MCP Server
Certified
The GitLab MCP server is a project based on the Model Context Protocol that provides a comprehensive toolset for interacting with GitLab accounts, including code review, merge request management, CI/CD configuration, and other functions.
TypeScript
17.3K
4.3 points
D
Duckduckgo MCP Server
Certified
The DuckDuckGo Search MCP Server provides web search and content scraping services for LLMs such as Claude.
Python
54.3K
4.3 points
U
Unity
Certified
UnityMCP is a Unity editor plugin that implements the Model Context Protocol (MCP), providing seamless integration between Unity and AI assistants, including real - time state monitoring, remote command execution, and log functions.
C#
24.0K
5 points
F
Figma Context MCP
Framelink Figma MCP Server is a server that provides access to Figma design data for AI programming tools (such as Cursor). By simplifying the Figma API response, it helps AI more accurately achieve one - click conversion from design to code.
TypeScript
50.9K
4.5 points
G
Gmail MCP Server
A Gmail automatic authentication MCP server designed for Claude Desktop, supporting Gmail management through natural language interaction, including complete functions such as sending emails, label management, and batch operations.
TypeScript
18.1K
4.5 points
C
Context7
Context7 MCP is a service that provides real-time, version-specific documentation and code examples for AI programming assistants. It is directly integrated into prompts through the Model Context Protocol to solve the problem of LLMs using outdated information.
TypeScript
75.2K
4.7 points
AIBase
Zhiqi Future, Your AI Solution Think Tank
© 2025AIBase