Skip to main content
Glama

Servidor API de Notion

Vídeo de referencia

Vídeo sobre cómo utilizar Notion MCP

Un servidor personalizado para facilitar el uso de la API de Notion. Se implementa utilizando Express.js y expone varias características de la API de Notion como una API REST.

Related MCP server: Notion MCP Server

Cómo instalar

  1. Instalar los paquetes necesarios:

npm install express cors @notionhq/client swagger-jsdoc swagger-ui-express
  1. Ejecutando el servidor:

node server.js
  1. El servidor se ejecuta en http://localhost:3000 .

Cómo configurar

  1. Establezca su token de API de Notion en la variable NOTION_TOKEN en su archivo server.js:

const NOTION_TOKEN = '여기에_노션_API_토큰_입력';
  1. Si es necesario, puede ejecutarlo en un puerto diferente modificando la variable PORT.

Características de la API

API de búsqueda

  • POST /api/search : busca páginas y bases de datos dentro de tu espacio de trabajo de Notion.

API de base de datos

  • POST /api/databases : Crear una base de datos

  • GET /api/databases/:id : Consultar base de datos

  • PATCH /api/databases/:id : Actualizar la base de datos

  • POST /api/databases/:id/query : Consulta de base de datos

API de página

  • POST /api/pages : Crear una página

  • GET /api/pages/:id : Ver información de la página

  • PATCH /api/pages/:id : Actualizar página

  • GET /api/pages/:page_id/properties/:property_id : Ver propiedades de la página

API de bloque

  • GET /api/blocks/:id : Consulta de bloque

  • GET /api/blocks/:id/children : Ver el contenido del bloque

  • PATCH /api/blocks/:id : Actualizar bloque

  • PATCH /api/blocks/:id/children : Agregar contenido del bloque

  • DELETE /api/blocks/:id : Eliminar bloque

API de usuario

  • GET /api/users : Ver lista de usuarios

  • GET /api/users/:id : Búsqueda de usuarios

  • GET /api/users/me : Ver su propia información de usuario

API de comentarios

  • POST /api/comments : Crear un comentario

  • GET /api/comments?block_id=... : Ver comentarios

Integración de Cursor MCP

  1. Agregue las siguientes configuraciones a .cursor/mcp.json :

{
  "mcpServers": {
    "customApi": {
      "url": "http://localhost:3000",
      "toolNameStrategy": "url-path-segments"
    }
  }
}
  1. Puede acceder a la API de Notion utilizando funciones MCP en Cursor mientras el servidor está en ejecución.

Ejemplos de uso

Ejemplo de solicitud de búsqueda

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

Ejemplo de creación de página

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

Ejemplo de creación de una base de datos

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

Documentación de la API

La documentación de la API está disponible en la siguiente URL cuando se ejecuta el servidor:

F
license - not found
Not graded
quality - not tested
D
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    A server that connects to the Notion API and exposes functionality through Claude's Machine Context Protocol, enabling search, retrieval, querying, and creation of Notion pages and databases.
    837
    MIT
  • -
    license
    Not graded
    quality
    Not graded
    maintenance
    An MCP server that enables natural language interaction with the Notion API, allowing users to search, comment, create pages, and access content within their Notion workspace.
    141,622
  • -
    license
    Not graded
    quality
    Not graded
    maintenance
    A Model Context Protocol server that enables AI assistants to interact with Notion's API for reading, creating, and modifying Notion content through natural language interactions.

View all related MCP servers

Related MCP Connectors

  • Markdown-first MCP server for Notion API with 8 composite tools and 39 actions.

  • MCP-native open-source Notion alternative: read & write pages, databases and kanban boards.

  • A basic MCP server to operate on the Postman API.

View all MCP Connectors

Latest Blog Posts

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