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
- Install required packages:
- Running the server:
- The server runs at http://localhost:3000 .
How to set up
- Set your Notion API token in the
NOTION_TOKEN
variable in your server.js file:
- 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 databaseGET /api/databases/:id
: Query databasePATCH /api/databases/:id
: Update databasePOST /api/databases/:id/query
: Database query
Page API
POST /api/pages
: Create a pageGET /api/pages/:id
: View page informationPATCH /api/pages/:id
: Update pageGET /api/pages/:page_id/properties/:property_id
: View page properties
Block API
GET /api/blocks/:id
: Block queryGET /api/blocks/:id/children
: View block contentsPATCH /api/blocks/:id
: Update blockPATCH /api/blocks/:id/children
: Add block contentDELETE /api/blocks/:id
: Delete block
User API
GET /api/users
: View user listGET /api/users/:id
: User searchGET /api/users/me
: View your own user information
Comment API
POST /api/comments
: Create a commentGET /api/comments?block_id=...
: View comments
Cursor MCP Integration
- Add the following settings to
.cursor/mcp.json
file:
- You can access the Notion API using MCP functions in Cursor while the server is running.
Usage examples
Example search request
Page creation example
Example of creating a database
API Documentation
The API documentation is available at the following URL when running the server:
- Swagger UI: http://localhost:3000/api-docs
- OpenAPI schema: http://localhost:3000/openapi.json
This server cannot be installed
A custom server that provides a REST API interface for Notion, allowing easy access to Notion's functionality through Cursor's MCP feature.
Related MCP Servers
- AsecurityAlicenseAqualityMCP Server for the Notion API, enabling Claude to interact with Notion workspaces.Last updated -181,398699TypeScriptMIT License
- -securityFlicense-qualityEnables 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 -4117TypeScript
- -securityAlicense-qualityA 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 -95PythonMIT License
- AsecurityAlicenseAqualityNotion MCP Server is a MCP server implementation that enables AI assistants to interact with Notion's API.Last updated -1327591TypeScriptMIT License