Openclaw Notion

by @OctavianTocan

Native Notion integration for OpenClaw — 9 tools with markdown-first editing and multi-agent workspace isolation.

Install with ClawLodge CLIRequires clawlodge-cli
npm install -g clawlodge-cli
clawlodge install octaviantocan-openclaw-notion
Best for
Includes
17 Filesv0.1.0

openclaw-notion

Native Notion integration for OpenClaw. Gives your agents direct access to the Notion API through 17 built-in tools — no scripts, no browser automation, no middleware.

Built on the official @notionhq/client SDK with Notion API v2026-03-11 (enhanced markdown support).

Features

  • 17 native tools — search, read, create, update, query, sync, delete, move, comment, diagnostics
  • Markdown-first — create and edit pages with plain markdown instead of Notion's block JSON
  • Multi-agent isolation — each agent gets its own API key and workspace, routed automatically
  • Bidirectional sync — push/pull local markdown files to Notion pages with frontmatter identity
  • Zero config — drop in API keys, register the plugin, restart the gateway

Tools

ToolDescription
notion_searchSearch pages and databases by keyword
notion_readRead raw block contents of a page
notion_read_markdownRead a page as clean markdown
notion_createCreate a new page with markdown content
notion_appendAppend a text paragraph to a page
notion_update_markdownReplace a page's content with markdown
notion_update_pageUpdate page title and icon
notion_comment_createAdd a comment to a page
notion_comment_listList comments on a page
notion_queryQuery a database with filter and sort JSON
notion_deleteMove a page to trash
notion_moveReparent a page under another page
notion_publishToggle public sharing (stub — API limitation)
notion_file_treeRecursively enumerate child pages and databases
notion_syncSync a local markdown file with a Notion page
notion_helpBuilt-in tool documentation
notion_doctorDiagnostics for API keys, SDK version, and connectivity

Installation

1. Create a Notion integration

Go to notion.so/my-integrations and create an internal integration. Copy the API key.

2. Store the API key

mkdir -p ~/.config/notion
echo "ntn_your_api_key_here" > ~/.config/notion/api_key

For multi-agent setups, add agent-specific keys:

echo "ntn_other_agent_key" > ~/.config/notion/api_key_my_agent

The plugin checks for ~/.config/notion/api_key_{agentId} first, falling back to ~/.config/notion/api_key.

3. Register the plugin

Add to your openclaw.json:

{
  "extensions": {
    "entries": {
      "notion": {
        "enabled": true
      }
    },
    "installs": {
      "notion": {
        "source": "path",
        "installPath": "/path/to/openclaw-notion"
      }
    }
  }
}

4. Build and restart

cd /path/to/openclaw-notion
pnpm install
pnpm build
openclaw gateway restart

Multi-Agent Routing

Each OpenClaw agent has an agentId injected via the plugin context. The plugin uses this to load the correct API key, so agents are isolated to their own Notion workspaces by default.

AgentKey fileWorkspace
Default~/.config/notion/api_keyDefault workspace
Any agent~/.config/notion/api_key_{agentId} → fallback api_keyResolved per key

Cross-workspace access is blocked by design — each API key only has access to pages shared with its integration.

Development

pnpm install       # install dependencies
pnpm build         # compile TypeScript
pnpm test          # run tests (requires real API keys)
pnpm lint          # biome check

Running tests with a secondary agent

Tests verify multi-agent isolation against two live Notion workspaces. Set the secondary agent ID via environment variable:

NOTION_SECONDARY_AGENT=my_agent pnpm test

This expects ~/.config/notion/api_key_my_agent to exist and point to a different workspace than the default key.

Requirements

  • Node.js ≥ 22
  • OpenClaw ≥ 2026.3.24
  • Notion API key(s) with access to target pages

License

MIT — see LICENSE.

Workspace

Updated 2026-04-19 18:07:53Published via clawlodge-cli/0.1.8
AGENTS.md
text · 1.1 KB

Loading preview...

No comments yet.

Related Lobsters