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

Referenzvideo

Ein benutzerdefinierter Server zur einfachen Verwendung der Notion-API. Es wird mit Express.js implementiert und stellt verschiedene Funktionen der Notion-API als REST-API bereit.

So installieren Sie

  1. Installieren Sie die erforderlichen Pakete:
npm install express cors @notionhq/client swagger-jsdoc swagger-ui-express
  1. Ausführen des Servers:
node server.js
  1. Der Server läuft unter http://localhost:3000 .

So richten Sie ein

  1. Legen Sie Ihr Notion-API-Token in der Variable NOTION_TOKEN in Ihrer Datei server.js fest:
const NOTION_TOKEN = '여기에_노션_API_토큰_입력';
  1. Bei Bedarf können Sie es auf einem anderen Port ausführen, indem Sie die PORT-Variable ändern.

API-Funktionen

Such-API

  • POST /api/search : Durchsuchen Sie Seiten und Datenbanken in Ihrem Notion-Arbeitsbereich.

Datenbank-API

  • POST /api/databases : Erstellen Sie eine Datenbank
  • GET /api/databases/:id : Datenbank abfragen
  • PATCH /api/databases/:id : Datenbank aktualisieren
  • POST /api/databases/:id/query : Datenbankabfrage

Seiten-API

  • POST /api/pages : Eine Seite erstellen
  • GET /api/pages/:id : Seiteninformationen anzeigen
  • PATCH /api/pages/:id : Seite aktualisieren
  • GET /api/pages/:page_id/properties/:property_id : Seiteneigenschaften anzeigen

Block-API

  • GET /api/blocks/:id Blockabfrage
  • GET /api/blocks/:id/children : Blockinhalte anzeigen
  • PATCH /api/blocks/:id : Block aktualisieren
  • PATCH /api/blocks/:id/children : Blockinhalt hinzufügen
  • DELETE /api/blocks/:id : Block löschen

Benutzer-API

  • GET /api/users : Benutzerliste anzeigen
  • GET /api/users/:id : Benutzersuche
  • GET /api/users/me : Zeigen Sie Ihre eigenen Benutzerinformationen an

Kommentar-API

  • POST /api/comments : Einen Kommentar erstellen
  • GET /api/comments?block_id=... : Kommentare anzeigen

Cursor MCP-Integration

  1. Fügen Sie .cursor/mcp.json die folgenden Einstellungen hinzu:
{ "mcpServers": { "customApi": { "url": "http://localhost:3000", "toolNameStrategy": "url-path-segments" } } }
  1. Sie können mithilfe von MCP-Funktionen in Cursor auf die Notion-API zugreifen, während der Server läuft.

Anwendungsbeispiele

Beispiel einer Suchanfrage

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

Beispiel für die Seitenerstellung

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

Beispiel für das Erstellen einer Datenbank

// 데이터베이스 생성 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-Dokumentation

Die API-Dokumentation ist beim Ausführen des Servers unter der folgenden URL verfügbar:

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

Ein benutzerdefinierter Server, der eine REST-API-Schnittstelle für Notion bereitstellt und über die MCP-Funktion von Cursor einen einfachen Zugriff auf die Funktionen von Notion ermöglicht.

  1. Referenzvideo
    1. So installieren Sie
      1. So richten Sie ein
        1. API-Funktionen
          1. Such-API
          2. Datenbank-API
          3. Seiten-API
          4. Block-API
          5. Benutzer-API
          6. Kommentar-API
        2. Cursor MCP-Integration
          1. Anwendungsbeispiele
            1. Beispiel einer Suchanfrage
            2. Beispiel für die Seitenerstellung
            3. Beispiel für das Erstellen einer Datenbank
          2. API-Dokumentation

            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