improved-notion-mcp 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +125 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +693 -0
- package/dist/index.js.map +1 -0
- package/improved-notion-mcp.zip +0 -0
- package/package.json +33 -0
- package/src/index.ts +752 -0
- package/tsconfig.json +21 -0
package/README.md
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
# Improved Notion MCP Server
|
|
2
|
+
|
|
3
|
+
An enhanced Notion MCP server with better markdown conversion and composite tools for AI agents.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Token Optimization** - All read operations return markdown instead of raw JSON (~80% token reduction)
|
|
8
|
+
- **Composite Tools** - Batch operations, append content, create pages with content in one call
|
|
9
|
+
- **Full Notion API Coverage** - Search, CRUD operations, database queries, user listing
|
|
10
|
+
- **TypeScript** - Full type safety and modern tooling
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm install improved-notion-mcp
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Configuration
|
|
19
|
+
|
|
20
|
+
Set your Notion API token:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
export NOTION_TOKEN=your_notion_integration_token
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Or use `NOTION_API_KEY` as an alternative.
|
|
27
|
+
|
|
28
|
+
## Usage
|
|
29
|
+
|
|
30
|
+
### CLI
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
npx improved-notion-mcp
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Claude Desktop
|
|
37
|
+
|
|
38
|
+
Add to your `claude_desktop_config.json`:
|
|
39
|
+
|
|
40
|
+
```json
|
|
41
|
+
{
|
|
42
|
+
"mcpServers": {
|
|
43
|
+
"improved-notion-mcp": {
|
|
44
|
+
"command": "npx",
|
|
45
|
+
"args": ["-y", "improved-notion-mcp"],
|
|
46
|
+
"env": {
|
|
47
|
+
"NOTION_TOKEN": "your_token_here"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### Cursor
|
|
55
|
+
|
|
56
|
+
Add to your Cursor MCP settings:
|
|
57
|
+
|
|
58
|
+
```json
|
|
59
|
+
{
|
|
60
|
+
"mcpServers": {
|
|
61
|
+
"improved-notion-mcp": {
|
|
62
|
+
"command": "npx",
|
|
63
|
+
"args": ["-y", "improved-notion-mcp"],
|
|
64
|
+
"env": {
|
|
65
|
+
"NOTION_TOKEN": "your_token_here"
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Tools
|
|
73
|
+
|
|
74
|
+
### Search & Discovery
|
|
75
|
+
- `notion_search` - Search pages and databases
|
|
76
|
+
- `notion_list_databases` - List all accessible databases
|
|
77
|
+
- `notion_list_users` - List workspace users
|
|
78
|
+
|
|
79
|
+
### Read Operations (Token-Optimized)
|
|
80
|
+
- `notion_get_page` - Get page content as markdown (~80% fewer tokens)
|
|
81
|
+
- `notion_get_database_schema` - Get database schema/properties
|
|
82
|
+
- `notion_query_database` - Query database with filters
|
|
83
|
+
|
|
84
|
+
### Write Operations
|
|
85
|
+
- `notion_create_page` - Create a new page (optionally with content)
|
|
86
|
+
- `notion_create_database_entry` - Create database entry
|
|
87
|
+
- `notion_update_page` - Update page properties or content
|
|
88
|
+
- `notion_append_content` - Append markdown to existing page
|
|
89
|
+
|
|
90
|
+
### Batch Operations
|
|
91
|
+
- `notion_batch_create` - Create multiple pages at once
|
|
92
|
+
|
|
93
|
+
### Delete Operations
|
|
94
|
+
- `notion_delete_page` - Archive a page
|
|
95
|
+
|
|
96
|
+
## Token Optimization
|
|
97
|
+
|
|
98
|
+
The official Notion MCP returns raw JSON from the API, which includes lots of metadata that AI agents don't need. This server:
|
|
99
|
+
|
|
100
|
+
1. Converts all page content to markdown
|
|
101
|
+
2. Formats properties as readable key-value pairs
|
|
102
|
+
3. Strips unnecessary metadata
|
|
103
|
+
|
|
104
|
+
**Result**: ~80% reduction in token usage for typical operations.
|
|
105
|
+
|
|
106
|
+
## Comparison
|
|
107
|
+
|
|
108
|
+
| Feature | Official Notion MCP | This Server |
|
|
109
|
+
|---------|-------------------|-------------|
|
|
110
|
+
| Token usage | High (raw JSON) | Low (markdown) |
|
|
111
|
+
| Composite tools | Limited | Batch create, append |
|
|
112
|
+
| Block types | 15 | 20+ |
|
|
113
|
+
| Tools | ~20 auto-generated | 12 focused |
|
|
114
|
+
|
|
115
|
+
## Development
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
npm run dev # Development mode
|
|
119
|
+
npm run build # Build for production
|
|
120
|
+
npm start # Run production build
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## License
|
|
124
|
+
|
|
125
|
+
MIT
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|