kubun 0.4.0 → 0.4.3

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 CHANGED
@@ -20,7 +20,7 @@ $ npm install -g kubun
20
20
  $ kubun COMMAND
21
21
  running command...
22
22
  $ kubun (--version)
23
- kubun/0.4.0 darwin-arm64 node-v24.12.0
23
+ kubun/0.4.3 darwin-arm64 node-v24.13.0
24
24
  $ kubun --help [COMMAND]
25
25
  USAGE
26
26
  $ kubun COMMAND
@@ -36,6 +36,7 @@ USAGE
36
36
  * [`kubun graph query ID TEXT`](#kubun-graph-query-id-text)
37
37
  * [`kubun graphql schema`](#kubun-graphql-schema)
38
38
  * [`kubun help [COMMAND]`](#kubun-help-command)
39
+ * [`kubun mcp`](#kubun-mcp)
39
40
  * [`kubun model cluster`](#kubun-model-cluster)
40
41
  * [`kubun model create NAME SCHEMA`](#kubun-model-create-name-schema)
41
42
  * [`kubun plugins`](#kubun-plugins)
@@ -174,6 +175,23 @@ DESCRIPTION
174
175
 
175
176
  _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v6.2.36/src/commands/help.ts)_
176
177
 
178
+ ## `kubun mcp`
179
+
180
+ Start an MCP server for Kubun
181
+
182
+ ```
183
+ USAGE
184
+ $ kubun mcp [-c <value> | -d <value>] [-k <value>]
185
+
186
+ FLAGS
187
+ -c, --connect=<value> URL of an existing Kubun HTTP server to connect to
188
+ -d, --db=<value> SQLite database path or PostgreSQL URL
189
+ -k, --privateKey=<value> [env: KUBUN_PRIVATE_KEY] base64-encoded private key
190
+
191
+ DESCRIPTION
192
+ Start an MCP server for Kubun
193
+ ```
194
+
177
195
  ## `kubun model cluster`
178
196
 
179
197
  Create a documents cluster model
@@ -17,14 +17,6 @@ export default class CreateGraphQLSchema extends Command {
17
17
  description: 'output file for the GraphQL schema',
18
18
  char: 'o',
19
19
  }),
20
- // id: Flags.string({ description: 'graph ID' }),
21
- // privateKey: Flags.string({
22
- // description: 'base64-encoded private key',
23
- // char: 'k',
24
- // env: 'KUBUN_PRIVATE_KEY',
25
- // required: true,
26
- // }),
27
- // url: Flags.string({ description: 'Kubun server URL' }),
28
20
  };
29
21
  async run() {
30
22
  const spinner = ora('Loading clusters...').start();
@@ -0,0 +1,33 @@
1
+ import { createConfig } from '@kubun/mcp';
2
+ import { serveProcess } from '@mokei/context-server';
3
+ import { Command, Flags } from '@oclif/core';
4
+ import { getSigner } from '../account.js';
5
+ export default class MCP extends Command {
6
+ static description = 'Start an MCP server for Kubun';
7
+ static flags = {
8
+ connect: Flags.string({
9
+ char: 'c',
10
+ description: 'URL of an existing Kubun HTTP server to connect to',
11
+ exclusive: ['db'],
12
+ }),
13
+ db: Flags.string({
14
+ char: 'd',
15
+ description: 'SQLite database path or PostgreSQL URL',
16
+ exclusive: ['connect'],
17
+ }),
18
+ privateKey: Flags.string({
19
+ char: 'k',
20
+ description: 'base64-encoded private key',
21
+ env: 'KUBUN_PRIVATE_KEY',
22
+ }),
23
+ };
24
+ async run() {
25
+ const { flags } = await this.parse(MCP);
26
+ const config = createConfig({
27
+ connect: flags.connect,
28
+ database: flags.db,
29
+ signer: flags.privateKey ? getSigner(flags.privateKey) : undefined,
30
+ });
31
+ serveProcess(config);
32
+ }
33
+ }
@@ -83,7 +83,16 @@ export default class Serve extends Command {
83
83
  const allowedOrigin = flags.allowedOrigin.split(',').map((origin) => origin.trim());
84
84
  const transport = new ServerTransport({ allowedOrigin });
85
85
  serve({
86
- handlers: createHandlers({ db, logger: getKubunLogger('server') }),
86
+ handlers: createHandlers({
87
+ db,
88
+ logger: getKubunLogger('server'),
89
+ serverAccessConfig: {
90
+ defaultAccessLevel: {
91
+ read: 'anyone',
92
+ write: 'only_owner',
93
+ },
94
+ },
95
+ }),
87
96
  id,
88
97
  transport,
89
98
  });
@@ -1,5 +1,57 @@
1
1
  {
2
2
  "commands": {
3
+ "mcp": {
4
+ "aliases": [],
5
+ "args": {},
6
+ "description": "Start an MCP server for Kubun",
7
+ "flags": {
8
+ "connect": {
9
+ "char": "c",
10
+ "description": "URL of an existing Kubun HTTP server to connect to",
11
+ "exclusive": [
12
+ "db"
13
+ ],
14
+ "name": "connect",
15
+ "hasDynamicHelp": false,
16
+ "multiple": false,
17
+ "type": "option"
18
+ },
19
+ "db": {
20
+ "char": "d",
21
+ "description": "SQLite database path or PostgreSQL URL",
22
+ "exclusive": [
23
+ "connect"
24
+ ],
25
+ "name": "db",
26
+ "hasDynamicHelp": false,
27
+ "multiple": false,
28
+ "type": "option"
29
+ },
30
+ "privateKey": {
31
+ "char": "k",
32
+ "description": "base64-encoded private key",
33
+ "env": "KUBUN_PRIVATE_KEY",
34
+ "name": "privateKey",
35
+ "hasDynamicHelp": false,
36
+ "multiple": false,
37
+ "type": "option"
38
+ }
39
+ },
40
+ "hasDynamicHelp": false,
41
+ "hiddenAliases": [],
42
+ "id": "mcp",
43
+ "pluginAlias": "kubun",
44
+ "pluginName": "kubun",
45
+ "pluginType": "core",
46
+ "strict": true,
47
+ "enableJsonFlag": false,
48
+ "isESM": true,
49
+ "relativePath": [
50
+ "dist",
51
+ "commands",
52
+ "mcp.js"
53
+ ]
54
+ },
3
55
  "serve": {
4
56
  "aliases": [],
5
57
  "args": {},
@@ -461,5 +513,5 @@
461
513
  ]
462
514
  }
463
515
  },
464
- "version": "0.4.0"
516
+ "version": "0.4.3"
465
517
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kubun",
3
- "version": "0.4.0",
3
+ "version": "0.4.3",
4
4
  "license": "see LICENSE.md",
5
5
  "description": "Kubun CLI",
6
6
  "keywords": [],
@@ -37,10 +37,11 @@
37
37
  "@enkaku/async": "^0.12.2",
38
38
  "@enkaku/codec": "^0.12.0",
39
39
  "@enkaku/http-server-transport": "^0.12.2",
40
- "@enkaku/server": "^0.12.2",
40
+ "@enkaku/server": "^0.12.3",
41
41
  "@enkaku/token": "0.12.3",
42
- "@hono/node-server": "^1.19.8",
43
- "@logtape/logtape": "^1.3.6",
42
+ "@hono/node-server": "^1.19.9",
43
+ "@logtape/logtape": "^2.0.0",
44
+ "@mokei/context-server": "^0.5.0",
44
45
  "@oclif/core": "^4.8.0",
45
46
  "@oclif/plugin-help": "^6.2.36",
46
47
  "@oclif/plugin-plugins": "^5.4.54",
@@ -48,18 +49,19 @@
48
49
  "graphql": "^16.12.0",
49
50
  "ora": "^9.0.0",
50
51
  "@kubun/client": "^0.4.0",
51
- "@kubun/db-postgres": "^0.4.0",
52
- "@kubun/db-sqlite": "^0.4.0",
53
- "@kubun/graphql": "^0.4.0",
54
- "@kubun/db": "^0.4.0",
55
52
  "@kubun/http-client": "^0.4.0",
53
+ "@kubun/db": "^0.4.0",
54
+ "@kubun/graphql": "^0.4.4",
55
+ "@kubun/db-postgres": "^0.4.0",
56
56
  "@kubun/logger": "^0.4.0",
57
+ "@kubun/db-sqlite": "^0.4.0",
58
+ "@kubun/mcp": "^0.4.1",
57
59
  "@kubun/protocol": "^0.4.0",
58
- "@kubun/server": "^0.4.0"
60
+ "@kubun/server": "^0.4.2"
59
61
  },
60
62
  "devDependencies": {
61
63
  "@oclif/test": "^4.1.15",
62
- "oclif": "^4.22.65",
64
+ "oclif": "^4.22.67",
63
65
  "shx": "^0.4.0",
64
66
  "ts-node": "^10",
65
67
  "typescript": "^5.9.3"