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サーバー

リファレンスビデオ

Notion APIを使いやすくするためのカスタムサーバーです。 Express.jsを使用して実装されており、Notion APIのさまざまな機能をREST APIとして提供しています。

インストール方法

  1. 必要なパッケージのインストール:
npm install express cors @notionhq/client swagger-jsdoc swagger-ui-express
  1. サーバーの実行:
node server.js
  1. サーバーは http://localhost:3000で実行されます。

設定方法

  1. server.jsファイルのNOTION_TOKEN変数にNotion APIトークンを設定します。
const NOTION_TOKEN = '여기에_노션_API_토큰_입력';
  1. 必要に応じて、PORT変数を変更して別のポートで実行できます。

API機能

検索API

  • POST /api/search : ノッションワークスペース内のページとデータベースの検索

データベースAPI

  • POST /api/databases : データベースの作成
  • GET /api/databases/:id : データベース照会
  • PATCH /api/databases/:id : データベースの更新
  • POST /api/databases/:id/query : データベースクエリ

ページAPI

  • POST /api/pages : ページの生成
  • GET /api/pages/:id : ページ情報の照会
  • PATCH /api/pages/:id : ページの更新
  • GET /api/pages/:page_id/properties/:property_id : ページ属性の検索

Block API

  • GET /api/blocks/:id : ブロック照会
  • GET /api/blocks/:id/children : ブロック内容の照会
  • PATCH /api/blocks/:id : ブロック更新
  • PATCH /api/blocks/:id/children : ブロック内容の追加
  • DELETE /api/blocks/:id : ブロックの削除

ユーザーAPI

  • GET /api/users : ユーザーリストの検索
  • GET /api/users/:id : ユーザー検索
  • GET /api/users/me :自分のユーザー情報を検索する

コメントAPI

  • POST /api/comments : コメントの生成
  • GET /api/comments?block_id=... : コメントの照会

Cursor MCP統合

  1. .cursor/mcp.jsonファイルに次の設定を追加します。
{ "mcpServers": { "customApi": { "url": "http://localhost:3000", "toolNameStrategy": "url-path-segments" } } }
  1. サーバーの実行中にCursorのMCP機能を使用してNotion APIにアクセスできます。

使用例

検索リクエストの例

// 페이지 검색 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));

ページ生成の例

// 새 페이지 생성 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));

データベース生成の例

// 데이터베이스 생성 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ドキュメント

API ドキュメントは、サーバーの実行時に次の URL で確認できます。

-
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. リファレンスビデオ
    1. インストール方法
      1. 設定方法
        1. API機能
          1. 検索API
          2. データベースAPI
          3. ページAPI
          4. Block API
          5. ユーザーAPI
          6. コメントAPI
        2. Cursor MCP統合
          1. 使用例
            1. 検索リクエストの例
            2. ページ生成の例
            3. データベース生成の例
          2. APIドキュメント

            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