Content
# NotionMCP Light
NotionMCP Light is a Model Context Protocol (MCP) server that synchronizes Markdown files and Notion pages using the Notion API.
## Overview
This project was developed to address the inefficiencies of the official Notion Model Context Protocol (MCP) server, which reads and writes Markdown on a block-by-block basis, consuming LLM tokens. It provides an unofficial MCP server that allows direct synchronization of Markdown files and Notion pages/databases via the API without using tokens.
## Features
- **Markdown → Notion**
- Recognizes H1 as the page title
- Creates content from Markdown as a Notion page or database page
- Allows specification of database ID
- Directly uses the Notion API (no tokens used)
- **Notion → Markdown**
- Converts specified page or database page to Markdown format
- Outputs the title as H1
- Transforms block structure into Markdown
- Saves to a file
- **MCP Server Support**
- Complies with Model Context Protocol (MCP)
- Provides endpoints callable from AI tools like Cursor and Cline
- Operates based on JSON-RPC over stdio
## Installation
### Install Dependencies
```bash
pip install -r requirements.txt
```
### Set Up Notion API Token
1. Create an account at [Notion Developers](https://developers.notion.com/) and obtain your API token.
2. Set the token in an environment variable or create a `.env` file to configure it.
```bash
# Example of .env file
NOTION_TOKEN=your_notion_api_token
```
## Usage
### Start the MCP Server
```bash
python -m src.main
```
Alternatively, if you want to specify the token directly:
```bash
python -m src.main --token your_notion_api_token
```
### Configuration for Cline/Cursor
To use NotionMCP Light with AI tools like Cline/Cursor, add the following configuration to the `mcp_settings.json` file:
```json
"notion-mcp-light": {
"command": "uv",
"args": [
"run",
"--directory",
"/path/to/notion-mcp-light",
"python",
"-m",
"src.main"
],
"env": {
"NOTION_TOKEN": "your_notion_api_token"
},
"disabled": false,
"alwaysAllow": []
}
```
Replace `/path/to/notion-mcp-light` with the installation directory of NotionMCP Light.
## Using MCP Tools
NotionMCP Light provides the following MCP tools:
### uploadMarkdown
Uploads a Markdown file and creates it as a Notion page.
```json
{
"jsonrpc": "2.0",
"method": "uploadMarkdown",
"params": {
"filepath": "path/to/markdown.md",
"database_id": "optional_database_id",
"page_id": "optional_parent_page_id"
},
"id": 1
}
```
### downloadMarkdown
Downloads a Notion page and saves it as a Markdown file.
```json
{
"jsonrpc": "2.0",
"method": "downloadMarkdown",
"params": {
"page_id": "notion_page_id",
"output_path": "path/to/output.md"
},
"id": 2
}
```
## License
This project is licensed under the MIT License. For more details, please refer to the [LICENSE](LICENSE) file.