Notion MCP Server

by HariFatherKR
Integrations
  • Provides a REST API interface for interacting with Notion's API, allowing for searching, database operations (creation, querying, updating), page management, block manipulation, user information retrieval, and comment functionality.

  • Integrates Swagger UI to provide interactive API documentation, available at the /api-docs endpoint with OpenAPI schema accessible at /openapi.json.

Notion API Server

Reference video

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

A custom server that provides a REST API interface for Notion, allowing easy access to Notion's functionality through Cursor's MCP feature.

  1. Reference video
    1. How to install
      1. How to set up
        1. API Features
          1. Search API
          2. Database API
          3. Page API
          4. Block API
          5. User API
          6. Comment API
        2. Cursor MCP Integration
          1. Usage examples
            1. Example search request
            2. Page creation example
            3. Example of creating a database
          2. API Documentation

            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
              1,398
              699
              TypeScript
              MIT License
            • -
              security
              F
              license
              -
              quality
              Enables interaction with Notion through the Notion API by exposing it as tools for LLMs, allowing operations like reading, creating, updating, and deleting Notion pages seamlessly via natural language.
              Last updated -
              41
              17
              TypeScript
            • -
              security
              A
              license
              -
              quality
              A Model Context Protocol server that provides a standardized interface for interacting with Notion's API, enabling users to list databases, create pages, and search across their Notion workspace.
              Last updated -
              95
              Python
              MIT License
              • Apple
            • 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
              275
              91
              TypeScript
              MIT License

            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