notion-mcp-slim
# notion-mcp-slim
An MCP (Model Context Protocol) proxy server that converts Notion API JSON responses to slim Markdown format, saving approximately **90%** of token consumption.
> **Note**: This is an unofficial community project, not affiliated with Notion.
[繁體中文](README.zh-TW.md)
## Architecture
```
Claude ←→ notion-mcp-slim (Proxy) ←→ Notion API
↓
Transformer
(JSON → Markdown)
```
## Features
- **Read Operations**: Converts JSON to human-readable Markdown format
- **Write Operations**: Slim responses to success/failure + key IDs
- **UUID Compression**: Automatically compresses long UUIDs to short codes
- **Full API Support**: Search, Pages, Blocks, Databases, Users, Comments
## Installation
```bash
npm install
npm run build
```
## Configuration
Set environment variable (choose one):
```bash
export NOTION_API_KEY="your-notion-api-key"
# or
export NOTION_API_KEY_Claude="your-notion-api-key"
```
## Usage
### Claude Desktop Configuration
Add to `claude_desktop_config.json`:
```json
{
"mcpServers": {
"notion-mcp-slim": {
"command": "node",
"args": ["/path/to/notion-mcp-slim/dist/index.js"],
"env": {
"NOTION_API_KEY": "your-notion-api-key"
}
}
}
}
```
### Direct Execution
```bash
npm start
```
## Supported Tools
| Tool | Description |
|------|-------------|
| `API-post-search` | Search pages and databases |
| `API-retrieve-a-page` | Get page information |
| `API-get-block-children` | Get block children (supports recursion) |
| `API-post-page` | Create a page |
| `API-patch-page` | Update a page |
| `API-retrieve-a-page-property` | Get page property |
| `replace-page-content` | Replace entire page content |
| `API-retrieve-a-block` | Get a single block |
| `API-update-a-block` | Update a block |
| `API-delete-a-block` | Delete a block |
| `API-patch-block-children` | Append child blocks |
| `API-post-database-query` | Query a database |
| `API-retrieve-a-database` | Get database schema |
| `API-create-a-database` | Create a database |
| `API-update-a-database` | Update a database |
| `API-get-user` | Get user information |
| `API-get-users` | List all users |
| `API-get-self` | Get current bot information |
| `API-retrieve-a-comment` | Get comments |
| `API-create-a-comment` | Create a comment |
## Token Savings
| Metric | Original JSON | Converted Markdown |
|--------|---------------|-------------------|
| Single page tokens | ~14,000 | ~1,400 |
| Savings ratio | - | **90%** |
## Development
```bash
# Watch mode compilation
npm run dev
# Run tests
npm test
# Watch mode tests
npm run test:watch
```
## Security Notes
- API Key is stored only in local environment variables, not sent to any third-party services
- This tool runs purely locally and does not collect any user data
- Please keep your Notion API Key secure and never commit it to version control
## Disclaimer
- This is an **unofficial** community project, not affiliated with Notion, Inc.
- This software is provided "as is" without any express or implied warranties
- Users assume all risks of using this tool, including but not limited to data security risks
- The author is not responsible for any direct or indirect data loss, damage, or other losses
- Compatibility with future versions of Notion API is not guaranteed
- Please read the [Notion API Terms of Use](https://developers.notion.com) before use
## License
[MIT License](LICENSE)
TDQS
Scored across 20 tools
Each tool maps to a distinct Notion resource+action (block, page, database, user, comment, search), so boundaries are mostly clear. Minor overlap exists between the composite replace-page-content and the block-level patch/delete tools, and between get-block-children and retrieve-a-block, but descriptions make the intended use apparent.
Most tools follow an 'API-<httpverb>-<resource>' pattern, but the read verbs are inconsistent (get-block-children / get-user / get-users vs retrieve-a-page / retrieve-a-block / retrieve-a-database), and replace-page-content breaks the convention entirely with a different prefix and verb style. It remains readable but is not a predictable pattern.
20 tools is on the heavy side but each corresponds to a real, distinct Notion API endpoint, so the surface is well-scoped rather than padded. A slightly smaller set could be achieved by folding the composite replace-page-content into existing block tools.
Coverage is strong: full block CRUD, page create/retrieve/update, database create/retrieve/update/query, user and comment reads plus comment creation, and a bulk page-content replacement helper. Gaps are minor (no explicit page archive/delete tool, no comment deletion), and most can be worked around via update-page or are unsupported by the upstream API.