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
9.2K

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
Airweave
Airweave is an open - source context retrieval layer for AI agents and RAG systems. It connects and synchronizes data from various applications, tools, and databases, and provides relevant, real - time, multi - source contextual information to AI agents through a unified search interface.
Python
16.2K
5 points
V
Vestige
Vestige is an AI memory engine based on cognitive science. By implementing 29 neuroscience modules such as prediction error gating, FSRS - 6 spaced repetition, and memory dreaming, it provides long - term memory capabilities for AI. It includes a 3D visualization dashboard and 21 MCP tools, runs completely locally, and does not require the cloud.
Rust
10.5K
4.5 points
M
Moltbrain
MoltBrain is a long-term memory layer plugin designed for OpenClaw, MoltBook, and Claude Code, capable of automatically learning and recalling project context, providing intelligent search, observation recording, analysis statistics, and persistent storage functions.
TypeScript
10.1K
4.5 points
B
Bm.md
A feature-rich Markdown typesetting tool that supports multiple style themes and platform adaptation, providing real-time editing preview, image export, and API integration capabilities
TypeScript
14.8K
5 points
S
Security Detections MCP
Security Detections MCP is a server based on the Model Context Protocol that allows LLMs to query a unified security detection rule database covering Sigma, Splunk ESCU, Elastic, and KQL formats. The latest version 3.0 is upgraded to an autonomous detection engineering platform that can automatically extract TTPs from threat intelligence, analyze coverage gaps, generate SIEM-native format detection rules, run tests, and verify. The project includes over 71 tools, 11 pre-built workflow prompts, and a knowledge graph system, supporting multiple SIEM platforms.
TypeScript
6.7K
4 points
P
Paperbanana
Python
8.9K
5 points
B
Better Icons
An MCP server and CLI tool that provides search and retrieval of over 200,000 icons, supports more than 150 icon libraries, and helps AI assistants and developers quickly obtain and use icons.
TypeScript
8.7K
4.5 points
A
Assistant Ui
assistant - ui is an open - source TypeScript/React library for quickly building production - grade AI chat interfaces, providing composable UI components, streaming responses, accessibility, etc., and supporting multiple AI backends and models.
TypeScript
9.0K
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
39.1K
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
24.8K
4.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
28.4K
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
80.2K
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#
38.4K
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
70.6K
4.5 points
M
Minimax MCP Server
The MiniMax Model Context Protocol (MCP) is an official server that supports interaction with powerful text-to-speech, video/image generation APIs, and is suitable for various client tools such as Claude Desktop and Cursor.
Python
55.3K
4.8 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
24.0K
4.5 points
AIBase
Zhiqi Future, Your AI Solution Think Tank
© 2026AIBase