Notion Connector

Connect PraisonAI agents to Notion pages and databases with official remote MCP and OAuth 2.1

Connect your PraisonAI agents to your Notion workspace to search company docs, summarize meeting notes, query databases, and draft pages through Notion’s official remote MCP server.

SettingValue
Catalog IDnotion
Endpointhttps://mcp.notion.com/mcp
TransportStreamable HTTP (Remote)
AuthenticationOAuth 2.1 (browser or --manual)
python
from praisonaiagents import Agent, MCP

agent = Agent(
    name="Knowledge Assistant",
    instructions="Search Notion pages and answer questions with page titles.",
    tools=MCP(
        "https://mcp.notion.com/mcp",
        oauth=True,
        server_name="notion",
    ),
)

agent.start("Search my Notion workspace for Q3 launch checklists and summarize open items")

The user asks for project documentation; PraisonAI queries authorized Notion pages via OAuth 2.1 and summarizes the findings.

Diagram

👤 User

🤖 PraisonAI Agent

🔐 OAuth 2.1 PKCE

📝 Notion Remote MCP
mcp.notion.com/mcp

✅ Pages & Databases


How It Works

During OAuth 2.1 sign-in, Notion lets you choose the exact workspace and pages your agent is allowed to access. Tokens are saved locally in ~/.praisonai/mcp-auth.json (0600) and shared across Python, CLI, and Dashboard.

Diagram
PraisonAI AgentNotion MCP Servermcp-auth.jsonNotion OAuth 2.1praisonai CLIUserPraisonAI AgentNotion MCP Servermcp-auth.jsonNotion OAuth 2.1praisonai CLIUserpraisonai connectors add notion –authOpen OAuth 2.1 consent flowSelect workspace and allowed pagesStore OAuth token (0600)Search Notion docsLoad cached tokenCall search and fetch toolsPage content and database rowsGrounded summary

Step-by-Step Setup

  1. Prerequisites
    • A Notion account with permission to authorize integrations in your workspace
    • Know which top-level pages or databases you want to grant access to during consent
  2. Install PraisonAI with MCP support
    bash
    pip install "praisonai[mcp]"
  3. Add and authenticate Notion

    CLI (Interactive OAuth)

    bash
    praisonai connectors add notion --auth

    In the Notion consent screen, select the workspace and specific pages your agent should access.

    Headless / SSH (–manual)

    bash
    praisonai connectors add notion --auth --manual

    PraisonAI Dashboard

    Enable catalog connectors in your PraisonAIUI config.yaml:

    yaml
    mcp:
      enabled: true
      allow:
        catalog: true

    Run praisonai dashboard, open Connectors / MCP, and click Connect on Notion.

  4. Verify and list available tools
    bash
    praisonai mcp sync notion
  5. Use Notion with your agent
    python
    from praisonaiagents import Agent, MCP
    
    agent = Agent(
        name="Docs Search",
        instructions="Cite the exact Notion page title for every fact you return.",
        tools=MCP("https://mcp.notion.com/mcp", oauth=True, server_name="notion"),
    )
    
    agent.start("Find our onboarding guide in Notion and list the Day 1 checklist")

Scope Tools for Safety

Limit knowledge-lookup agents to search/fetch tools and require approval before editing or creating pages:

python
from praisonaiagents import Agent, MCP

agent = Agent(
    name="Notion Reader",
    instructions="Read and summarize Notion pages without editing them.",
    tools=MCP(
        "https://mcp.notion.com/mcp",
        oauth=True,
        server_name="notion",
        allowed_tools=["notion-search", "notion-fetch"],
    ),
)

Common Workflows

  • Meeting Notes Action Items: "Search Notion for this week's standup notes and extract every owner and due date."
  • Drafting Spec Pages: "Fetch the Product Spec template in Notion and draft a new spec for our webhook retry feature."

Troubleshooting

SymptomCauseFix
Search returns empty resultsPages were not selected during Notion OAuth consentRe-authorize (praisonai connectors logout notion --yes then praisonai connectors auth notion) and select the parent pages
401 Unauthorized on praisonai connectors test notionconnectors test does not attach stored OAuth tokensVerify with praisonai mcp sync notion
Cannot create pages in a databaseAgent only has read tools allowed or page is read-onlyCheck --allow / allowed_tools and Notion page permissions

Best Practices

Grant access only to specific Notion folders

During OAuth consent, share only the project or wiki parent pages the agent needs rather than your entire company workspace.

Check exact tool names with praisonai mcp sync notion

Notion’s remote MCP tool names can evolve — run praisonai mcp sync notion to inspect exact tool names before configuring allowed_tools.

Use approval='always' before enabling page writes

Set approval="always" on MCP(...) whenever an agent is allowed to create or overwrite shared Notion documentation.


Related