# Notion CLI for AI Agents

```json
{
  "title": "Notion CLI for AI Agents",
  "toolkit": "Notion",
  "toolkit_slug": "notion",
  "framework": "CLI",
  "framework_slug": "cli",
  "url": "https://composio.dev/toolkits/notion/framework/cli",
  "markdown_url": "https://composio.dev/toolkits/notion/framework/cli.md",
  "updated_at": "2026-05-06T08:21:42.664Z"
}
```

## Introduction

CLIs are eating MCPs. The industry is converging on the very same idea. MCPs for all their merit can be token hungry, slow, and unreliable for complex tool chaining. However, coding agents have become incredibly good at working with CLIs, and in fact they are far more comfortable working with CLI tools than MCP.
With Composio's Universal CLI, your coding agents can talk to over 1000+ SaaS applications. With Notion, agents can add meeting notes to project wiki page, create a new task database for q3, archive completed sprint summary pages, and more — all without worrying about authentication.
This guide walks you through Composio Universal CLI and explains how you can connect it with coding agents like Claude Code, Codex, OpenCode, etc, for end-to-end Notion automation.

## Also integrate Notion with

- [ChatGPT](https://composio.dev/toolkits/notion/framework/chatgpt)
- [OpenAI Agents SDK](https://composio.dev/toolkits/notion/framework/open-ai-agents-sdk)
- [Claude Agent SDK](https://composio.dev/toolkits/notion/framework/claude-agents-sdk)
- [Claude Code](https://composio.dev/toolkits/notion/framework/claude-code)
- [Claude Cowork](https://composio.dev/toolkits/notion/framework/claude-cowork)
- [Codex](https://composio.dev/toolkits/notion/framework/codex)
- [Cursor](https://composio.dev/toolkits/notion/framework/cursor)
- [VS Code](https://composio.dev/toolkits/notion/framework/vscode)
- [OpenCode](https://composio.dev/toolkits/notion/framework/opencode)
- [OpenClaw](https://composio.dev/toolkits/notion/framework/openclaw)
- [Hermes](https://composio.dev/toolkits/notion/framework/hermes-agent)
- [Google ADK](https://composio.dev/toolkits/notion/framework/google-adk)
- [LangChain](https://composio.dev/toolkits/notion/framework/langchain)
- [Vercel AI SDK](https://composio.dev/toolkits/notion/framework/ai-sdk)
- [Mastra AI](https://composio.dev/toolkits/notion/framework/mastra-ai)
- [LlamaIndex](https://composio.dev/toolkits/notion/framework/llama-index)
- [CrewAI](https://composio.dev/toolkits/notion/framework/crew-ai)

## TL;DR

The idea behind building the universal CLI is to give agents a single command interface to interact with all your external applications. Here's what you'll get with it:
- Agent-friendly: Coding agents like Claude Code, Codex, and OpenCode can use CLI tools natively — no MCP setup required.
- Authentication handled: Connect once via OAuth or API Key, and all CLI commands work with your credentials automatically.
- Tool discovery: Search, inspect, and execute 20,000+ tools across 1000+ apps from one interface.
- Trigger support: Use triggers to listen for events across your apps, powered by real-time webhooks or polling under the hood.
- Type generation: Generate typed schemas for autocomplete and type safety in your projects.

## Connect Notion to CLI

### Prerequisites
Install the Composio CLI, authenticate, and initialize your project:

```bash
# Install the Composio CLI
curl -fsSL https://composio.dev/install | bash

# Authenticate with Composio
composio login
```

## What is the Notion MCP server, and what's possible with it?

The Notion MCP server is an implementation of the Model Context Protocol that connects your AI agent and assistants like Claude, Cursor, etc directly to your Notion account. It provides structured and secure access to your notes, docs, wikis, and tasks, so your agent can perform actions like creating pages, managing databases, adding content, commenting, and organizing your Notion workspace for you.
- Bulk content creation and formatting: Let your agent efficiently add and format multiple blocks of text, lists, or markdown content to Notion pages in one go.
- Automated page and database management: Have your agent create new pages, duplicate existing ones, or set up entire databases with custom properties—no manual setup required.
- Smart commenting and collaboration: Enable your agent to add comments to pages or discussion threads, making real-time collaboration smoother.
- Workspace organization and cleanup: Ask your agent to archive, delete, or restore pages and blocks, keeping your workspace tidy and up to date.
- Deep block and structure retrieval: Direct your agent to fetch metadata, list child blocks, or dig into nested content for analysis, reporting, or workflow automation.

## Supported Tools

| Tool slug | Name | Description |
|---|---|---|
| `NOTION_ADD_MULTIPLE_PAGE_CONTENT` | Add multiple content blocks (bulk, user-friendly) | Efficiently adds multiple standard content blocks to a notion page in a single api call with automatic markdown parsing. the 'content' field in notionrichtext blocks now automatically detects and parses markdown formatting including headers (# ## ###), bold (**text**), italic (*text*), strikethrough (~~text~~), inline code (`code`), links ([text](url)), and more. ideal for bulk content creation, ai agents, and replacing multiple individual add page content calls. supports automatic text formatting, content splitting, and up to 100 blocks per request. |
| `NOTION_APPEND_BLOCK_CHILDREN` | Append complex blocks (advanced, full control) | Appends complex blocks with full notion block structure to a parent block or page. use for advanced scenarios requiring precise control: code blocks, tables, embeds, nested children within blocks, or when working with pre-built notion block objects. requires full notion api block schema - use add multiple page content for simpler content creation. |
| `NOTION_ARCHIVE_NOTION_PAGE` | Archive Notion Page | Archives (moves to trash) or unarchives (restores from trash) a specified notion page. |
| `NOTION_CREATE_COMMENT` | Create comment | Adds a comment to a notion page (via `parent page id`) or to an existing discussion thread (via `discussion id`); cannot create new discussion threads on specific blocks (inline comments). |
| `NOTION_CREATE_DATABASE` | Create Notion Database | Creates a new notion database as a subpage under a specified parent page with a defined properties schema; use this action exclusively for creating new databases. |
| `NOTION_CREATE_NOTION_PAGE` | Create Notion page | Creates a new empty page in a notion workspace. |
| `NOTION_DELETE_BLOCK` | Delete a block | Archives a notion block, page, or database using its id, which sets its 'archived' property to true (like moving to "trash" in the ui) and allows it to be restored later. |
| `NOTION_DUPLICATE_PAGE` | Duplicate page | Duplicates a notion page, including all its content, properties, and nested blocks, under a specified parent page or workspace. |
| `NOTION_FETCH_BLOCK_CONTENTS` | Fetch Notion Block Children | Retrieves a paginated list of direct, first-level child block objects along with contents for a given parent notion block or page id; use block ids from the response for subsequent calls to access deeply nested content. |
| `NOTION_FETCH_BLOCK_METADATA` | Fetch Notion block metadata | Fetches metadata for a notion block (or page, as pages are blocks) using its valid uuid; if the block has children, use fetch block contents to fetch their contents. |
| `NOTION_FETCH_COMMENTS` | Fetch comments | Fetches unresolved comments for a specified notion block or page id. |
| `NOTION_FETCH_DATA` | Fetch Notion Data | Fetches notion items (pages and/or databases) from the notion workspace, use this to get minimal data about the items in the workspace with a query or list all items in the workspace with minimal data |
| `NOTION_FETCH_DATABASE` | Fetch Database | Fetches a notion database's structural metadata (properties, title, etc.) via its `database id`, not the data entries; `database id` must reference an existing database. |
| `NOTION_FETCH_ROW` | Fetch database row | Retrieves a notion database row's properties and metadata; use fetch block contents for page content blocks. |
| `NOTION_GET_ABOUT_ME` | Get About Me | Retrieves the user object for the bot associated with the current notion integration token, typically to obtain the bot's user id for other api operations. |
| `NOTION_GET_ABOUT_USER` | Get about user | Retrieves detailed information about a specific notion user, such as their name, avatar, and email, based on their unique user id. |
| `NOTION_GET_PAGE_PROPERTY_ACTION` | Get page property | Call this to get a specific property from a notion page when you have a valid `page id` and `property id`; handles pagination for properties returning multiple items. |
| `NOTION_INSERT_ROW_DATABASE` | Insert row database | Creates a new page (row) in a specified notion database. |
| `NOTION_LIST_USERS` | List users | Retrieves a paginated list of users (excluding guests) from the notion workspace; the number of users returned per page may be less than the requested `page size`. |
| `NOTION_QUERY_DATABASE` | Query database | Queries a notion database for pages (rows), where rows are pages and columns are properties; ensure sort property names correspond to existing database properties. |
| `NOTION_RETRIEVE_COMMENT` | Retrieve Comment | Tool to retrieve a specific comment by its id. use when you have a comment id and need to fetch its details. |
| `NOTION_RETRIEVE_DATABASE_PROPERTY` | Retrieve Database Property | Tool to retrieve a specific property object of a notion database. use when you need to get details about a single database column/property. |
| `NOTION_SEARCH_NOTION_PAGE` | Search Notion page | Searches notion pages and databases by title; an empty query lists all accessible items, useful for discovering ids or as a fallback when a specific query yields no results. |
| `NOTION_UPDATE_BLOCK` | Update block | Updates an existing notion block's textual content or type-specific properties (e.g., 'checked' status, 'color'), using its `block id` and the specified `block type`. |
| `NOTION_UPDATE_PAGE` | Update Page | Tool to update the properties, icon, cover, or archive status of a page. use when you need to modify existing page attributes. |
| `NOTION_UPDATE_ROW_DATABASE` | Update row database | Updates or archives an existing notion database row (page) using its `row id`, allowing modification of its icon, cover, and/or properties; ensure the target page is accessible and property details (names/ids and values) align with the database schema and specified formats. |
| `NOTION_UPDATE_SCHEMA_DATABASE` | Update database schema | Updates an existing notion database's title, description, and/or properties; at least one of these attributes must be provided to effect a change. |

## Supported Triggers

| Trigger slug | Name | Description |
|---|---|---|
| `NOTION_ALL_PAGE_EVENTS_TRIGGER` | All Page Events | Triggers when any Notion page is created or updated across the workspace. |
| `NOTION_COMMENT_CREATED` | Comment Created | Triggers when a new comment is created in Notion. Optional `page_id` filter scopes to comments on a specific page. When omitted, fires for any new comment in the workspace the integration has access to. Requires the 'Read comments' capability on the Notion integration. If a connection was authorized before that capability was enabled, the user must re-authorize the connection for comment events to flow. |
| `NOTION_COMMENTS_ADDED_TRIGGER` | New Comment | Triggers when a new comment is added to a specified Notion block or page. |
| `NOTION_DATABASE_CREATED` | Database Created | Triggers when a new Notion database (the container) is created. A database is the post-2025-09-03 container that holds one or more data sources. This trigger fires for the container's creation event (`database.created`), distinct from `NOTION_DATASOURCE_CREATED` which fires when a new data source is added to an existing database. Most customers calling Notion's `POST /v1/databases` (the legacy API) or creating a database via the Notion UI will see this event. Adding a new data source to an existing database fires `data_source.created` instead — use `NOTION_DATASOURCE_CREATED` for that. Notion's payload puts `entity.type: "block"` (the container is a `child_database` block in the content tree) and `entity.id` is the database id. |
| `NOTION_DATASOURCE_CREATED` | Data Source Created | Triggers when a new Notion data source is created. Fires workspace-wide. The payload's `data.parent` carries the data source's tree parent (typically the teamspace) for downstream filtering. A single template-based database creation can fire multiple `data_source.created` events at once — one per data source the template instantiates. |
| `NOTION_DATASOURCE_SCHEMA_UPDATED` | Data Source Schema Updated | Triggers when a Notion data source's schema is updated. Fires on column add / remove / rename. Payload includes `data.updated_properties: [{id, name, action}]` so consumers can discriminate the kind of change downstream. Optional `data_source_id` filter scopes to schema changes on a single data source. When omitted, fires for any schema change in the workspace the integration has access to. Note: adding a column also fires `page.properties_updated` once per existing row in the data source. Customers wanting a single structural-change signal should use this trigger. |
| `NOTION_PAGE_ADDED_TO_DATABASE` | New Page | Triggers when a new page is added to a Notion database. |
| `NOTION_PAGE_ADDED_TRIGGER` | Page Added to Page | Fires when a new subpage (a `child_page` type block) is added under a specified parent Notion page. |
| `NOTION_PAGE_CONTENT_UPDATED` | Page Content Updated | Triggers when the body content of a Notion page is updated. Customer optionally scopes with at most one of: - data_source_id: any row in this data source - page_id: this specific page - parent_page_id: any page whose immediate parent is this page With none set, fires for any page content edit in the workspace the integration has access to. Notion aggregates content edits within a short window (~60s typical). |
| `NOTION_PAGE_CREATED` | Page Created | Triggers when a new Notion page is created. Customer optionally scopes with at most one of: - data_source_id: new row in this data source - parent_page_id: new sub-page under this page (immediate parent only) With neither set, fires for any new page in the workspace the integration has access to. Notion sends ~60s aggregation latency on most events. |
| `NOTION_PAGE_PROPERTIES_UPDATED` | Page Properties Updated | Triggers when properties of a Notion page are updated. Customer optionally scopes with at most one of: - data_source_id: any row in this data source - page_id: this specific page - parent_page_id: any page whose immediate parent is this page With none set, fires for any property change in the workspace the integration has access to. Adding a column to a data source fires this trigger once per existing row. Customers can branch on `data.updated_properties` (array of property IDs) to filter downstream. |
| `NOTION_PAGE_UPDATED_TRIGGER` | Page Updated | Triggers when any block within a specified Notion page is updated. |
| `NOTION_VIEW_CREATED` | View Created | Triggers when a new Notion view is created. Fires workspace-wide. The payload includes `data.view_type` (`table`, `board`, `gallery`, `calendar`, `list`, `timeline`, `gantt`) and `data.parent` pointing at the view's tree parent (typically the teamspace), so customers can filter downstream. |

## Complete Code

None listed.

## Conclusion

- Try asking your coding agent to perform various Notion operations
- Explore cross-app workflows by connecting more toolkits
- Set up triggers for real-time automation
- Use composio generate for typed schemas in your projects

## How to build Notion MCP Agent with another framework

- [ChatGPT](https://composio.dev/toolkits/notion/framework/chatgpt)
- [OpenAI Agents SDK](https://composio.dev/toolkits/notion/framework/open-ai-agents-sdk)
- [Claude Agent SDK](https://composio.dev/toolkits/notion/framework/claude-agents-sdk)
- [Claude Code](https://composio.dev/toolkits/notion/framework/claude-code)
- [Claude Cowork](https://composio.dev/toolkits/notion/framework/claude-cowork)
- [Codex](https://composio.dev/toolkits/notion/framework/codex)
- [Cursor](https://composio.dev/toolkits/notion/framework/cursor)
- [VS Code](https://composio.dev/toolkits/notion/framework/vscode)
- [OpenCode](https://composio.dev/toolkits/notion/framework/opencode)
- [OpenClaw](https://composio.dev/toolkits/notion/framework/openclaw)
- [Hermes](https://composio.dev/toolkits/notion/framework/hermes-agent)
- [Google ADK](https://composio.dev/toolkits/notion/framework/google-adk)
- [LangChain](https://composio.dev/toolkits/notion/framework/langchain)
- [Vercel AI SDK](https://composio.dev/toolkits/notion/framework/ai-sdk)
- [Mastra AI](https://composio.dev/toolkits/notion/framework/mastra-ai)
- [LlamaIndex](https://composio.dev/toolkits/notion/framework/llama-index)
- [CrewAI](https://composio.dev/toolkits/notion/framework/crew-ai)

## Related Toolkits

- [Google Sheets](https://composio.dev/toolkits/googlesheets) - Google Sheets is a cloud-based spreadsheet tool for real-time collaboration and data analysis. It lets teams work together from anywhere, updating information instantly.
- [Airtable](https://composio.dev/toolkits/airtable) - Airtable combines the flexibility of spreadsheets with the power of a database for easy project and data management. Teams use Airtable to organize, track, and collaborate with custom views and automations.
- [Asana](https://composio.dev/toolkits/asana) - Asana is a collaborative work management platform for teams to organize and track projects. It streamlines teamwork, boosts productivity, and keeps everyone aligned on goals.
- [Google Tasks](https://composio.dev/toolkits/googletasks) - Google Tasks is a to-do list and task management tool integrated into Gmail and Google Calendar. It helps you organize, track, and complete tasks across your Google ecosystem.
- [Linear](https://composio.dev/toolkits/linear) - Linear is a modern issue tracking and project planning tool for fast-moving teams. It helps streamline workflows, organize projects, and boost productivity.
- [Jira](https://composio.dev/toolkits/jira) - Jira is Atlassian’s platform for bug tracking, issue tracking, and agile project management. It helps teams organize work, prioritize tasks, and deliver projects efficiently.
- [Clickup](https://composio.dev/toolkits/clickup) - ClickUp is an all-in-one productivity platform for managing tasks, docs, goals, and team collaboration. It streamlines project workflows so teams can work smarter and stay organized in one place.
- [Monday](https://composio.dev/toolkits/monday) - Monday.com is a customizable work management platform for project planning and collaboration. It helps teams organize tasks, automate workflows, and track progress in real time.
- [Addressfinder](https://composio.dev/toolkits/addressfinder) - Addressfinder is a data quality platform for verifying addresses, emails, and phone numbers. It helps you ensure accurate customer and contact data every time.
- [Agiled](https://composio.dev/toolkits/agiled) - Agiled is an all-in-one business management platform for CRM, projects, and finance. It helps you streamline workflows, consolidate client data, and manage business processes in one place.
- [Ascora](https://composio.dev/toolkits/ascora) - Ascora is a cloud-based field service management platform for service businesses. It streamlines scheduling, invoicing, and customer operations in one place.
- [Basecamp](https://composio.dev/toolkits/basecamp) - Basecamp is a project management and team collaboration tool by 37signals. It helps teams organize tasks, share files, and communicate efficiently in one place.
- [Beeminder](https://composio.dev/toolkits/beeminder) - Beeminder is an online goal-tracking platform that uses monetary pledges to keep you motivated. Stay accountable and hit your targets with real financial incentives.
- [Boxhero](https://composio.dev/toolkits/boxhero) - Boxhero is a cloud-based inventory management platform for SMBs, offering real-time updates, barcode scanning, and team collaboration. It helps businesses streamline stock tracking and analytics for smarter inventory decisions.
- [Breathe HR](https://composio.dev/toolkits/breathehr) - Breathe HR is cloud-based HR software for SMEs to manage employee data, absences, and performance. It simplifies HR admin, making it easy to keep employee records accurate and up to date.
- [Breeze](https://composio.dev/toolkits/breeze) - Breeze is a project management platform designed to help teams plan, track, and collaborate on projects. It streamlines workflows and keeps everyone on the same page.
- [Bugherd](https://composio.dev/toolkits/bugherd) - Bugherd is a visual feedback and bug tracking tool for websites. It helps teams and clients report website issues directly on live sites for faster fixes.
- [Canny](https://composio.dev/toolkits/canny) - Canny is a platform for managing customer feedback and feature requests. It helps teams prioritize product decisions based on real user insights.
- [Chmeetings](https://composio.dev/toolkits/chmeetings) - Chmeetings is a church management platform for events, members, donations, and volunteers. It streamlines church operations and improves community engagement.
- [ClickSend](https://composio.dev/toolkits/clicksend) - ClickSend is a cloud-based SMS and email marketing platform for businesses. It streamlines communication by enabling quick message delivery and contact management.

## Frequently Asked Questions

### What is the Composio Universal CLI?

The Composio Universal CLI is a single command-line interface that lets coding agents and developers interact with 1000+ SaaS applications. It handles authentication, tool discovery, action execution, and trigger setup — all from the terminal, without needing to configure MCP servers.

### Which coding agents work with the Composio CLI?

Any coding agent that can run shell commands works with the Composio CLI — including Claude Code, Codex, OpenCode, OpenClaw, and others. Once the CLI is installed, agents automatically discover and use the composio commands to interact with Notion and other connected apps.

### How is the CLI different from using an MCP server for Notion?

MCP servers require configuration and can be token-heavy for complex workflows. The CLI gives agents a direct, lightweight interface — no server setup needed. Agents simply call composio commands like any other shell tool. It's faster to set up, more reliable for multi-step tool chaining, and works natively with how coding agents already operate.

### How safe is my Notion data when using the Composio CLI?

All sensitive data such as tokens, keys, and configuration is fully encrypted at rest and in transit. Composio is SOC 2 Type 2 compliant and follows strict security practices so your Notion data and credentials are handled as safely as possible. You can also bring your own OAuth credentials for full control.

---
[See all toolkits](https://composio.dev/toolkits) · [Composio docs](https://docs.composio.dev/llms.txt)
