@n24q02m/better-notion-mcp 2.20.0 → 2.21.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 +88 -57
- package/bin/cli.mjs +18 -14
- package/build/src/init-server.test.js +3 -0
- package/build/src/init-server.test.js.map +1 -1
- package/build/src/relay-schema.d.ts +9 -0
- package/build/src/relay-schema.d.ts.map +1 -0
- package/build/src/relay-schema.js +22 -0
- package/build/src/relay-schema.js.map +1 -0
- package/build/src/relay-setup.d.ts +22 -0
- package/build/src/relay-setup.d.ts.map +1 -0
- package/build/src/relay-setup.js +62 -0
- package/build/src/relay-setup.js.map +1 -0
- package/build/src/relay-setup.test.d.ts +2 -0
- package/build/src/relay-setup.test.d.ts.map +1 -0
- package/build/src/relay-setup.test.js +101 -0
- package/build/src/relay-setup.test.js.map +1 -0
- package/build/src/transports/stdio.d.ts +1 -1
- package/build/src/transports/stdio.d.ts.map +1 -1
- package/build/src/transports/stdio.js +10 -2
- package/build/src/transports/stdio.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# Better Notion MCP
|
|
2
2
|
|
|
3
|
+
mcp-name: io.github.n24q02m/better-notion-mcp
|
|
4
|
+
|
|
3
5
|
**Markdown-first Notion API server for AI agents -- 9 composite tools replacing 28+ endpoint calls**
|
|
4
6
|
|
|
5
7
|
<!-- Badge Row 1: Status -->
|
|
@@ -32,11 +34,32 @@
|
|
|
32
34
|
|
|
33
35
|
### Claude Code Plugin (Recommended)
|
|
34
36
|
|
|
37
|
+
Via marketplace (includes skills: /organize-database, /bulk-update):
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
/plugin marketplace add n24q02m/claude-plugins
|
|
41
|
+
/plugin install better-notion-mcp@n24q02m-plugins
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
Plugin uses remote OAuth — no `NOTION_TOKEN` needed. Browser opens for Notion authorization on first use.
|
|
47
|
+
|
|
48
|
+
### Gemini CLI Extension
|
|
49
|
+
|
|
35
50
|
```bash
|
|
36
|
-
|
|
51
|
+
gemini extensions install https://github.com/n24q02m/better-notion-mcp
|
|
37
52
|
```
|
|
38
53
|
|
|
39
|
-
|
|
54
|
+
### Codex CLI
|
|
55
|
+
|
|
56
|
+
Add to `~/.codex/config.toml`:
|
|
57
|
+
|
|
58
|
+
```toml
|
|
59
|
+
[mcp_servers.better-notion-mcp]
|
|
60
|
+
command = "npx"
|
|
61
|
+
args = ["-y", "@n24q02m/better-notion-mcp"]
|
|
62
|
+
```
|
|
40
63
|
|
|
41
64
|
### MCP Server
|
|
42
65
|
|
|
@@ -59,15 +82,20 @@ Connect directly via URL with OAuth authentication. Your MCP client handles the
|
|
|
59
82
|
|
|
60
83
|
Get your token: <https://www.notion.so/my-integrations> -> Create integration -> Copy token -> Share pages
|
|
61
84
|
|
|
85
|
+
Set `NOTION_TOKEN` in `~/.claude/settings.local.json` or your shell profile:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
export NOTION_TOKEN="ntn_..."
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Then add to your MCP client config:
|
|
92
|
+
|
|
62
93
|
```jsonc
|
|
63
94
|
{
|
|
64
95
|
"mcpServers": {
|
|
65
96
|
"better-notion": {
|
|
66
97
|
"command": "npx",
|
|
67
|
-
"args": ["-y", "@n24q02m/better-notion-mcp@latest"]
|
|
68
|
-
"env": {
|
|
69
|
-
"NOTION_TOKEN": "ntn_..."
|
|
70
|
-
}
|
|
98
|
+
"args": ["-y", "@n24q02m/better-notion-mcp@latest"]
|
|
71
99
|
}
|
|
72
100
|
}
|
|
73
101
|
}
|
|
@@ -86,34 +114,12 @@ Other runners: `bun x`, `pnpm dlx`, `yarn dlx` also work.
|
|
|
86
114
|
"run", "-i", "--rm",
|
|
87
115
|
"-e", "NOTION_TOKEN",
|
|
88
116
|
"n24q02m/better-notion-mcp:latest"
|
|
89
|
-
]
|
|
90
|
-
"env": {
|
|
91
|
-
"NOTION_TOKEN": "ntn_..."
|
|
92
|
-
}
|
|
117
|
+
]
|
|
93
118
|
}
|
|
94
119
|
}
|
|
95
120
|
}
|
|
96
121
|
```
|
|
97
122
|
|
|
98
|
-
### Self-Hosting (Remote Mode)
|
|
99
|
-
|
|
100
|
-
You can self-host the remote server with your own Notion OAuth app.
|
|
101
|
-
|
|
102
|
-
**Prerequisites:**
|
|
103
|
-
1. Create a **Public Integration** at <https://www.notion.so/my-integrations>
|
|
104
|
-
2. Set the redirect URI to `https://your-domain.com/callback`
|
|
105
|
-
3. Note your `client_id` and `client_secret`
|
|
106
|
-
|
|
107
|
-
```bash
|
|
108
|
-
docker run -p 8080:8080 \
|
|
109
|
-
-e TRANSPORT_MODE=http \
|
|
110
|
-
-e PUBLIC_URL=https://your-domain.com \
|
|
111
|
-
-e NOTION_OAUTH_CLIENT_ID=your-client-id \
|
|
112
|
-
-e NOTION_OAUTH_CLIENT_SECRET=your-client-secret \
|
|
113
|
-
-e DCR_SERVER_SECRET=$(openssl rand -hex 32) \
|
|
114
|
-
n24q02m/better-notion-mcp:latest
|
|
115
|
-
```
|
|
116
|
-
|
|
117
123
|
## Tools
|
|
118
124
|
|
|
119
125
|
| Tool | Actions | Description |
|
|
@@ -128,6 +134,32 @@ docker run -p 8080:8080 \
|
|
|
128
134
|
| `file_uploads` | `create`, `send`, `complete`, `retrieve`, `list` | Upload files to Notion |
|
|
129
135
|
| `help` | - | Get full documentation for any tool |
|
|
130
136
|
|
|
137
|
+
### MCP Resources
|
|
138
|
+
|
|
139
|
+
| URI | Description |
|
|
140
|
+
|:----|:------------|
|
|
141
|
+
| `notion://docs/pages` | Page operations reference |
|
|
142
|
+
| `notion://docs/databases` | Database operations reference |
|
|
143
|
+
| `notion://docs/blocks` | Block operations reference |
|
|
144
|
+
| `notion://docs/users` | User operations reference |
|
|
145
|
+
| `notion://docs/workspace` | Workspace operations reference |
|
|
146
|
+
| `notion://docs/comments` | Comment operations reference |
|
|
147
|
+
| `notion://docs/content_convert` | Content conversion reference |
|
|
148
|
+
| `notion://docs/file_uploads` | File upload reference |
|
|
149
|
+
|
|
150
|
+
## Zero-Config Setup
|
|
151
|
+
|
|
152
|
+
No environment variables needed. On first start, the server opens a setup page in your browser:
|
|
153
|
+
|
|
154
|
+
1. Start the server (via plugin, `npx`, or Docker)
|
|
155
|
+
2. A setup URL appears -- open it in any browser
|
|
156
|
+
3. Fill in your credentials on the guided form
|
|
157
|
+
4. Credentials are encrypted and stored locally
|
|
158
|
+
|
|
159
|
+
Your credentials never leave your machine. The relay server only sees encrypted data.
|
|
160
|
+
|
|
161
|
+
For CI/automation, you can still use environment variables (see below).
|
|
162
|
+
|
|
131
163
|
## Configuration
|
|
132
164
|
|
|
133
165
|
| Variable | Required | Default | Description |
|
|
@@ -140,41 +172,40 @@ docker run -p 8080:8080 \
|
|
|
140
172
|
| `DCR_SERVER_SECRET` | Yes (http) | - | HMAC secret for stateless client registration |
|
|
141
173
|
| `PORT` | No | `8080` | Server port |
|
|
142
174
|
|
|
143
|
-
|
|
175
|
+
### Self-Hosting (Remote Mode)
|
|
144
176
|
|
|
145
|
-
|
|
146
|
-
git clone https://github.com/n24q02m/better-notion-mcp.git
|
|
147
|
-
cd better-notion-mcp
|
|
148
|
-
npm install
|
|
149
|
-
npm run build
|
|
150
|
-
npm start
|
|
151
|
-
```
|
|
177
|
+
You can self-host the remote server with your own Notion OAuth app.
|
|
152
178
|
|
|
153
|
-
|
|
179
|
+
**Prerequisites:**
|
|
180
|
+
1. Create a **Public Integration** at <https://www.notion.so/my-integrations>
|
|
181
|
+
2. Set the redirect URI to `https://your-domain.com/callback`
|
|
182
|
+
3. Note your `client_id` and `client_secret`
|
|
154
183
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
184
|
+
```bash
|
|
185
|
+
docker run -p 8080:8080 \
|
|
186
|
+
-e TRANSPORT_MODE=http \
|
|
187
|
+
-e PUBLIC_URL=https://your-domain.com \
|
|
188
|
+
-e NOTION_OAUTH_CLIENT_ID=your-client-id \
|
|
189
|
+
-e NOTION_OAUTH_CLIENT_SECRET=your-client-secret \
|
|
190
|
+
-e DCR_SERVER_SECRET=$(openssl rand -hex 32) \
|
|
191
|
+
n24q02m/better-notion-mcp:latest
|
|
192
|
+
```
|
|
163
193
|
|
|
164
|
-
##
|
|
194
|
+
## Security
|
|
165
195
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
| [better-email-mcp](https://github.com/n24q02m/better-email-mcp) | Email (IMAP/SMTP) with multi-account and auto-discovery |
|
|
171
|
-
| [better-godot-mcp](https://github.com/n24q02m/better-godot-mcp) | Godot Engine 4.x with 18 tools for scenes, scripts, and shaders |
|
|
172
|
-
| [better-telegram-mcp](https://github.com/n24q02m/better-telegram-mcp) | Telegram dual-mode (Bot API + MTProto) with 6 composite tools |
|
|
173
|
-
| [better-code-review-graph](https://github.com/n24q02m/better-code-review-graph) | Knowledge graph for token-efficient code reviews |
|
|
196
|
+
- **OAuth 2.1 + PKCE S256** -- Secure authorization with code challenge
|
|
197
|
+
- **Rate limiting** -- 120 req/min/IP on HTTP transport
|
|
198
|
+
- **Session owner binding** -- IP check + TTL for pending token binds
|
|
199
|
+
- **Null safety** -- Handles Notion API quirks (comments.list 404, undefined rich_text)
|
|
174
200
|
|
|
175
|
-
##
|
|
201
|
+
## Build from Source
|
|
176
202
|
|
|
177
|
-
|
|
203
|
+
```bash
|
|
204
|
+
git clone https://github.com/n24q02m/better-notion-mcp.git
|
|
205
|
+
cd better-notion-mcp
|
|
206
|
+
bun install
|
|
207
|
+
bun run dev
|
|
208
|
+
```
|
|
178
209
|
|
|
179
210
|
## License
|
|
180
211
|
|