Notion MCP

by michaeldslim

MCP Client
  • other

About

What is Notion MCP?

Notion MCP is a simple Node.js application that uses the Notion API to create content blocks in Notion pages. It is designed for developers who want to automate adding structured entries (dates and content) to a Notion page organized by year and month subpages.

How to use Notion MCP?

Install by running npx @composio/mcp setup with the provided URL and client flag. Add the MCP server configuration to mcp_config.json. Then run npm install, create a .env file with NOTION_API_KEY and NOTION_DATABASE_ID, and execute either node index.js or npm start. Optionally pass a date and content as command-line arguments: node index.js "[date]" "content".

Key features of Notion MCP

- Uses the Notion API for content creation
- Creates date blocks and content blocks
- Automatically navigates to 2025 and March subpages
- Avoids duplicate blocks for the same date
- Displays execution results in the console

Use cases of Notion MCP

- Automate daily meeting notes entry in a Notion page
- Quickly add content blocks organized by date
- Schedule recurring entries without manual copy‑paste

FAQ from Notion MCP

How do I get a Notion API key?

Go to the Notion Developer Page, create a new integration, and copy the “Internal Integration Token”.

How do I find the Page ID?

Open the target page in Notion, look at the URL (a 32‑character string separated by hyphens), or click “Share” → “Copy link” and extract the ID.

How do I set integration permissions?

On the Notion page, click “…” → “Connections” (or “Add connections”), then search for and add your integration.

What does the command node index.js "[date]" "content" do?

It accesses the Notion page, finds the 2025 subpage and the March subpage, creates the specified date block and content block there. If a block with the same date already exists, it does not create a duplicate.

What happens if a block with the same date already exists?

The application will not create a new block; it simply skips that step and continues without error.

Details

Author
michaeldslim
Category
other
Repository
michaeldslim/mcp-notion-api

Notion MCP

This project is a simple Node.js application that uses the Notion API to create content blocks in Notion pages.

Installation

1. Install MCP (Windsurf):

npx @composio/mcp setup "https://mcp.composio.dev/notion/nutritious-bashful-nail-e-V22O" --client windsurf

2. Add MCP server to mcp_config.json:

"mcpServers": {
"https://mcp.composio.dev/notion/nutritious-bashful-nail-e-V22O": {
"command": "npx",
"args": [
"@composio/mcp@latest",
"start",
"--url",
"https://mcp.composio.dev/notion/nutritious-bashful-nail-e-V22O"
],
"env": {
"npm_config_yes": "true"
}
}
}

3. Install required packages:

npm install

4. Configure .env file:

NOTION_API_KEY=your_notion_api_key_here
NOTION_DATABASE_ID=your_notion_page_id_here

How to Get Notion API Key and Page ID

1. Get Notion API Key:
- Go to the Notion Developer Page.
- Click the "New integration" button.
- Enter integration information and create it.
- The "Internal Integration Token" is your API key.

2. Get Page ID:
- Open the page you want to view in Notion.
- Find the page ID in the URL.
- Example: https://www.notion.so/[page ID]?v=...
- Or click the "Share" button on the page, select "Copy link", and extract the ID from the URL.
- The ID is typically a 32-character string separated by hyphens (in the format c9de4b57-aaaa-bbbb-cccc-13056c520983).

3. Set Integration Permissions:
- Click the "..." menu in the top right corner of the page.
- Find and click "Connections" or "Add connections".
- Search for and add the integration you created.

Usage

Basic Execution

Run the basic application:

node index.js

or
npm start

Creating Blocks

To create date blocks and content, use command line arguments as follows:

node index.js "[date]" "content"

Example:

node index.js "[03/25]" "Topics discussed in today's meeting"

This command performs the following:
1. Accesses the Notion page to find the 2025 subpage and the March subpage.
2. Creates the specified date block and content block in the March page.
3. Does not create a new block if a block with the same date already exists.

Execution results are displayed in the console.