Open Source·AI Agent Infrastructure

Notion. Agent-Native.

Query databases. Export pages as markdown. Create entries. Full Notion control from the terminal.

Notion is where your team stores everything — deals, docs, SOPs, sprint logs, and CRM data. But agents can't browse a dashboard. They hit the API directly, hand-parse nested property objects, and lose context every time a schema changes.
So we built notion-agent — 29 commands across 7 groups, all as MCP tools, wired for autonomous workspace access from day one.

View on GitHubInstall from npm
29
Commands
7
Command Groups
29
MCP Tools
OpenClaw
OpenClaw
CLI / MCP
Notion
29 commands · 7 command groups · 29 MCP tools · zero dashboard

Why notion-agent Exists

Without notion-agent

  • No CLI — Notion only offers a REST API and browser dashboard
  • Raw API returns deeply nested property objects — agents struggle to parse them reliably
  • Schema changes break hardcoded property names silently
  • No markdown export — agents can't read page content without parsing block arrays
  • Every workflow requires knowing page IDs upfront — no dynamic search

With notion-agent

  • 29 commands with clean, flat JSON output — no nested parsing needed
  • Schema inspection built in — agents check property names before writing
  • Markdown export in one command — full page content in agent context
  • Dynamic search by keyword — no hardcoded IDs required
  • 29 MCP tools — plug directly into Claude Code, Claude Desktop, or Cursor

What Your Agent Can Do

29 commands across 7 groups — every Notion operation your agent needs.

Database Query & Filtering

Query any Notion database with full filter and sort support — by date, select, checkbox, relation, and more. Returns structured JSON rows your agent can reason over without touching the dashboard.

Page Markdown Export

Export any Notion page as clean markdown — perfect for feeding docs, SOPs, or deal briefs directly into agent context windows. One command returns the full page content as agent-ready text.

Create & Update Pages

Create new pages in any database or parent page, update properties on existing entries, archive and restore pages — your agent writes research, meeting notes, or deal updates directly into Notion.

Block Manipulation

Append paragraphs, code blocks, dividers, and more to any page. Get, update, or delete individual blocks. Agents can build structured notes, append findings to running logs, or scaffold entire docs programmatically.

Workspace Search

Full-text search across your entire Notion workspace — pages and databases. Filter by type. Your agent finds the right doc, deal, or contact in seconds without knowing the exact page ID.

Database Schema Inspection

Get the full schema of any database — property names, types, options, and relations. Agents understand the structure before writing, eliminating type mismatches and failed property updates.

User & Team Lookup

List workspace members, look up individual users by ID, or get the bot identity. Agents know who is in the workspace for @mentions, task assignment, or team coordination workflows.

MCP Server Mode

29 MCP tools registered for direct AI agent connectivity. Run notion-agent as an MCP server and give Claude, Cursor, or any MCP-compatible agent full Notion workspace access with one config entry.

Agent Workflows

Real use cases — what your agent can run autonomously today.

CRM Query — Pull Pipeline by Stage

Show me all deals in the "Proposal Sent" stage from my Notion CRM.

Agent inspects the database schema first to confirm property names, then queries with a filter. Returns every deal row as structured JSON — no dashboard, no manual export, no copy-paste.

01
notion-agent databases list

List all databases and find your CRM ID

02
notion-agent databases schema --database-id "abc123"

Inspect schema — confirm the stage property name

03
notion-agent databases query --database-id "abc123" --filter '{"property":"Stage","select":{"equals":"Proposal Sent"}}'

Query deals at this stage — returns full row JSON

Doc Export — Feed SOP Into Agent Context

Read our onboarding SOP and summarize the key steps for a new SDR.

Agent searches the workspace for the doc by keyword, then exports the full page as markdown. Clean text lands directly in the context window — no PDF, no browser, no copy-paste.

01
notion-agent search all --query "SDR onboarding SOP"

Find the doc by keyword across the workspace

02
notion-agent pages content --page-id "def456"

Get raw block content of the page

03
notion-agent pages markdown --page-id "def456"

Export as clean markdown for agent context

Deal Update — Write Research Back Into Notion

I just finished a discovery call with Acme Corp. Log the call notes and update their deal stage.

Agent creates a structured call notes page in the CRM database, then updates the deal stage property — all from terminal output. Your Notion stays current without manual data entry.

01
notion-agent pages create --parent-id "abc123" --title "Acme Corp — Discovery Call 2026-03-27" --content "Key pain points: [...]"

Create call notes page inside the CRM database

02
notion-agent pages property --page-id "ghi789" --property "Stage" --value "Discovery Complete"

Update deal stage on the account record

03
notion-agent blocks append --block-id "ghi789" --type "paragraph" --text "Next step: send proposal by 2026-04-03"

Append next-action block to the deal page

Workspace Search — Find Any Page Without the ID

Find the Q1 2026 board meeting notes and give me a summary.

Most agent Notion integrations require hardcoded page IDs. notion-agent search commands return IDs dynamically — agents navigate workspaces just like a human would, by typing what they're looking for.

01
notion-agent search pages --query "Q1 2026 board meeting"

Search pages only — returns ID + title + last edited

02
notion-agent pages get --page-id "jkl012"

Get page metadata and properties

03
notion-agent pages markdown --page-id "jkl012"

Export full content as markdown for summarization

Sprint Log — Agent Appends Daily Standups

Log today's standup: shipped email validation, blocked on Clay webhook timeout.

Agents maintaining a running sprint log or standup tracker can append structured blocks to an existing Notion page every session. No new page each time — just a clean append to the right place.

01
notion-agent search pages --query "Sprint Log March 2026"

Locate the sprint log page

02
notion-agent blocks append --block-id "mno345" --type "paragraph" --text "2026-03-27 — Shipped: email validation. Blocked: Clay webhook timeout."

Append today's standup as a new block

03
notion-agent pages get --page-id "mno345"

Confirm the block was appended correctly

Quick Start

1Install

terminal
npm install -g notion-agent

# Or run without installing
npx notion-agent databases list

2Authenticate

Create a Notion integration at notion.so/my-integrations and grab your integration token.

terminal
# Option A — environment variable (recommended)
export NOTION_TOKEN=secret_xxxxxxxxxx

# Option B — save to config file
notion-agent login --token secret_xxxxxxxxxx

# Option C — per-command flag
notion-agent databases list --token secret_xxxxxxxxxx

3First commands

terminal
# List all databases in your workspace
notion-agent databases list

# Search for a page
notion-agent search all --query "Q1 pipeline"

# Export a page as markdown
notion-agent pages markdown --page-id PAGE_ID

# Query a database with a filter
notion-agent databases query --database-id DB_ID --filter '{"property":"Status","select":{"equals":"Active"}}'

Commands Reference

29 commands across 7 groups.

databases7 commands
databases listList all databases in the workspace
databases getGet a database by ID
databases schemaGet full schema — property names, types, options
databases propertiesList all properties of a database
databases queryQuery rows with filter and sort support
databases createCreate a new database
databases updateUpdate database title or properties
pages8 commands
pages getGet page metadata and properties
pages createCreate a new page in a database or parent page
pages updateUpdate page properties
pages archiveArchive (soft-delete) a page
pages restoreRestore an archived page
pages propertyGet or update a single property value
pages contentGet all block content of a page
pages markdownExport page as clean markdown
blocks5 commands
blocks getGet a block by ID
blocks childrenList all child blocks of a page or block
blocks appendAppend paragraph, code, divider, or other blocks
blocks updateUpdate block content
blocks deleteDelete a block
users3 commands
users listList all workspace members
users getGet a user by ID
users meGet the bot/integration identity
comments2 commands
comments listList comments on a page or block
comments createCreate a new comment
search3 commands
search allSearch across all pages and databases
search pagesSearch pages only
search databasesSearch databases only
workspace1 commands
workspace infoGet workspace name, ID, and domain

MCP Server Setup

Add notion-agent as an MCP server to give Claude or Cursor full Notion access — all 29 commands available as native tools.

Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:

claude_desktop_config.json
{
  "mcpServers": {
    "notion-agent": {
      "command": "notion-agent",
      "args": ["mcp"],
      "env": {
        "NOTION_TOKEN": "secret_xxxxxxxxxx"
      }
    }
  }
}

Claude Code (CLI)

terminal
claude mcp add notion-agent -- notion-agent mcp

Make sure NOTION_TOKEN is set in your environment before running Claude Code.

Cursor

Add to ~/.cursor/mcp.json:

~/.cursor/mcp.json
{
  "mcpServers": {
    "notion-agent": {
      "command": "notion-agent",
      "args": ["mcp"],
      "env": {
        "NOTION_TOKEN": "secret_xxxxxxxxxx"
      }
    }
  }
}
OpenClaw

Want us to build this into your stack?

We set up notion-agent as part of your OpenClaw agent infrastructure — wired to your CRM, deal flow, and GTM motion. Your Notion becomes a live, agent-readable workspace.

🗂️ Notion CRM setup — deal pipeline, contact database, and automated logging
🤖 Agent integration — notion-agent wired into your OpenClaw GTM agent as MCP tools
🔄 Full-stack automation — n8n + notion-agent + Clay + Instantly in one connected loop
Star on GitHub