zuiku-mcp 0.3.2 → 0.3.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/CHANGELOG.md ADDED
@@ -0,0 +1,12 @@
1
+ # Changelog
2
+
3
+ ## 0.3.3
4
+
5
+ - change the default editor URL from the dev-local `http://localhost:5173/editor` to `https://zuiku.dev/editor`
6
+ - clarify that `zuiku.open` should use the returned exact `editorUrl`, not a bare `/editor`
7
+ - refresh npm-facing metadata so the npm homepage points to the install guide and the package page explains the GitHub links it shows
8
+ - replace `UNLICENSED` package metadata with package-local public preview terms via `LICENSE.txt` and README notice
9
+
10
+ ## 0.3.2
11
+
12
+ - initial public `zuiku-mcp` npm package release
package/LICENSE.txt ADDED
@@ -0,0 +1,49 @@
1
+ Zuiku MCP Preview License
2
+
3
+ Copyright (c) 2026 Kamotami. All rights reserved.
4
+
5
+ 1. Limited License Grant
6
+
7
+ Subject to the terms of this License, you may install, run, copy, and internally modify this package for:
8
+
9
+ - personal use;
10
+ - evaluation, testing, and internal review;
11
+ - internal business workflows, including IDE, MCP, CI, automation, and documentation workflows; and
12
+ - use by your employees, contractors, and agents acting on your behalf for the same internal purposes.
13
+
14
+ No ownership rights are transferred to you.
15
+
16
+ 2. Restrictions
17
+
18
+ You may not:
19
+
20
+ - redistribute this package;
21
+ - distribute modified versions or derivative works of this package;
22
+ - provide this package, or its functionality, to third parties as a hosted service, SaaS offering, managed service, API, or similar external service;
23
+ - sell, sublicense, resell, rent, lease, or otherwise commercialize this package as a standalone product or service;
24
+ - use the Zuiku, Kamotami, or related names, logos, or marks without prior written permission; or
25
+ - remove or obscure copyright, trademark, or license notices.
26
+
27
+ 3. Public Preview / Not Open Source
28
+
29
+ This package is provided as a public preview release. It is source-available, but it is not open source. No rights are granted except as expressly stated in this License.
30
+
31
+ 4. Third-Party Components
32
+
33
+ This package may include or depend on third-party components that are licensed under their own terms. Those terms continue to apply to the relevant third-party components.
34
+
35
+ 5. Termination
36
+
37
+ Your rights under this License terminate automatically if you violate it. Upon termination, you must stop using the package and delete copies under your control, except where retention is required by law or internal recordkeeping policy.
38
+
39
+ 6. Disclaimer of Warranty
40
+
41
+ THIS PACKAGE IS PROVIDED "AS IS" WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, WHETHER EXPRESS, IMPLIED, OR STATUTORY, INCLUDING WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE, AND NON-INFRINGEMENT.
42
+
43
+ 7. Limitation of Liability
44
+
45
+ TO THE MAXIMUM EXTENT PERMITTED BY LAW, KAMOTAMI WILL NOT BE LIABLE FOR ANY INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL, EXEMPLARY, OR PUNITIVE DAMAGES, OR FOR ANY LOSS OF DATA, PROFITS, GOODWILL, OR BUSINESS INTERRUPTION, ARISING OUT OF OR RELATED TO THIS PACKAGE OR THIS LICENSE.
46
+
47
+ 8. Future Versions
48
+
49
+ Future versions of this package may be provided under different terms. This License applies only to the version distributed with it.
package/README.md CHANGED
@@ -1,17 +1,36 @@
1
1
  # zuiku-mcp
2
2
 
3
+ > Public preview release. Not open source. Use is subject to the included `LICENSE.txt`.
4
+
3
5
  `zuiku-mcp` is the primary MCP server package for Zuiku.
4
6
 
7
+ Use it when you want an AI client such as Codex CLI, Claude Code, Gemini CLI, VS Code, or Cursor to read and write Zuiku Markdown, Mermaid diagrams, and exports through MCP.
8
+
5
9
  `npx -y zuiku-mcp` is the shared entrypoint that CLI clients, IDE MCP settings, and optional IDE extensions call behind the scenes. It is usually configured once and then launched automatically by the client.
6
10
 
7
- ## What it exposes
11
+ ## Preview and licensing
8
12
 
9
- - `zuiku.version`: report the running package/server version and update hints
10
- - `zuiku.open`: open a markdown file, canonical Zuiku Markdown, or Mermaid-only content as a localhost editor session
11
- - `zuiku.read`: read current Markdown and hash before updating
12
- - `zuiku.apply`: write Mermaid-only or canonical Markdown back as normalized Zuiku Markdown with hash-based conflict protection
13
- - `zuiku.export`: export Markdown, PNG, or SVG
14
- - `zuiku.ddl_to_er`: turn an upstream-acquired DDL string into ER diagram payloads
13
+ - `zuiku-mcp` is distributed as a public preview package for evaluation and internal workflow use
14
+ - It is not open source, and no rights are granted except as stated in the included `LICENSE.txt`
15
+ - Personal use, evaluation use, and internal business workflow use are allowed, including use by employees, contractors, and agents acting on your behalf for those internal purposes
16
+ - Redistribution, distribution of modified versions, hosted-service use, resale, and unauthorized trademark use are prohibited
17
+ - Future versions may be provided under different terms; the included `LICENSE.txt` applies to the version you received
18
+
19
+ ## Quick start
20
+
21
+ Run this in the directory you want Zuiku to edit:
22
+
23
+ ```bash
24
+ codex mcp add zuiku \
25
+ --env ZUIKU_MCP_ALLOWED_ROOTS=$(pwd) \
26
+ --env ZUIKU_MCP_OPEN_BROWSER=0 \
27
+ -- npx -y zuiku-mcp
28
+ ```
29
+
30
+ More setup guides:
31
+
32
+ - Install: `https://zuiku.dev/install`
33
+ - Docs: `https://zuiku.dev/docs`
15
34
 
16
35
  ## Entry command
17
36
 
@@ -19,6 +38,15 @@
19
38
  npx -y zuiku-mcp
20
39
  ```
21
40
 
41
+ ## What it exposes
42
+
43
+ - `zuiku.version`: report the running package/server version and update hints
44
+ - `zuiku.open`: open a markdown file, canonical Zuiku Markdown, or Mermaid-only content in the Zuiku web editor backed by a localhost session host
45
+ - `zuiku.read`: read current Markdown and hash before updating
46
+ - `zuiku.apply`: write Mermaid-only or canonical Markdown back as normalized Zuiku Markdown with hash-based conflict protection
47
+ - `zuiku.export`: export Markdown, PNG, or SVG
48
+ - `zuiku.ddl_to_er`: turn an upstream-acquired DDL string into ER diagram payloads
49
+
22
50
  ## Version and update
23
51
 
24
52
  Check the currently installed package version:
@@ -54,18 +82,36 @@ npm install -g zuiku-mcp@latest
54
82
  ## Common environment variables
55
83
 
56
84
  - `ZUIKU_MCP_ALLOWED_ROOTS`: allowed file roots (`:` separated)
57
- - `ZUIKU_MCP_ENABLE_EDITOR_HOST`: `1` to enable the localhost editor host (default: `1`)
85
+ - `ZUIKU_MCP_ENABLE_EDITOR_HOST`: `1` to enable the localhost session host that bridges the web editor to local files (default: `1`)
58
86
  - `ZUIKU_MCP_OPEN_BROWSER`: `1` to open the browser on `zuiku.open`
59
87
  - `ZUIKU_MCP_EDITOR_HOST` / `ZUIKU_MCP_EDITOR_PORT`: host bind settings
60
- - `ZUIKU_EDITOR_URL`: editor URL (default: `http://localhost:5173/editor`)
88
+ - `ZUIKU_EDITOR_URL`: editor URL (default: `https://zuiku.dev/editor`)
89
+
90
+ ## Open behavior
91
+
92
+ - `zuiku.open` returns an exact `editorUrl`
93
+ - If your client does not open it automatically, open that exact `editorUrl`
94
+ - Do not open bare `/editor`; it can show unrelated local state
95
+ - The default editor target is `https://zuiku.dev/editor`
96
+ - The editor UI is web-based, but reads and writes the local markdown file through a localhost session host
97
+ - After a human edits the diagram in the editor, the AI should call `zuiku.read(path)` again before applying the next update
98
+
99
+ ## Why the npm page shows GitHub links
100
+
101
+ - `homepage` points to Zuiku's install guide because npm users usually need setup first
102
+ - `repository` points to the source repository, so npm can show a `Code` link
103
+ - `bugs` points to GitHub Issues, so npm can show an issue/report link
104
+ - The published npm package ships the runnable artifact (`bin/`, `dist/`) plus npm-facing docs files
105
+ - Public npm distribution and public source-repository visibility are related but not the same decision; the current package intentionally links to the public source repo for preview visibility, transparency, and issue reporting
61
106
 
62
107
  ## Notes
63
108
 
64
109
  - Requires Node.js 20+
65
110
  - `zuiku.version` can be called from MCP clients to confirm the running build and show update hints
66
111
  - For chat clients, `ZUIKU_MCP_OPEN_BROWSER=0` is usually the better default
67
- - `zuiku.apply(openAfterApply=true)` can request opening or reusing the local editor session after save
112
+ - `zuiku.apply(openAfterApply=true)` can request opening or reusing the web editor session after save
68
113
  - Discovery guides are exposed over MCP resources/prompts so AI clients can avoid external lookup
114
+ - For ER workflows, Zuiku converts the DDL string you give it; acquiring DDL itself belongs to the upstream AI environment or another tool
69
115
  - After updating, restart the MCP client or IDE session so the new package is launched
70
116
  - During preview, CLI and manual MCP setup are the source of truth; optional IDE extension listings can be added on top later
71
117
  - Install guide: `https://zuiku.dev/install`
@@ -17,7 +17,7 @@ var MCP_TOOL_DEFINITIONS = [
17
17
  },
18
18
  {
19
19
  name: "zuiku.open",
20
- description: "Open a markdown file, canonical Zuiku Markdown, or Mermaid-only text in a local editor session. Mermaid-only input is normalized on save, and the result includes editorUrl.",
20
+ description: "Open a markdown file, canonical Zuiku Markdown, or Mermaid-only text in a web editor session backed by a localhost bridge. Mermaid-only input is normalized on save, and the result includes editorUrl.",
21
21
  inputSchema: {
22
22
  type: "object",
23
23
  properties: {
@@ -44,7 +44,7 @@ var MCP_TOOL_DEFINITIONS = [
44
44
  },
45
45
  {
46
46
  name: "zuiku.apply",
47
- description: "Apply Mermaid-only or canonical Zuiku Markdown with hash conflict protection. The saved file is normalized to canonical Zuiku Markdown, and openAfterApply can open or reuse the local editor session.",
47
+ description: "Apply Mermaid-only or canonical Zuiku Markdown with hash conflict protection. The saved file is normalized to canonical Zuiku Markdown, and openAfterApply can open or reuse the web editor session backed by a localhost bridge.",
48
48
  inputSchema: {
49
49
  type: "object",
50
50
  properties: {
@@ -361,10 +361,11 @@ var GUIDE_TEXT_BY_TOPIC = {
361
361
  "",
362
362
  "- \u5165\u529B\u306F `Zuiku Markdown` \u307E\u305F\u306F `Mermaid\u5358\u4F53` \u3092\u53D7\u3051\u3089\u308C\u308B\u3002",
363
363
  "- \u4FDD\u5B58\u3068\u5171\u6709\u306E\u6B63\u898F\u5F62\u306F `H1 -> mermaid -> layout-json` \u306E Markdown 1\u30D5\u30A1\u30A4\u30EB\u3002",
364
- "- `zuiku.open` \u306F editor session \u3092\u4F5C\u308A\u3001`editorUrl` \u3092\u8FD4\u3059\u3002",
364
+ "- `zuiku.open` \u306F Web editor \u3068 localhost session host \u3092\u3064\u306A\u3050 editor session \u3092\u4F5C\u308A\u3001`editorUrl` \u3092\u8FD4\u3059\u3002",
365
365
  "- `zuiku.apply` \u306F\u4FDD\u5B58\u6642\u306B\u6B63\u898F\u5F62\u3078\u5BC4\u305B\u308B\u3002",
366
366
  "- \u65E2\u5B58\u66F4\u65B0\u306F `zuiku.read -> zuiku.apply(expectedHash=...)`\u3002",
367
367
  "- `openAfterApply=true` \u3067 editor session \u306E\u518D\u5229\u7528\u307E\u305F\u306F\u65B0\u898F open \u3092\u8981\u6C42\u3067\u304D\u308B\u3002",
368
+ "- \u4EBA\u9593\u304C editor \u3067\u4FEE\u6B63\u3057\u305F\u5185\u5BB9\u3092 AI \u304C\u4F7F\u3046\u306B\u306F\u3001\u6B21\u306E\u66F4\u65B0\u524D\u306B `zuiku.read(path)` \u3067\u518D\u53D6\u5F97\u3059\u308B\u3002",
368
369
  "- DDL \u53D6\u5F97\u3084 DB \u63A5\u7D9A\u306F Zuiku \u306E\u8CAC\u52D9\u3067\u306F\u306A\u3044\u3002"
369
370
  ].join("\n"),
370
371
  "flowchart-example": [
@@ -410,6 +411,7 @@ var GUIDE_TEXT_BY_TOPIC = {
410
411
  "- Zuiku \u306F DB \u3078\u63A5\u7D9A\u3057\u306A\u3044\u3002`zuiku.ddl_to_er(ddl, ...)` \u3060\u3051\u3092\u62C5\u5F53\u3059\u308B\u3002",
411
412
  "- \u65B0\u898F\u306A\u3089 `zuiku.open(markdown, openInBrowser=true)`\u3002",
412
413
  "- \u65E2\u5B58\u66F4\u65B0\u306A\u3089 `zuiku.read -> zuiku.apply(mode, expectedHash, openAfterApply=true)`\u3002",
414
+ "- \u4EBA\u9593\u304C editor \u3067\u76F4\u3057\u305F\u3042\u3068\u306E\u518D\u7DE8\u96C6\u3082\u3001AI \u306F\u307E\u305A `zuiku.read(path)` \u3067\u6700\u65B0\u3092\u8AAD\u3080\u3002",
413
415
  "- `current-page` \u306F `targetDiagramId` \u5FC5\u9808\u3002",
414
416
  "- \u4FDD\u5B58\u7D50\u679C\u306F Zuiku Markdown \u6B63\u898F\u5F62\u3078\u5BC4\u308B\u3002"
415
417
  ].join("\n"),
@@ -421,6 +423,7 @@ var GUIDE_TEXT_BY_TOPIC = {
421
423
  "- \u5165\u529B\u306F Zuiku Markdown \u3067\u3082 Mermaid\u5358\u4F53\u3067\u3082\u3088\u3044\u3002",
422
424
  "- `zuiku.apply(path, markdown, expectedHash, mode, targetDiagramId?, openAfterApply=true)` \u3092\u4F7F\u3046\u3002",
423
425
  "- `replace` \u306F file \u5168\u4F53\u66F4\u65B0\u3001`current-page` \u306F diagram \u5358\u4F4D\u66F4\u65B0\u3002",
426
+ "- \u4EBA\u9593\u304C editor \u3067\u4FEE\u6B63\u3057\u305F\u3042\u3068\u306F\u3001AI \u304C\u6B21\u306B `zuiku.read(path)` \u3067\u6700\u65B0\u3092\u518D\u53D6\u5F97\u3057\u3066\u304B\u3089\u7D9A\u3051\u308B\u3002",
424
427
  "- \u4FDD\u5B58\u6642\u306F\u6B63\u898F Zuiku Markdown \u306B\u6B63\u898F\u5316\u3055\u308C\u308B\u3002"
425
428
  ].join("\n")
426
429
  };
@@ -3678,7 +3681,7 @@ function normalizeToZuikuMarkdown(markdown, options = {}) {
3678
3681
  }
3679
3682
  function resolveProjectTitleForExport(projectName) {
3680
3683
  const trimmed = projectName.trim();
3681
- if (trimmed.length === 0 || trimmed === "\u56F3\u80B2 MVP \u30B9\u30B1\u30EB\u30C8\u30F3") {
3684
+ if (trimmed.length === 0 || trimmed === "\u56F3\u80B2 MVP \u30B9\u30B1\u30EB\u30C8\u30F3" || trimmed === "Zuiku MVP \u30B9\u30B1\u30EB\u30C8\u30F3") {
3682
3685
  return "Zuiku";
3683
3686
  }
3684
3687
  return trimmed;
@@ -5714,11 +5717,11 @@ function parseBearerToken(value) {
5714
5717
  // package.json
5715
5718
  var package_default = {
5716
5719
  name: "zuiku-mcp",
5717
- version: "0.3.2",
5718
- description: "Round-trip Diagram Editor MCP server for Zuiku",
5720
+ version: "0.3.3",
5721
+ description: "Public preview MCP server for Zuiku round-trip diagram editing",
5719
5722
  type: "module",
5720
- license: "UNLICENSED",
5721
- homepage: "https://zuiku.dev/docs",
5723
+ license: "SEE LICENSE IN LICENSE.txt",
5724
+ homepage: "https://zuiku.dev/install",
5722
5725
  bugs: {
5723
5726
  url: "https://github.com/kamotami/zuiku/issues"
5724
5727
  },
@@ -5748,7 +5751,9 @@ var package_default = {
5748
5751
  files: [
5749
5752
  "bin",
5750
5753
  "dist",
5751
- "README.md"
5754
+ "README.md",
5755
+ "CHANGELOG.md",
5756
+ "LICENSE.txt"
5752
5757
  ],
5753
5758
  publishConfig: {
5754
5759
  access: "public"
@@ -6281,15 +6286,15 @@ function isMcpErrorCode(value) {
6281
6286
  }
6282
6287
  function buildEditorSessionMessage(opened) {
6283
6288
  if (opened.openedInEditor && opened.reusedSession) {
6284
- return "Reused the existing Zuiku editor session and requested it to open.";
6289
+ return "Reused the existing Zuiku editor session and requested it to open. If the wrong page appeared, open the exact editorUrl instead of bare /editor.";
6285
6290
  }
6286
6291
  if (opened.openedInEditor) {
6287
- return "Requested the Zuiku editor session to open.";
6292
+ return "Requested the Zuiku editor session to open. If the wrong page appeared, open the exact editorUrl instead of bare /editor.";
6288
6293
  }
6289
6294
  if (opened.reusedSession) {
6290
- return "Reused the existing Zuiku editor session. If your client did not open it automatically, use the editorUrl.";
6295
+ return "Reused the existing Zuiku editor session. If your client did not open it automatically, use the exact editorUrl. Opening bare /editor may show unrelated local state.";
6291
6296
  }
6292
- return "Zuiku editor session is ready. If your client did not open it automatically, use the editorUrl.";
6297
+ return "Zuiku editor session is ready. If your client did not open it automatically, use the exact editorUrl. Opening bare /editor may show unrelated local state.";
6293
6298
  }
6294
6299
  function buildApplyResultMessage(options) {
6295
6300
  if (!options.openAfterApply) {
@@ -6578,14 +6583,14 @@ function asNonEmptyString3(value) {
6578
6583
  // ../../scripts/zuiku-local-editor-host.ts
6579
6584
  import { createHash as createHash2, randomUUID } from "node:crypto";
6580
6585
  import { createServer } from "node:http";
6581
- import { mkdir as mkdir2, mkdtemp, readFile as readFile2, readdir, rm, stat as stat2, writeFile as writeFile2 } from "node:fs/promises";
6586
+ import { chmod, mkdir as mkdir2, mkdtemp, readFile as readFile2, readdir, rm, stat as stat2, writeFile as writeFile2 } from "node:fs/promises";
6582
6587
  import { tmpdir } from "node:os";
6583
6588
  import path3 from "node:path";
6584
6589
  import { fileURLToPath } from "node:url";
6585
6590
  import { spawn } from "node:child_process";
6586
6591
  var DEFAULT_HOST = "127.0.0.1";
6587
6592
  var DEFAULT_PORT = 17731;
6588
- var DEFAULT_EDITOR_URL = "http://localhost:5173/editor";
6593
+ var DEFAULT_EDITOR_URL = "https://zuiku.dev/editor";
6589
6594
  var MAX_BODY_BYTES = 5 * 1024 * 1024;
6590
6595
  var DEFAULT_SESSION_IDLE_TIMEOUT_MS = 60 * 60 * 1e3;
6591
6596
  var DEFAULT_TEMP_FILE_TTL_MS = 24 * 60 * 60 * 1e3;
@@ -6850,10 +6855,11 @@ var LocalEditorHostImpl = class {
6850
6855
  return true;
6851
6856
  }
6852
6857
  async openSessionViaAttachedHost(request) {
6853
- const response = await fetch(`${this.getBaseUrl()}/sessions?mcpToken=${encodeURIComponent(this.sessionToken)}`, {
6858
+ const response = await fetch(`${this.getBaseUrl()}/sessions`, {
6854
6859
  method: "POST",
6855
6860
  headers: {
6856
- "Content-Type": "application/json"
6861
+ "Content-Type": "application/json",
6862
+ "X-Zuiku-Mcp-Token": this.sessionToken
6857
6863
  },
6858
6864
  body: JSON.stringify({
6859
6865
  ...request.path ? { path: request.path } : {},
@@ -6916,7 +6922,13 @@ var LocalEditorHostImpl = class {
6916
6922
  editorUrl: this.editorUrl,
6917
6923
  ownerPid: process.pid
6918
6924
  };
6919
- await writeFile2(this.registryFilePath, JSON.stringify(payload), "utf8");
6925
+ await writeFile2(this.registryFilePath, JSON.stringify(payload), {
6926
+ encoding: "utf8",
6927
+ mode: 384
6928
+ });
6929
+ if (process.platform !== "win32") {
6930
+ await chmod(this.registryFilePath, 384).catch(() => void 0);
6931
+ }
6920
6932
  }
6921
6933
  async removeRegistryFileIfOwned() {
6922
6934
  const registry = await this.readRegistryFile();
@@ -7293,9 +7305,11 @@ function ensureMarkdownExtension(filePath) {
7293
7305
  }
7294
7306
  function buildEditorUrl(editorUrl, hostUrl, sessionId, sessionToken) {
7295
7307
  const target = new URL(editorUrl);
7296
- target.searchParams.set("mcpSession", sessionId);
7297
- target.searchParams.set("mcpHost", hostUrl);
7298
- target.searchParams.set("mcpToken", sessionToken);
7308
+ const params = new URLSearchParams();
7309
+ params.set("mcpSession", sessionId);
7310
+ params.set("mcpHost", hostUrl);
7311
+ params.set("mcpToken", sessionToken);
7312
+ target.hash = params.toString();
7299
7313
  return target.toString();
7300
7314
  }
7301
7315
  function openBrowser(url) {
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "zuiku-mcp",
3
- "version": "0.3.2",
4
- "description": "Round-trip Diagram Editor MCP server for Zuiku",
3
+ "version": "0.3.3",
4
+ "description": "Public preview MCP server for Zuiku round-trip diagram editing",
5
5
  "type": "module",
6
- "license": "UNLICENSED",
7
- "homepage": "https://zuiku.dev/docs",
6
+ "license": "SEE LICENSE IN LICENSE.txt",
7
+ "homepage": "https://zuiku.dev/install",
8
8
  "bugs": {
9
9
  "url": "https://github.com/kamotami/zuiku/issues"
10
10
  },
@@ -34,7 +34,9 @@
34
34
  "files": [
35
35
  "bin",
36
36
  "dist",
37
- "README.md"
37
+ "README.md",
38
+ "CHANGELOG.md",
39
+ "LICENSE.txt"
38
40
  ],
39
41
  "publishConfig": {
40
42
  "access": "public"