notion-mcp-cli 0.0.4 → 0.0.6

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.
Files changed (3) hide show
  1. package/README.md +72 -0
  2. package/dist/cli.js +6 -6
  3. package/package.json +5 -4
package/README.md ADDED
@@ -0,0 +1,72 @@
1
+ # notion-mcp-cli
2
+
3
+ CLI for Notion MCP with OAuth support.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install -g notion-mcp-cli
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```bash
14
+ # Login (saves MCP URL, auth happens on first command)
15
+ notion-mcp-cli login
16
+
17
+ # Run any Notion MCP tool
18
+ notion-mcp-cli notion-search --query "meeting notes"
19
+ notion-mcp-cli notion-get-page --pageId "abc123"
20
+
21
+ # Check status
22
+ notion-mcp-cli status
23
+
24
+ # Logout
25
+ notion-mcp-cli logout
26
+ ```
27
+
28
+ ## How it works
29
+
30
+ 1. On first command, opens browser for Notion OAuth
31
+ 2. Caches tools and session for 1 hour
32
+ 3. Auto-refreshes tokens when needed
33
+
34
+ ## Packages
35
+
36
+ This monorepo contains:
37
+
38
+ | Package | Description |
39
+ |---------|-------------|
40
+ | [notion-mcp-cli](./notion-mcp-cli) | CLI for Notion MCP |
41
+ | [@goke/mcp](./mcp) | Generate CLI commands from any MCP server |
42
+ | [goke](./goke) | cac-inspired CLI framework with space-separated subcommands |
43
+
44
+ ## @goke/mcp
45
+
46
+ Use `@goke/mcp` to build your own MCP CLI:
47
+
48
+ ```ts
49
+ import { goke } from 'goke'
50
+ import { addMcpCommands } from '@goke/mcp'
51
+
52
+ const cli = goke('mycli')
53
+
54
+ await addMcpCommands({
55
+ cli,
56
+ commandPrefix: 'mcp',
57
+ getMcpUrl: () => 'https://your-mcp-server.com/mcp',
58
+ oauth: {
59
+ clientName: 'My CLI',
60
+ load: () => loadConfig().oauth,
61
+ save: (state) => saveConfig({ oauth: state }),
62
+ },
63
+ loadCache: () => loadConfig().cache,
64
+ saveCache: (cache) => saveConfig({ cache }),
65
+ })
66
+
67
+ cli.parse()
68
+ ```
69
+
70
+ ## License
71
+
72
+ MIT
package/dist/cli.js CHANGED
@@ -9,8 +9,9 @@
9
9
  * notion-mcp-cli status # Show current config
10
10
  * notion-mcp-cli logout # Clear OAuth tokens
11
11
  */
12
- import { cac } from "@xmorse/cac";
13
- import { addMcpCommands } from "mcpcac";
12
+ import { goke } from "goke";
13
+ import { wrapJsonSchema } from "goke";
14
+ import { addMcpCommands } from "@goke/mcp";
14
15
  import fs from "node:fs";
15
16
  import path from "node:path";
16
17
  import os from "node:os";
@@ -35,11 +36,10 @@ function saveConfig(config) {
35
36
  }
36
37
  fs.writeFileSync(CONFIG_FILE, JSON.stringify(merged, null, 2));
37
38
  }
38
- const cli = cac("notion-mcp-cli");
39
+ const cli = goke("notion-mcp-cli");
39
40
  // Add MCP commands with OAuth support (no prefix - commands are top-level)
40
41
  await addMcpCommands({
41
42
  cli,
42
- commandPrefix: "",
43
43
  clientName: "notion-mcp-cli",
44
44
  getMcpUrl: () => loadConfig().mcpUrl,
45
45
  oauth: {
@@ -57,7 +57,7 @@ await addMcpCommands({
57
57
  // Login command - just saves URL, auth happens on first tool call
58
58
  cli
59
59
  .command("login", "Save MCP URL and prepare for authentication")
60
- .option("--url <url>", "MCP server URL", { default: "https://mcp.notion.com/mcp" })
60
+ .option("--url <url>", wrapJsonSchema({ type: "string", default: "https://mcp.notion.com/mcp", description: "MCP server URL" }))
61
61
  .action((options) => {
62
62
  saveConfig({ mcpUrl: options.url });
63
63
  console.log(`Saved MCP URL: ${options.url}`);
@@ -82,5 +82,5 @@ cli.command("status", "Show current config").action(() => {
82
82
  console.log(`Config file: ${CONFIG_FILE}`);
83
83
  });
84
84
  cli.help();
85
- cli.version("0.0.3");
85
+ cli.version("0.0.5");
86
86
  cli.parse();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "notion-mcp-cli",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
4
4
  "type": "module",
5
5
  "description": "CLI for Notion MCP with OAuth support",
6
6
  "bin": {
@@ -23,8 +23,8 @@
23
23
  "node": ">=18.0.0"
24
24
  },
25
25
  "dependencies": {
26
- "@xmorse/cac": "6.0.7",
27
- "mcpcac": "0.0.3"
26
+ "goke": "6.1.2",
27
+ "@goke/mcp": "0.0.5"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@types/node": "^22.15.21",
@@ -32,7 +32,8 @@
32
32
  "typescript": "^5.9.3"
33
33
  },
34
34
  "scripts": {
35
- "build": "tsc",
35
+ "clean": "rm -rf dist",
36
+ "build": "pnpm clean && tsc",
36
37
  "dev": "tsx src/cli.ts",
37
38
  "watch": "tsc -w"
38
39
  }