Notion MCP Server

Notion MCP Server

Enables AI assistants to search, create, and manage Notion workspace content including pages and databases. It supports advanced database querying, page updates, and content organization through natural language conversations.

Category
Visit Server

README

šŸš€ Notion MCP Server

A powerful Model Context Protocol (MCP) server that connects AI assistants like Claude to your Notion workspace. Seamlessly search, create, and manage your Notion content through natural language conversations!

✨ What This Does

Transform your AI assistant into a Notion powerhouse! With this MCP server, you can:

  • šŸ” Search through all your Notion pages and databases
  • šŸ“ Create new pages, databases, and content
  • āœļø Update existing pages and properties
  • šŸ“Š Query databases with complex filters
  • šŸ”— Manage your entire Notion workspace through conversation

šŸŽÆ Quick Start

1. Prerequisites

  • Python 3.8 or higher
  • A Notion workspace
  • Nango account (for OAuth authentication)
  • Claude Desktop app (for AI integration)

2. Installation

# Clone or download the files
git clone <your-repo-url>
cd notion-mcp-server

# Install dependencies
uv sync

3. Notion Setup

  1. Create a Notion Integration:

    • Go to https://www.notion.so/my-integrations
    • Click "New integration"
    • Name it (e.g., "Claude MCP Integration")
    • Select your workspace
    • Set capabilities:
      • āœ… Read content
      • āœ… Insert content
      • āœ… Update content
    • Save and copy your integration token
  2. Share Pages with Integration:

    • Open any Notion page you want to access
    • Click "Share" → "Invite"
    • Select your integration
    • Repeat for all pages/databases you want to use

4. Nango Setup (OAuth)

  1. Create Nango Account: https://nango.dev
  2. Add Notion Integration in your Nango dashboard
  3. Configure OAuth with your Notion integration credentials
  4. Get your Nango credentials (Base URL, Secret Key, Connection ID)

5. Environment Configuration

Create a .env file with your credentials:

# Nango OAuth Configuration
NANGO_BASE_URL=https://api.nango.dev
NANGO_SECRET_KEY=your_nango_secret_key_here
NANGO_CONNECTION_ID=your_connection_id_here
NANGO_INTEGRATION_ID=notion

# Optional: Direct Notion Token (if not using Nango)
# NOTION_TOKEN=your_direct_notion_token_here

6. Claude Desktop Configuration

Add this to your Claude Desktop configuration file:

On macOS: ~/Library/Application Support/Claude/claude_desktop_config.json On Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "notion": {
      "command": "uvx",
      "args": ["git+https://github.com/Shameerpc5029/notion-mcp.git"],
      "env": {
        "NANGO_BASE_URL": "https://api.nango.dev",
        "NANGO_SECRET_KEY": "your_nango_secret_key",
        "NANGO_CONNECTION_ID": "your_connection_id", 
        "NANGO_INTEGRATION_ID": "notion"
      }
    }
  }
}

7. Test the Connection

# Test the server directly
python notion-mcp-server.py

# Or restart Claude Desktop and try asking:
# "Search my Notion for meeting notes"
# "Create a new task in my project database"

šŸ› ļø Available Tools

Tool Description Example Use
notion_search Search across all content "Find pages about project planning"
notion_get_database Get database info "Show me my tasks database structure"
notion_query_database Query with filters "Show incomplete tasks due this week"
notion_create_database Create new databases "Create a CRM database with contacts"
notion_get_page Get page details "Show me the content of my meeting notes"
notion_create_page Create new pages "Add a new task to my project database"
notion_update_page Update existing pages "Mark this task as completed"
notion_get_block_children Get page content "Read the content of this page"
notion_append_blocks Add content to pages "Add meeting notes to this page"
notion_get_current_user Get integration info "Check my Notion connection status"

šŸ’¬ Example Conversations with Claude

Once configured, you can have natural conversations like:

Task Management

You: "Show me all my incomplete tasks"
Claude: [Queries your tasks database and shows open items]

You: "Create a new task called 'Review MCP integration' due next Friday"
Claude: [Creates the task with proper due date]

You: "Mark the first task as completed"
Claude: [Updates the task status to Done]

Content Creation

You: "Create a meeting notes page for today's standup"
Claude: [Creates a new page with meeting template]

You: "Add action items from our discussion to that page"
Claude: [Appends bullet points with the action items]

Research & Organization

You: "Search for all pages mentioning 'API documentation'"
Claude: [Finds and lists relevant pages]

You: "Create a new database to track our API endpoints"
Claude: [Creates a structured database with relevant properties]

šŸ”§ Troubleshooting

Common Issues

"Authentication Error"

  • Check your .env file has correct Nango credentials
  • Verify your Nango integration is active
  • Ensure your Notion integration has proper capabilities

"Page not found" errors

  • Make sure you've shared the page/database with your integration
  • Check the page/database ID is correct
  • Verify the integration has read access

Claude can't find the server

  • Check the absolute path in claude_desktop_config.json is correct
  • Ensure Python is in your system PATH
  • Try running the server manually first to test

"No access token found"

  • Verify Nango connection is working
  • Check your NANGO_CONNECTION_ID matches your actual connection
  • Try refreshing your Nango integration

Debug Mode

Run with verbose logging:

python notion-mcp-server.py --debug

Manual Testing

Test individual functions:

from notion_mcp_server import NotionClient

client = NotionClient()
user = client.get_current_user()
print(f"Connected as: {user.get('name')}")

šŸ”’ Security Notes

  • Never commit your .env file to version control
  • Keep your Nango secret key secure
  • Only share Notion pages that the integration needs access to
  • Regularly review your integration's access in Notion settings

šŸ“ File Structure

notion-mcp/
ā”œā”€ā”€ main.py    # Main MCP server
ā”œā”€ā”€ pyproject.toml        # Python dependencies  
ā”œā”€ā”€ .env.example
ā”œā”€ā”€ .env                   # Your credentials (don't commit!)
ā”œā”€ā”€ README.md              # This file

šŸ†˜ Getting Help

  1. Check the logs - Look for error messages in Claude Desktop or terminal
  2. Verify permissions - Ensure your integration can access the pages
  3. Test manually - Run the server directly to isolate issues
  4. Check Notion status - Sometimes Notion API has outages

šŸŽ‰ What's Next?

Once you're up and running:

  • Try creating complex database queries
  • Set up automated content creation workflows
  • Use Claude to help organize and restructure your Notion workspace
  • Explore advanced filtering and sorting options

šŸ“„ License

This project is open source. Feel free to modify and adapt for your needs!


Happy Notion-ing with Claude! šŸŽŠ

Made with ā¤ļø for the AI-powered productivity enthusiasts

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured