Notion MCP Server Setup for Codex & Claude | Search, Create, Update Pages
Integrate Notion with OpenAI Codex & Claude. Query databases, create pages, update content via MCP. Includes Notion API token setup, config.toml example, and tool reference (search_pages, create_page, update_page).
claude_desktop_config.json{
"mcpServers": {
"notion": {
"command": "npx",
"args": [
"-y",
"mcp-server-notion"
],
"env": {
"NOTION_API_KEY": "ntn_xxxxxxxxxxxxxxxxxxxx"
}
}
}
}Generate & Test Notion MCP Server Config
One-click export with environment variables & path locators for Claude Desktop, Cursor, Windsurf, and OpenAI Codex CLI.
Notion MCP Server Setup and Configuration Guide
The Notion Model Context Protocol (MCP) server connects AI assistants—including Claude Desktop, Cursor, Windsurf, and OpenAI Codex CLI—directly to your Notion workspace. Once integrated, your AI agent can query tabular databases, search across documentation, create new pages, and append summaries without leaving your editor.
Integration requires minting an Internal Integration Token with fine-grained page capabilities, granting access to workspace parent pages, and registering the server binary in host configuration manifests.
Prerequisites
- ▸An active Notion account with workspace permission to create integrations.
- ▸A Notion Internal Integration Token (
secret_...orntn_...). - ▸Node.js 18+ installed locally.
Step 1: Create an Internal Integration in Notion
- ▸Navigate to the Notion Developers Portal (opens in a new tab).
- ▸Click + New integration.
- ▸Fill out the form:
- ▸Associated workspace: Select your target workspace.
- ▸Name:
MCP Workspace Agent - ▸Type:
Internal(do not select public unless building a multi-tenant OAuth app).
- ▸Under Capabilities, verify the following checkboxes are enabled:
- ▸
Read content - ▸
Update content - ▸
Insert content
- ▸
- ▸Click Save and copy your Internal Integration Secret (
secret_xxxxxxxxxxxxxxxxxxxxxxxx).
Step 2: Share Pages & Databases with Your Integration
Critical Rule: In Notion, integration tokens have zero access by default. An MCP server cannot see any page or database unless you explicitly share that page with your integration.
- ▸Open the root Notion page or workspace database you want your AI agent to access.
- ▸Click the ••• (Options) icon or Share button in the top right corner.
- ▸Under Connections, click Add connections.
- ▸Search for your integration name (
MCP Workspace Agent) and select Confirm. - ▸Pro Tip: Sharing a top-level parent page automatically inherits access for all child sub-pages.
Step 3: Configure Your AI Client
Select your host environment below to copy the exact configuration template:
Claude Desktop (claude_desktop_config.json)
File path:
- ▸macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - ▸Windows:
%APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"notion": {
"command": "npx",
"args": ["-y", "@suekou/mcp-notion-server"],
"env": {
"NOTION_API_TOKEN": "secret_your_notion_token_here"
}
}
}
}Cursor IDE (~/.cursor/mcp.json)
{
"mcpServers": {
"notion": {
"command": "npx",
"args": ["-y", "@suekou/mcp-notion-server"],
"env": {
"NOTION_API_TOKEN": "secret_your_notion_token_here"
}
}
}
}OpenAI Codex CLI (~/.codex/config.toml)
[mcp_servers.notion]
command = "npx"
args = ["-y", "@suekou/mcp-notion-server"]
[mcp_servers.notion.env]
NOTION_API_TOKEN = "secret_your_notion_token_here"Or register via terminal command:
codex mcp add --name notion --command "npx -y @suekou/mcp-notion-server" --env NOTION_API_TOKEN=secret_your_tokenWindsurf / Cascade (~/.codeium/windsurf/mcp_config.json)
{
"mcpServers": {
"notion": {
"command": "npx",
"args": ["-y", "@suekou/mcp-notion-server"],
"env": {
"NOTION_API_TOKEN": "secret_your_notion_token_here"
}
}
}
}Available Notion Tools
| Tool Name | Operation | Description |
|---|---|---|
search_pages | Read | Search all shared workspace pages using semantic keyword queries. |
get_page | Read | Fetch page blocks and content converted to clean Markdown. |
create_page | Write | Create brand new Notion pages under a designated parent page. |
update_page | Write | Append content blocks or modify page properties. |
query_database | Read | Filter and query tabular databases by column attributes. |
create_database_item | Write | Add structured rows to project trackers and CRM databases. |
Troubleshooting Common Errors
1. "Object Not Found" or Empty Search Results
- ▸Symptom:
search_pagesreturns an empty array, orget_pageerrors withCould not find page with ID. - ▸Fix: Verify you shared the page with your connection in the Notion UI. The token cannot search unshared pages.
2. HTTP 401 Unauthorized
- ▸Symptom: Server crashes during handshake with
401 Unauthorized. - ▸Fix: Double check that
NOTION_API_TOKENstarts withsecret_orntn_and contains no accidental whitespace or quotation marks.
3. Rate Limiting (HTTP 429)
- ▸Symptom: Agent tool call pauses with rate limit headers.
- ▸Fix: The Notion API enforces an average limit of 3 requests per second per integration. Avoid asking your agent to recursively fetch hundreds of pages in a single loop.
Interactive Links & Tools
Weekly Protocol Diffs & Verified Drops
New server guides, benchmarks, and security audits. No spam. Unsubscribe anytime.
Zero marketing spam. 1-click unsubscribe anytime.
Build your full agent toolstack in the Visual Generator
Combine Notion with databases, search APIs, and memory graphs in a single configuration file.
Did this setup guide work with your AI host?
Help test this configuration across Claude, Cursor, and Codex CLI. Be the first to report:
Notion MCP Server Setup for Codex & Claude | Search, Create, Update Pages FAQ
What is the Notion MCP Server Setup for Codex & Claude | Search, Create, Update Pages?
Integrate Notion with OpenAI Codex & Claude. Query databases, create pages, update content via MCP. Includes Notion API token setup, config.toml example, and tool reference (search_pages, create_page, update_page).
How do I configure Notion MCP Server Setup for Codex & Claude | Search, Create, Update Pages in Claude Desktop or Cursor?
You can copy the configuration JSON from our guide or launch the interactive MCP Codex Config Generator at https://mcp-codex.com/generator to export valid configs in 1 click.
Can I use Notion MCP Server Setup for Codex & Claude | Search, Create, Update Pages with the OpenAI Codex CLI?
Yes, OpenAI Codex CLI supports Model Context Protocol. You can add it directly to ~/.codex/config.toml or pass arguments to codex mcp add.
Specializing in Model Context Protocol (MCP) integrations, autonomous AI agent orchestration, and distributed developer toolchains. Researches and benchmarks production MCP client-server architectures across OpenAI Codex, Claude, and Cursor.
Related Guides
Cloud Infrastructure Auditor MCP Guide
Run automated cloud configuration security audits. Identify leaky S3 buckets, open security group ports, and loose IAM profiles directly from your IDE.
Cloud ServicesKubernetes and Helm MCP Server Guide
Connect your Kubernetes clusters and Helm releases to AI agents via MCP. Run safe container diagnostics, view cluster logs, and perform rollbacks.
Cloud ServicesHow to Use the Google Drive MCP Server for Document Access
Connect Google Drive to your AI agent for searching, reading, and managing documents, spreadsheets, and files stored in your Drive.