Skip to main content
Glama

Notion API Server

Reference video

Video on how to use Notion MCP

This is a custom server for easy use of the Notion API. It is implemented using Express.js and provides various functions of the Notion API as a REST API.

How to install

  1. Install required packages:

npm install express cors @notionhq/client swagger-jsdoc swagger-ui-express
  1. Running the server:

node server.js
  1. The server runs at http://localhost:3000 .

How to set up

  1. Set your Notion API token in the NOTION_TOKEN variable in your server.js file:

const NOTION_TOKEN = '여기에_노션_API_토큰_입력';
  1. If necessary, you can run it on a different port by modifying the PORT variable.

API Features

Search API

  • POST /api/search : Search pages and databases within your Notion workspace.

Database API

  • POST /api/databases : Create a database

  • GET /api/databases/:id : Query database

  • PATCH /api/databases/:id : Update database

  • POST /api/databases/:id/query : Database query

Page API

  • POST /api/pages : Create a page

  • GET /api/pages/:id : View page information

  • PATCH /api/pages/:id : Update page

  • GET /api/pages/:page_id/properties/:property_id : View page properties

Block API

  • GET /api/blocks/:id : Block query

  • GET /api/blocks/:id/children : View block contents

  • PATCH /api/blocks/:id : Update block

  • PATCH /api/blocks/:id/children : Add block content

  • DELETE /api/blocks/:id : Delete block

User API

  • GET /api/users : View user list

  • GET /api/users/:id : User search

  • GET /api/users/me : View your own user information

Comment API

  • POST /api/comments : Create a comment

  • GET /api/comments?block_id=... : View comments

Cursor MCP Integration

  1. Add the following settings to .cursor/mcp.json file:

{ "mcpServers": { "customApi": { "url": "http://localhost:3000", "toolNameStrategy": "url-path-segments" } } }
  1. You can access the Notion API using MCP functions in Cursor while the server is running.

Usage examples

Example search request

// 페이지 검색 fetch('http://localhost:3000/api/search', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ filter: { value: "page", property: "object" } }) }) .then(response => response.json()) .then(data => console.log(data));

Page creation example

// 새 페이지 생성 fetch('http://localhost:3000/api/pages', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ parent: { page_id: "페이지_ID" }, properties: { title: { title: [ { text: { content: "새 페이지 제목" } } ] } } }) }) .then(response => response.json()) .then(data => console.log(data));

Example of creating a database

// 데이터베이스 생성 fetch('http://localhost:3000/api/databases', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ parent: { type: "page_id", page_id: "페이지_ID" }, title: [ { text: { content: "테스트 데이터베이스" } } ], properties: { "이름": { "title": {}, "description": "제목 항목" }, "상태": { "description": "작업 상태", "select": { "options": [ { "name": "진행 중", "color": "blue" }, { "name": "완료", "color": "green" } ] } } } }) }) .then(response => response.json()) .then(data => console.log(data));

API Documentation

The API documentation is available at the following URL when running the server:

-
security - not tested
F
license - not found
-
quality - not tested

Related MCP Servers

  • A
    security
    A
    license
    A
    quality
    MCP Server for the Notion API, enabling Claude to interact with Notion workspaces.
    Last updated -
    18
    429
    836
    MIT License
  • A
    security
    F
    license
    A
    quality
    A high-performance MCP server that integrates Notion into AI workflows, enabling interaction with Notion pages, databases, and comments through a standardized protocol.
    Last updated -
    19
    25
  • A
    security
    A
    license
    A
    quality
    Notion MCP Server is a MCP server implementation that enables AI assistants to interact with Notion's API.
    Last updated -
    13
    205
    138
    MIT License
  • A
    security
    A
    license
    A
    quality
    An MCP server that enables AI assistants to interact with the Notion API, allowing them to search, read, comment on, and create content in Notion workspaces through natural language commands.
    Last updated -
    6
    19
    15,863
    3,490
    MIT License
    • Apple

View all related MCP servers

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/HariFatherKR/notion_mcp_server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server