@llmnesia/mcp 0.1.6 → 0.1.8

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
@@ -48,12 +48,11 @@ The installer:
48
48
  1. sets up the native host that bridges the browser extension to your local
49
49
  corpus,
50
50
  2. copies the server into `~/.llmnesia/bin` so it has a permanent home,
51
- 3. detects supported MCP clients you have (Claude Code, Claude Desktop,
52
- Cursor, and Codex), and
53
- 4. registers that copy with each detected client — using the client's own CLI
54
- where available, or with an automatic backup before editing its config file.
55
- It also prepares the standard Claude Desktop, Cursor, and Codex/ChatGPT
56
- config paths, so installing one of those desktop apps later does not require
51
+ 3. sets up the supported desktop AI apps (Claude Code, Claude Desktop, Cursor,
52
+ and Codex/ChatGPT), and
53
+ 4. registers that copy using the client's own CLI where available, or with an
54
+ automatic backup before editing its documented user config. It prepares all
55
+ of those standard config paths, so an app installed later does not require
57
56
  running setup again.
58
57
 
59
58
  The `install` command is the approval to perform those setup steps. It does not
@@ -121,7 +120,7 @@ received data — check it before concluding a chat does not exist.
121
120
 
122
121
  | Client | How `install` wires it |
123
122
  | --- | --- |
124
- | Claude Code | Runs `claude mcp add --scope user` with the absolute Node and installed runtime paths, making it available in every project (detects `claude` on PATH). |
123
+ | Claude Code | Runs `claude mcp add --scope user` with the absolute Node and installed runtime paths when available. Otherwise it writes the documented user-scope `~/.claude.json` entry, so Windows users do not need the `claude` command on PATH. |
125
124
  | Claude Desktop | Edits `claude_desktop_config.json` at the standard OS-specific path, preparing it in advance if Claude Desktop is installed later. |
126
125
  | Cursor | Edits `~/.cursor/mcp.json`, preparing it in advance if Cursor is installed later. |
127
126
  | Codex / ChatGPT desktop | Runs `codex mcp add` with the absolute runtime paths when available. If the bundled CLI is unavailable, the installer safely edits `~/.codex/config.toml` itself and backs up existing settings first, including preparing it for a later installation. Read-only LLMnesia tools are configured to run without repeated approval prompts; writes still ask. |
@@ -38,7 +38,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
38
38
  ));
39
39
 
40
40
  // src/version.ts
41
- var VERSION = true ? "0.1.6" : "0.0.0-dev";
41
+ var VERSION = true ? "0.1.8" : "0.0.0-dev";
42
42
 
43
43
  export {
44
44
  __require,
@@ -15,7 +15,7 @@ import {
15
15
  __commonJS,
16
16
  __require,
17
17
  __toESM
18
- } from "./chunk-JBCYML3I.js";
18
+ } from "./chunk-TP5KBWQA.js";
19
19
 
20
20
  // ../node_modules/isexe/windows.js
21
21
  var require_windows = __commonJS({
@@ -2820,9 +2820,11 @@ ${"stderr" in err ? String(err.stderr) : ""}` : errorMessage(err);
2820
2820
  await runCodex(["mcp", "remove", name]);
2821
2821
  }
2822
2822
  };
2823
- function paths(home2, osPlatform2) {
2824
- const claudeDesktop = osPlatform2 === "darwin" ? join4(home2, "Library", "Application Support", "Claude", "claude_desktop_config.json") : osPlatform2 === "win32" ? join4(process.env.APPDATA || join4(home2, "AppData", "Roaming"), "Claude", "claude_desktop_config.json") : null;
2823
+ function paths(home2, osPlatform2, appData) {
2824
+ const claudeCodeRoot = process.env.CLAUDE_CONFIG_DIR || home2;
2825
+ const claudeDesktop = osPlatform2 === "darwin" ? join4(home2, "Library", "Application Support", "Claude", "claude_desktop_config.json") : osPlatform2 === "win32" ? join4(appData || process.env.APPDATA || join4(home2, "AppData", "Roaming"), "Claude", "claude_desktop_config.json") : null;
2825
2826
  return {
2827
+ claudeCode: join4(claudeCodeRoot, ".claude.json"),
2826
2828
  claudeDesktop,
2827
2829
  cursor: join4(home2, ".cursor", "mcp.json"),
2828
2830
  codex: join4(home2, ".codex", "config.toml")
@@ -2870,10 +2872,13 @@ async function clientDirExists(configPath) {
2870
2872
  return false;
2871
2873
  }
2872
2874
  }
2873
- async function registerClaudeCode(serve, cli, confirm) {
2875
+ async function registerClaudeCode(serve, cli, configPath, confirm, now, prepareMissing) {
2874
2876
  const present = await cli.detect();
2875
2877
  if (!present) {
2876
- return { client: "Claude Code", action: "skipped", detail: "`claude` not found on PATH." };
2878
+ if (!prepareMissing) {
2879
+ return { client: "Claude Code", action: "skipped", detail: "`claude` not found on PATH." };
2880
+ }
2881
+ return registerJsonClient("Claude Code", configPath, serve, confirm, now, prepareMissing, true);
2877
2882
  }
2878
2883
  let existing;
2879
2884
  try {
@@ -3072,7 +3077,7 @@ codex mcp add ${SERVER_NAME} -- ${serve.command} ${serve.args.join(" ")}`
3072
3077
  detail: `Ran: codex mcp add ${SERVER_NAME} -- ${serve.command} ${serve.args.join(" ")}`
3073
3078
  };
3074
3079
  }
3075
- async function registerJsonClient(clientLabel, configPath, serve, confirm, now, prepareMissing = false) {
3080
+ async function registerJsonClient(clientLabel, configPath, serve, confirm, now, prepareMissing = false, prepareWhenConfigAbsent = false) {
3076
3081
  const configDirExists = await clientDirExists(configPath);
3077
3082
  if (!configDirExists && !prepareMissing) {
3078
3083
  return {
@@ -3103,7 +3108,7 @@ async function registerJsonClient(clientLabel, configPath, serve, confirm, now,
3103
3108
  return { client: clientLabel, action: "error", detail: errorMessage(err) };
3104
3109
  }
3105
3110
  const already = servers[SERVER_NAME];
3106
- const nextEntry = { command: serve.command, args: serve.args };
3111
+ const nextEntry = { type: "stdio", command: serve.command, args: serve.args };
3107
3112
  if (already && JSON.stringify(already) === JSON.stringify(nextEntry)) {
3108
3113
  return { client: clientLabel, action: "skipped", detail: `Already registered at ${configPath}.` };
3109
3114
  }
@@ -3126,8 +3131,8 @@ ${preview}`;
3126
3131
  `, "utf8");
3127
3132
  return {
3128
3133
  client: clientLabel,
3129
- action: configDirExists ? "registered" : "prepared",
3130
- detail: configDirExists ? `Wrote ${configPath}.` : `Prepared ${configPath} for a future ${clientLabel} installation.`
3134
+ action: configDirExists && !(prepareWhenConfigAbsent && !existed) ? "registered" : "prepared",
3135
+ detail: configDirExists ? prepareWhenConfigAbsent && !existed ? `Prepared ${configPath} for a future ${clientLabel} installation.` : `Wrote ${configPath}.` : `Prepared ${configPath} for a future ${clientLabel} installation.`
3131
3136
  };
3132
3137
  } catch (err) {
3133
3138
  return { client: clientLabel, action: "error", detail: `Could not write ${configPath}: ${errorMessage(err)}` };
@@ -3215,14 +3220,18 @@ async function writeCodexConfig(configPath, serve, now) {
3215
3220
  return { changed: true, ...backupPath ? { backupPath } : {} };
3216
3221
  }
3217
3222
  function genericBlock(serve) {
3218
- return JSON.stringify({ mcpServers: { [SERVER_NAME]: { command: serve.command, args: serve.args } } }, null, 2);
3223
+ return JSON.stringify(
3224
+ { mcpServers: { [SERVER_NAME]: { type: "stdio", command: serve.command, args: serve.args } } },
3225
+ null,
3226
+ 2
3227
+ );
3219
3228
  }
3220
3229
  async function registerClients(options) {
3221
3230
  const home2 = options.home ?? homedir2();
3222
3231
  const osPlatform2 = options.osPlatform ?? platform2();
3223
3232
  const now = options.now ?? (() => Date.now());
3224
3233
  const prepareMissing = options.prepareMissingDesktopApps === true;
3225
- const { claudeDesktop, cursor, codex } = paths(home2, osPlatform2);
3234
+ const { claudeCode, claudeDesktop, cursor, codex } = paths(home2, osPlatform2, options.appData);
3226
3235
  const results = [];
3227
3236
  const safe = async (client, fn) => {
3228
3237
  try {
@@ -3234,7 +3243,14 @@ async function registerClients(options) {
3234
3243
  results.push(
3235
3244
  await safe(
3236
3245
  "Claude Code",
3237
- () => registerClaudeCode(options.serve, options.claudeCli ?? realClaudeCli, options.confirm)
3246
+ () => registerClaudeCode(
3247
+ options.serve,
3248
+ options.claudeCli ?? realClaudeCli,
3249
+ claudeCode,
3250
+ options.confirm,
3251
+ now,
3252
+ prepareMissing
3253
+ )
3238
3254
  )
3239
3255
  );
3240
3256
  if (claudeDesktop) {
@@ -3828,21 +3844,8 @@ function summarizeClientRegistrations(results) {
3828
3844
  }
3829
3845
  return { connected, prepared, errors };
3830
3846
  }
3831
- function naturalList(items) {
3832
- if (items.length <= 1) return items[0] ?? "";
3833
- if (items.length === 2) return `${items[0]} and ${items[1]}`;
3834
- return `${items.slice(0, -1).join(", ")}, and ${items.at(-1)}`;
3835
- }
3836
- function formatInstallSuccess(connectedClients, preparedClients = []) {
3837
- const apps = naturalList(connectedClients);
3838
- const restart = apps ? `Fully close and reopen your browser and ${apps}.
3839
- ` : "Fully close and reopen your browser.\n";
3840
- const future = preparedClients.length > 0 ? `${naturalList(preparedClients)} will also be ready if you install ${preparedClients.length === 1 ? "it" : "them"} later.
3841
- ` : "";
3842
- return `
3843
- Setup complete.
3844
- ${restart}${future}LLMnesia Settings will confirm when your history is ready.
3845
- `;
3847
+ function formatInstallSuccess() {
3848
+ return "\nSetup complete.\nFully close and reopen your browser and any desktop AI app you use.\nLLMnesia will be available in each supported desktop AI app you use.\nLLMnesia Settings will confirm when your history is ready.\n";
3846
3849
  }
3847
3850
  async function runInstall(positionals, options, flags) {
3848
3851
  let hadProblems = false;
@@ -3876,26 +3879,16 @@ async function runInstall(positionals, options, flags) {
3876
3879
  prepareMissingDesktopApps: true
3877
3880
  });
3878
3881
  const registrations = summarizeClientRegistrations(results);
3879
- for (const client of registrations.connected) {
3880
- process.stdout.write(`${client} connected.
3881
- `);
3882
- }
3883
3882
  for (const error of registrations.errors) {
3884
3883
  process.stderr.write(`Could not connect ${error.client}: ${error.detail}
3885
3884
  `);
3886
3885
  }
3887
3886
  hadProblems ||= registrations.errors.length > 0;
3888
- if (registrations.connected.length === 0 && registrations.prepared.length === 0) {
3889
- hadProblems = true;
3890
- process.stderr.write(
3891
- "No supported desktop AI app was found. Install or open Codex, Claude Desktop, or Cursor, then run the same command again.\n"
3892
- );
3893
- }
3894
3887
  if (hadProblems) {
3895
3888
  process.stderr.write("\nSetup needs attention. Fix the message above, then run the same command again.\n");
3896
3889
  return 1;
3897
3890
  }
3898
- process.stdout.write(formatInstallSuccess(registrations.connected, registrations.prepared));
3891
+ process.stdout.write(formatInstallSuccess());
3899
3892
  return 0;
3900
3893
  }
3901
3894
  async function runUninstall(flags) {
package/dist/cli.js CHANGED
@@ -3,7 +3,7 @@ import { createRequire as __llmnesiaCreateRequire } from "node:module";
3
3
  const require = __llmnesiaCreateRequire(import.meta.url);
4
4
  import {
5
5
  VERSION
6
- } from "./chunk-JBCYML3I.js";
6
+ } from "./chunk-TP5KBWQA.js";
7
7
 
8
8
  // src/nodeDownload.ts
9
9
  var NODE_DOWNLOAD_URLS = {
@@ -141,7 +141,7 @@ async function bootstrap() {
141
141
  await guideUnsupportedNodeVersion(process.versions.node);
142
142
  return 1;
143
143
  }
144
- const { main } = await import("./cli-LNUL4QWX.js");
144
+ const { main } = await import("./cli-KDKBKT22.js");
145
145
  return main();
146
146
  }
147
147
  bootstrap().then((code) => {
package/dist/mcp.js CHANGED
@@ -13,7 +13,7 @@ import {
13
13
  __commonJS,
14
14
  __export,
15
15
  __toESM
16
- } from "./chunk-JBCYML3I.js";
16
+ } from "./chunk-TP5KBWQA.js";
17
17
 
18
18
  // ../node_modules/ajv/dist/compile/codegen/code.js
19
19
  var require_code = __commonJS({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@llmnesia/mcp",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "comment:mcpName": "The MCP Registry's ownership marker: it must equal server.json's `name`, and the namespace must match how you authenticate with mcp-publisher. `com.llmnesia/...` requires DNS auth (a TXT record on llmnesia.com) — see docs/MCP_INSTALLER_BOARD.md.",