nooon 0.7.0 → 0.8.1
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 +24 -15
- package/dist/index.js +39 -8
- package/package.json +12 -12
package/README.md
CHANGED
|
@@ -8,10 +8,16 @@ Lightweight, read-only Notion MCP Server optimized for token efficiency.
|
|
|
8
8
|
- Minimal output using [TOON format](https://github.com/toon-format/toon)
|
|
9
9
|
- Smart caching based on `last_edited_time`
|
|
10
10
|
- Recursive block fetching in a single call
|
|
11
|
-
- Pre-built binaries for macOS and Linux
|
|
12
11
|
|
|
13
12
|
## Installation
|
|
14
13
|
|
|
14
|
+
```bash
|
|
15
|
+
bunx nooon
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
<details>
|
|
19
|
+
<summary>Manual Install (Pre-built binaries)</summary>
|
|
20
|
+
|
|
15
21
|
Download from [Releases](https://github.com/corrupt952/nooon/releases):
|
|
16
22
|
|
|
17
23
|
```bash
|
|
@@ -28,6 +34,8 @@ curl -L https://github.com/corrupt952/nooon/releases/latest/download/nooon-linux
|
|
|
28
34
|
curl -L https://github.com/corrupt952/nooon/releases/latest/download/nooon-linux-arm64 -o nooon && chmod +x nooon
|
|
29
35
|
```
|
|
30
36
|
|
|
37
|
+
</details>
|
|
38
|
+
|
|
31
39
|
## Authentication
|
|
32
40
|
|
|
33
41
|
Choose one of the following methods:
|
|
@@ -41,8 +49,8 @@ export NOTION_TOKEN=ntn_xxx
|
|
|
41
49
|
**OAuth (Interactive)**
|
|
42
50
|
|
|
43
51
|
```bash
|
|
44
|
-
nooon config --client-id <id> --client-secret <secret>
|
|
45
|
-
nooon auth
|
|
52
|
+
bunx nooon config --client-id <id> --client-secret <secret>
|
|
53
|
+
bunx nooon auth
|
|
46
54
|
```
|
|
47
55
|
|
|
48
56
|
Get credentials from [Notion Integrations](https://www.notion.so/my-integrations).
|
|
@@ -52,13 +60,13 @@ Get credentials from [Notion Integrations](https://www.notion.so/my-integrations
|
|
|
52
60
|
Register with Claude Code:
|
|
53
61
|
|
|
54
62
|
```bash
|
|
55
|
-
eval $(nooon mcp install)
|
|
63
|
+
eval $(bunx nooon mcp install)
|
|
56
64
|
```
|
|
57
65
|
|
|
58
66
|
Check status:
|
|
59
67
|
|
|
60
68
|
```bash
|
|
61
|
-
nooon status
|
|
69
|
+
bunx nooon status
|
|
62
70
|
```
|
|
63
71
|
|
|
64
72
|
## MCP Tools
|
|
@@ -67,21 +75,22 @@ nooon status
|
|
|
67
75
|
|------|-------------|
|
|
68
76
|
| `nooon_search` | Search pages and databases by keyword |
|
|
69
77
|
| `nooon_page` | Get page content with nested blocks (cached) |
|
|
70
|
-
| `nooon_database` | Get database schema |
|
|
78
|
+
| `nooon_database` | Get database schema and available views |
|
|
79
|
+
| `nooon_data_source` | Get data source schema (property definitions) |
|
|
71
80
|
| `nooon_query` | Query database with filter/sort |
|
|
72
81
|
| `nooon_clear_cache` | Clear cached pages |
|
|
73
82
|
|
|
74
83
|
## CLI Reference
|
|
75
84
|
|
|
76
85
|
```
|
|
77
|
-
nooon auth Start OAuth flow
|
|
78
|
-
nooon logout Clear credentials
|
|
79
|
-
nooon status Show auth status
|
|
80
|
-
nooon config Configure OAuth credentials
|
|
81
|
-
nooon cache clear Clear page cache
|
|
82
|
-
nooon mcp Start MCP server
|
|
83
|
-
nooon mcp install Output claude mcp add command
|
|
84
|
-
nooon mcp config Output mcpServers JSON
|
|
86
|
+
bunx nooon auth Start OAuth flow
|
|
87
|
+
bunx nooon logout Clear credentials
|
|
88
|
+
bunx nooon status Show auth status
|
|
89
|
+
bunx nooon config Configure OAuth credentials
|
|
90
|
+
bunx nooon cache clear Clear page cache
|
|
91
|
+
bunx nooon mcp Start MCP server
|
|
92
|
+
bunx nooon mcp install Output claude mcp add command
|
|
93
|
+
bunx nooon mcp config Output mcpServers JSON
|
|
85
94
|
```
|
|
86
95
|
|
|
87
96
|
## Building from Source
|
|
@@ -91,7 +100,7 @@ bun install
|
|
|
91
100
|
bun run compile
|
|
92
101
|
```
|
|
93
102
|
|
|
94
|
-
For team distribution (users only need to run `nooon auth`, no integration setup required):
|
|
103
|
+
For team distribution (users only need to run `bunx nooon auth`, no integration setup required):
|
|
95
104
|
|
|
96
105
|
```bash
|
|
97
106
|
NOTION_CLIENT_ID=xxx NOTION_CLIENT_SECRET=xxx bun run compile
|
package/dist/index.js
CHANGED
|
@@ -30517,10 +30517,10 @@ ${text}
|
|
|
30517
30517
|
result = block.url || "";
|
|
30518
30518
|
break;
|
|
30519
30519
|
case "child_page":
|
|
30520
|
-
result = `\uD83D\uDCC4 ${block.title}`;
|
|
30520
|
+
result = `\uD83D\uDCC4 ${block.title} (${block.id})`;
|
|
30521
30521
|
break;
|
|
30522
30522
|
case "child_database":
|
|
30523
|
-
result = `\uD83D\uDCCA ${block.title}`;
|
|
30523
|
+
result = `\uD83D\uDCCA ${block.title} (${block.id})`;
|
|
30524
30524
|
break;
|
|
30525
30525
|
default:
|
|
30526
30526
|
result = text || "";
|
|
@@ -30534,10 +30534,29 @@ ${children}`;
|
|
|
30534
30534
|
}
|
|
30535
30535
|
return result;
|
|
30536
30536
|
}
|
|
30537
|
+
var LIST_BLOCK_TYPES = new Set([
|
|
30538
|
+
"bulleted_list_item",
|
|
30539
|
+
"numbered_list_item",
|
|
30540
|
+
"to_do",
|
|
30541
|
+
"toggle"
|
|
30542
|
+
]);
|
|
30537
30543
|
function blocksToMarkdown(blocks) {
|
|
30538
|
-
|
|
30544
|
+
if (blocks.length === 0)
|
|
30545
|
+
return "";
|
|
30546
|
+
const parts = [];
|
|
30547
|
+
for (let i = 0;i < blocks.length; i++) {
|
|
30548
|
+
if (i > 0) {
|
|
30549
|
+
const prev = blocks[i - 1];
|
|
30550
|
+
const curr = blocks[i];
|
|
30551
|
+
const sep = LIST_BLOCK_TYPES.has(prev.type) && LIST_BLOCK_TYPES.has(curr.type) ? `
|
|
30552
|
+
` : `
|
|
30539
30553
|
|
|
30540
|
-
|
|
30554
|
+
`;
|
|
30555
|
+
parts.push(sep);
|
|
30556
|
+
}
|
|
30557
|
+
parts.push(blockToMarkdown(blocks[i]));
|
|
30558
|
+
}
|
|
30559
|
+
return parts.join("");
|
|
30541
30560
|
}
|
|
30542
30561
|
function propertyValueToYaml(value, indent = "") {
|
|
30543
30562
|
if (value === null)
|
|
@@ -30602,6 +30621,11 @@ ${content}`;
|
|
|
30602
30621
|
}
|
|
30603
30622
|
};
|
|
30604
30623
|
// src/formatters/toon.ts
|
|
30624
|
+
function extractLinks(richText) {
|
|
30625
|
+
if (!richText)
|
|
30626
|
+
return [];
|
|
30627
|
+
return richText.filter((item) => item.href).map((item) => ({ text: item.text, href: item.href }));
|
|
30628
|
+
}
|
|
30605
30629
|
function richTextToPlain(richText) {
|
|
30606
30630
|
if (!richText)
|
|
30607
30631
|
return "";
|
|
@@ -30609,8 +30633,15 @@ function richTextToPlain(richText) {
|
|
|
30609
30633
|
}
|
|
30610
30634
|
function blockToToon(block) {
|
|
30611
30635
|
const result = { type: block.type };
|
|
30636
|
+
if (block.id) {
|
|
30637
|
+
result.id = block.id;
|
|
30638
|
+
}
|
|
30612
30639
|
if (block.richText) {
|
|
30613
30640
|
result.text = richTextToPlain(block.richText);
|
|
30641
|
+
const links = extractLinks(block.richText);
|
|
30642
|
+
if (links.length > 0) {
|
|
30643
|
+
result.links = links;
|
|
30644
|
+
}
|
|
30614
30645
|
}
|
|
30615
30646
|
if (block.checked !== undefined) {
|
|
30616
30647
|
result.checked = block.checked;
|
|
@@ -31153,9 +31184,9 @@ function slimBlock(block) {
|
|
|
31153
31184
|
case "template":
|
|
31154
31185
|
return base;
|
|
31155
31186
|
case "child_page":
|
|
31156
|
-
return { ...base, title: block.child_page.title };
|
|
31187
|
+
return { ...base, id: block.id, title: block.child_page.title };
|
|
31157
31188
|
case "child_database":
|
|
31158
|
-
return { ...base, title: block.child_database.title };
|
|
31189
|
+
return { ...base, id: block.id, title: block.child_database.title };
|
|
31159
31190
|
default:
|
|
31160
31191
|
return base;
|
|
31161
31192
|
}
|
|
@@ -31257,7 +31288,7 @@ function parseSorts(json2) {
|
|
|
31257
31288
|
// src/mcp.ts
|
|
31258
31289
|
var server = new McpServer({
|
|
31259
31290
|
name: "nooon",
|
|
31260
|
-
version: "0.
|
|
31291
|
+
version: "0.8.0"
|
|
31261
31292
|
});
|
|
31262
31293
|
server.tool("nooon_search", "Search Notion pages and databases by keyword. Returns a list of matching items with their IDs and titles. For data_source objects, use nooon_data_source or nooon_query.", {
|
|
31263
31294
|
query: exports_external.string().describe("Search keyword"),
|
|
@@ -31450,7 +31481,7 @@ EXAMPLES:
|
|
|
31450
31481
|
async function main() {
|
|
31451
31482
|
const args = process.argv.slice(2);
|
|
31452
31483
|
if (args.includes("--version") || args.includes("-v")) {
|
|
31453
|
-
console.log("0.
|
|
31484
|
+
console.log("0.8.0");
|
|
31454
31485
|
return;
|
|
31455
31486
|
}
|
|
31456
31487
|
if (args.length === 0 || args.includes("--help") || args.includes("-h")) {
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nooon",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"description": "Lightweight, read-only Notion MCP Server optimized for token efficiency",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
|
-
"nooon": "
|
|
7
|
+
"nooon": "dist/index.js"
|
|
8
8
|
},
|
|
9
9
|
"files": [
|
|
10
10
|
"dist"
|
|
@@ -26,6 +26,15 @@
|
|
|
26
26
|
"url": "https://github.com/corrupt952/nooon/issues"
|
|
27
27
|
},
|
|
28
28
|
"homepage": "https://github.com/corrupt952/nooon#readme",
|
|
29
|
+
"scripts": {
|
|
30
|
+
"build": "bun build src/index.ts --outdir dist --target bun --define \"PKG_VERSION='$(jq -r .version package.json)'\"",
|
|
31
|
+
"compile": "bun build --compile src/index.ts --outfile nooon --define \"PKG_VERSION='$(jq -r .version package.json)'\" --define \"__EMBEDDED_CLIENT_ID__='$NOTION_CLIENT_ID'\" --define \"__EMBEDDED_CLIENT_SECRET__='$NOTION_CLIENT_SECRET'\"",
|
|
32
|
+
"dev": "bun run src/index.ts",
|
|
33
|
+
"lint": "biome check .",
|
|
34
|
+
"lint:fix": "biome check --write .",
|
|
35
|
+
"format": "biome format --write .",
|
|
36
|
+
"test": "bun test"
|
|
37
|
+
},
|
|
29
38
|
"dependencies": {
|
|
30
39
|
"@modelcontextprotocol/sdk": "^1.25.3",
|
|
31
40
|
"@notionhq/client": "^5.0.0",
|
|
@@ -37,14 +46,5 @@
|
|
|
37
46
|
"@biomejs/biome": "2.3.13",
|
|
38
47
|
"@types/bun": "^1.1.14",
|
|
39
48
|
"typescript": "^5.7.2"
|
|
40
|
-
},
|
|
41
|
-
"scripts": {
|
|
42
|
-
"build": "bun build src/index.ts --outdir dist --target bun --define \"PKG_VERSION='$(jq -r .version package.json)'\"",
|
|
43
|
-
"compile": "bun build --compile src/index.ts --outfile nooon --define \"PKG_VERSION='$(jq -r .version package.json)'\" --define \"__EMBEDDED_CLIENT_ID__='$NOTION_CLIENT_ID'\" --define \"__EMBEDDED_CLIENT_SECRET__='$NOTION_CLIENT_SECRET'\"",
|
|
44
|
-
"dev": "bun run src/index.ts",
|
|
45
|
-
"lint": "biome check .",
|
|
46
|
-
"lint:fix": "biome check --write .",
|
|
47
|
-
"format": "biome format --write .",
|
|
48
|
-
"test": "bun test"
|
|
49
49
|
}
|
|
50
|
-
}
|
|
50
|
+
}
|