@yugabytedb/meko-mcp 1.0.6 → 1.1.0
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 +189 -36
- package/assets/hooks-handlers/lib/capture.js +177 -78
- package/assets/hooks-handlers/lib/package.json +1 -0
- package/assets/hooks-handlers/test_single_conversation.sh +1 -1
- package/assets/skills/meko-mcp-tools/SKILL.md +167 -53
- package/assets/skills/meko-mcp-tools/references/_sections.md +1 -1
- package/assets/skills/meko-mcp-tools/references/tools-agent-id-conventions.md +84 -22
- package/assets/skills/meko-mcp-tools/references/tools-cookbook.md +89 -56
- package/assets/skills/meko-mcp-tools/references/tools-datapack-workflow.md +15 -7
- package/assets/skills/meko-mcp-tools/references/tools-known-limitations.md +17 -9
- package/assets/skills/meko-mcp-tools/references/tools-memory-vs-conversation.md +94 -5
- package/assets/skills/meko-mcp-tools/references/tools-overview.md +52 -37
- package/assets/skills/meko-mcp-tools/references/tools-rag-workflow.md +108 -37
- package/assets/skills/meko-mcp-tools/references/tools-scope-permissions.md +6 -10
- package/assets/skills/meko-mcp-tools/references/tools-troubleshooting.md +30 -18
- package/assets/skills/meko-mcp-tools/references/tools-user-id-conventions.md +55 -69
- package/bin/create-meko-setup.mjs +152 -26
- package/lib/clients/aliases.mjs +30 -0
- package/lib/clients/claude-code.mjs +384 -69
- package/lib/clients/claude-desktop.mjs +43 -8
- package/lib/clients/codex.mjs +977 -0
- package/lib/clients/common.mjs +142 -1
- package/lib/clients/cursor.mjs +73 -5
- package/lib/clients/index.mjs +2 -0
- package/lib/config.mjs +30 -0
- package/lib/detect.mjs +52 -44
- package/lib/installer.mjs +9 -2
- package/lib/mcp-transport.mjs +63 -4
- package/lib/migrate/adapters/memory-md.mjs +13 -6
- package/lib/migrate/datapack.mjs +167 -0
- package/lib/migrate/id.mjs +127 -9
- package/lib/migrate/mcp-client.mjs +1 -1
- package/lib/migrate/orchestrator.mjs +68 -10
- package/lib/migrate.mjs +346 -3
- package/lib/prompt.mjs +50 -76
- package/lib/validate.mjs +314 -10
- package/lib/version-check.mjs +178 -0
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
# Meko Setup Installer
|
|
2
2
|
|
|
3
|
-
A zero-dependency Node.js CLI that configures [Meko MCP Server](https://mekodata.netlify.app/) for Claude Code, Claude Desktop, and
|
|
3
|
+
A zero-dependency Node.js CLI that configures [Meko MCP Server](https://mekodata.netlify.app/) for Claude Code, Claude Desktop, Cursor, and OpenAI Codex (CLI + Desktop App) in one command. It registers MCP server settings, configures hook/runtime environment where supported, installs skills support, and validates the setup.
|
|
4
4
|
|
|
5
5
|
Reduces manual setup to a single command.
|
|
6
6
|
|
|
7
|
+
## Prerequisites
|
|
8
|
+
|
|
9
|
+
- **Node.js 18 or newer** on your PATH. Get it from [nodejs.org](https://nodejs.org/) or via a version manager (`nvm`, `fnm`, `asdf`). `npx`, which comes bundled with Node, is how you invoke the installer.
|
|
10
|
+
|
|
7
11
|
## Quick Start
|
|
8
12
|
|
|
9
13
|
The installer is path-agnostic — the three forms below are equivalent. Pick the one that matches how you obtained the code:
|
|
@@ -77,11 +81,19 @@ The installer performs up to 5 steps (some are skippable via flags):
|
|
|
77
81
|
|
|
78
82
|
| Step | Action | Command / File Modified |
|
|
79
83
|
|------|--------|------------------------|
|
|
80
|
-
| 1 | Register MCP server | `claude mcp add meko <url> --transport http --scope user` (with `-H "
|
|
81
|
-
| 2 | Set hook environment vars | Writes `MEKO_MCP_URL` and `MEKO_API_KEY` into `~/.claude/settings.json` under the `env` key |
|
|
82
|
-
| 3 | Register plugin marketplace | `claude plugin marketplace add yugabyte/meko-mcp-server --
|
|
84
|
+
| 1 | Register MCP server | `claude mcp add meko <url> --transport http --scope user` (with `-H "Authorization: Bearer <key>"` for cloud) |
|
|
85
|
+
| 2 | Set hook environment vars | Writes `MEKO_MCP_URL` and `MEKO_API_KEY` into `~/.claude/settings.json` under the `env` key. Also prunes any stale Meko hook entries in `settings.json.hooks` that point at a prior install path (e.g. a previous `npx` cache or homebrew-global copy) so only the current install's hooks fire. |
|
|
86
|
+
| 3 | Register plugin marketplace | `claude plugin marketplace add yugabyte/meko-mcp-server --scope user` |
|
|
83
87
|
| 4 | Install skills plugin | `claude plugin install meko-agent-skills --scope user` |
|
|
84
|
-
| 5 | Validate setup | Config check via `claude mcp list`, MCP `initialize` handshake, `tools/list` verification |
|
|
88
|
+
| 5 | Validate setup | Config check via `claude mcp list`, MCP `initialize` handshake, `tools/list` verification, and a canary `datapack_list` call |
|
|
89
|
+
|
|
90
|
+
### Post-install validation (canary)
|
|
91
|
+
|
|
92
|
+
Step 5 includes a **canary call** that invokes the read-only `datapack_list` tool and asserts the response is a non-empty JSON array of datapack records. This proves the part of the stack that connectivity + `tools/list` don't cover: the API token authenticated as a real Meko identity, the tenant resolver found an account for it, and datapack routing wired up the user's actual workspace. A successful `tools/list` only proves the server speaks MCP — it says nothing about whether a Meko tool call would actually find the user's data.
|
|
93
|
+
|
|
94
|
+
The canary used to do a `memory_add` → `memory_get_by_id` → `memory_delete_by_id` round-trip, but mem0's LLM fact-extractor is non-deterministic for synthetic test text — for the same input it sometimes returned `results: []` (no facts extracted) while still adding graph relations, which the installer reported as "no memory id" and surfaced as a validation failure even when the server was healthy. `datapack_list` is a single SQL read with no LLM in the path and returns deterministically.
|
|
95
|
+
|
|
96
|
+
`--no-canary` skips the canary entirely. The `initialize` and `tools/list` checks still run. Use this when you've already proved the round-trip in a prior step (CI, pre-flight smoke).
|
|
85
97
|
|
|
86
98
|
**Files modified (depends on `--client`):**
|
|
87
99
|
|
|
@@ -96,6 +108,14 @@ The installer performs up to 5 steps (some are skippable via flags):
|
|
|
96
108
|
- MCP config: `~/.cursor/mcp.json` or `.cursor/mcp.json`
|
|
97
109
|
- Hooks config: `~/.cursor/hooks.json` or `.cursor/hooks.json` (native mode)
|
|
98
110
|
- Skills path: `~/.cursor/skills` or `.cursor/skills`
|
|
111
|
+
- **OpenAI Codex (CLI + Desktop App)** — one install configures both surfaces (they share `~/.codex/`).
|
|
112
|
+
- MCP config: `~/.codex/config.toml` (TOML; `[mcp_servers.<name>]` block).
|
|
113
|
+
- Skills path: `~/.agents/skills/meko-mcp-tools/` (the shared agent-skills convention).
|
|
114
|
+
- System prompt: `~/.codex/AGENTS.md` (a Meko-managed sentinel block is upserted; user content outside the fence is preserved).
|
|
115
|
+
- **Cloud auth**: Codex's TOML stores `bearer_token_env_var = "MEKO_API_KEY"` rather than the key itself. You must export `MEKO_API_KEY` in your shell before launching Codex. The installer offers (interactively, never with `--yes`) to append the export line to your shell rc (`~/.zshrc` / `~/.bashrc` / `~/.config/fish/config.fish`). On macOS, when the desktop app is detected the installer also offers to run `launchctl setenv MEKO_API_KEY ...` since macOS apps launched from Finder/Dock do not inherit shell-rc env vars.
|
|
116
|
+
- **No project scope**: Codex has no per-project config. `--scope project --client codex` warns and degrades to user scope.
|
|
117
|
+
- **No auto-capture**: Codex does not expose user-installable session lifecycle hooks, so `session-start` / `session-end` capture is not available. Memory persistence still works via the model proactively calling `memory_search` / `memory_add` (the AGENTS.md block prompts this).
|
|
118
|
+
- **Restart Codex.app** after install so it picks up the new MCP server registration.
|
|
99
119
|
|
|
100
120
|
## CLI Reference
|
|
101
121
|
|
|
@@ -106,15 +126,16 @@ Usage:
|
|
|
106
126
|
|
|
107
127
|
| Flag | Description | Default |
|
|
108
128
|
|------|-------------|---------|
|
|
109
|
-
| `--client <list>` | Target client(s): one or more of `claude-code`, `claude-desktop`, `cursor`. Comma-separated, or `all` | `claude-code` |
|
|
129
|
+
| `--client <list>` | Target client(s): one or more of `claude-code`, `claude-desktop`, `cursor`, `codex`. Comma-separated, or `all`. `codex` covers both the OpenAI Codex CLI and the Codex Desktop App (they share `~/.codex/config.toml`). | `claude-code` |
|
|
110
130
|
| `--url <url>` | MCP server URL (from app.mekodev.com > Datapacks > Connect) | _(interactive prompt)_ |
|
|
111
|
-
| `--api-key <key>` | API key for Cloud Meko authentication | _(interactive prompt or `$MEKO_API_KEY` env)_ |
|
|
131
|
+
| `--api-key <key>` | API key for Cloud Meko authentication. If a Cloud `--url` is supplied without this flag, the installer falls back to `$MEKO_API_KEY`, then to an interactive prompt on a TTY. Only fails hard when running under `--yes` or with no TTY attached. | _(interactive prompt or `$MEKO_API_KEY` env)_ |
|
|
112
132
|
| `--local` | Use local Meko at `http://localhost:8000/mcp` (no API key needed) | `false` |
|
|
113
133
|
| `--scope <scope>` | Config scope: `user` or `project` (`claude-desktop` uses user scope config) | `user` |
|
|
114
134
|
| `--name <name>` | MCP server name in config | `meko` |
|
|
115
135
|
| `--cursor-hook-mode <mode>` | Cursor hook strategy: `native`, `claude-compat`, `hybrid` | `hybrid` |
|
|
116
136
|
| `--skip-skills` | Skip plugin marketplace and skills installation (steps 3-4) | `false` |
|
|
117
137
|
| `--skip-validation` | Skip post-install validation (step 5) | `false` |
|
|
138
|
+
| `--no-canary` | Skip the canary `datapack_list` call. Basic connectivity + tools/list still run. | `false` |
|
|
118
139
|
| `--dry-run` | Show what would be done without making changes | `false` |
|
|
119
140
|
| `--uninstall` | Remove Meko MCP server, skills, env vars, and marketplace entry | `false` |
|
|
120
141
|
| `--verbose` | Show detailed output (API keys are always redacted) | `false` |
|
|
@@ -145,9 +166,9 @@ After installing Meko, `--migrate` seeds your new datapack with the conversation
|
|
|
145
166
|
|---|---|---|
|
|
146
167
|
| Claude Code transcripts | `~/.claude/projects/<slug>/<uuid>.jsonl` | One Meko conversation (one Langfuse trace) per session; one paired user↔assistant turn per message pair. |
|
|
147
168
|
| Cursor transcripts | `~/.cursor/projects/<name>/agent-transcripts/<uuid>/*.jsonl` | Same — one conversation per session, one paired turn per user↔assistant round. |
|
|
148
|
-
| User-scope CLAUDE.md | `~/.claude/CLAUDE.md` | One memory per top-level `# ` section (
|
|
149
|
-
| Project-scope CLAUDE.md | `<projectCwd>/.claude/CLAUDE.md` | One memory per top-level `# ` section (
|
|
150
|
-
| Indexed project memories | `~/.claude/projects/<slug>/memory/*.md` | One memory per file; YAML frontmatter (`name`, `description`, `type`) is preserved in metadata. |
|
|
169
|
+
| User-scope CLAUDE.md | `~/.claude/CLAUDE.md` | One memory per top-level `# ` section (`agent_id = "meko_agent"` — the cross-project common bucket — with `metadata.scope = "user"`). |
|
|
170
|
+
| Project-scope CLAUDE.md | `<projectCwd>/.claude/CLAUDE.md` | One memory per top-level `# ` section (`agent_id = "claude_code:<repo-basename>"`, `metadata.scope = "project"`, `metadata.cwd = <project path>`). |
|
|
171
|
+
| Indexed project memories | `~/.claude/projects/<slug>/memory/*.md` | One memory per file (`agent_id = "claude_code:<repo-basename>"`); YAML frontmatter (`name`, `description`, `type`) is preserved in metadata. |
|
|
151
172
|
|
|
152
173
|
Project `cwd` is derived by reading the `cwd` field from a real session file in each slug directory — never by reverse-slugging the directory name, which loses `.` and `-` in component names.
|
|
153
174
|
|
|
@@ -223,7 +244,7 @@ status: running (pending → running → done | failed | stopped)
|
|
|
223
244
|
scope: user
|
|
224
245
|
started: 2026-04-29T00:09:12.673Z
|
|
225
246
|
finished: (in progress)
|
|
226
|
-
current:
|
|
247
|
+
current: agent / a2f6a1d6-... (agent_id / source-session-uuid)
|
|
227
248
|
sessions: 76 / 111 (processed / discovered)
|
|
228
249
|
messages: 674
|
|
229
250
|
memory pairs: 674 (memory_add from Mem0 extractor)
|
|
@@ -256,31 +277,35 @@ memory errs: 0 (failed memory_add calls; re-run with --force to
|
|
|
256
277
|
|
|
257
278
|
- Per-run logs: `~/.meko/migrate/<run-id>/log.ndjson` (one JSON object per line). `tail -f | jq .` is a reasonable debug loop.
|
|
258
279
|
- Per-run progress snapshot: `~/.meko/migrate/<run-id>/progress.json` (what `--migrate-status` reads).
|
|
259
|
-
- Durable state: `~/.meko/migrate/state
|
|
280
|
+
- Durable state: `~/.meko/migrate/state/<datapack-key>.json` tracks per-session checkpoints (`conversationId`, `messagesSent`, `lastUuid`, `status`) and per-memory content hashes, **scoped per destination datapack**. A re-run skips sessions marked `done` and memories whose body hash is unchanged. A partial session resumes from `lastUuid + 1`.
|
|
281
|
+
- **Per-datapack scoping**: the datapack key is the UUID segment of the MCP URL (`https://<uuid>.mcp.mekodev.com/mcp` → `<uuid>`), or a stable 16-char sha256 prefix for non-UUID URLs (e.g. `http://localhost:8000/mcp`). Switching datapacks produces completely independent state — migrating into a fresh datapack never falsely treats sessions as already-done just because an earlier run populated a different one. `--migrate-status` prints the `datapack:` key of the latest run so you can tell at a glance which state it belongs to.
|
|
282
|
+
- Back-compat for the legacy layout: migrations created before this change wrote to a single `~/.meko/migrate/state.json`. On the first run after upgrading, if `state/` is empty and `state.json` exists, the installer asks (or, under `--yes` / CI, silently accepts) "treat the legacy state as belonging to the current datapack" and copies `state.json` → `state/<current-key>.json`. The legacy file is kept on disk in case you roll back the installer.
|
|
260
283
|
- Server-side dedup: `conversation_add_message` gets a deterministic `seed = sha256(agentId + ":" + sessionUuid + ":" + messageUuid)` so partial-run overlap doesn't create duplicate messages.
|
|
261
|
-
- `--force` wipes resume state and re-issues every MCP call
|
|
284
|
+
- `--force` wipes the **current datapack's** resume state and re-issues every MCP call for it. Other datapacks' state files are untouched. If you only want to re-migrate into a new datapack, just point `--url` at the new one — no `--force` needed.
|
|
262
285
|
|
|
263
286
|
### What does NOT get migrated (v1)
|
|
264
287
|
|
|
265
288
|
- Slash-command skills, hooks, and `.claude/settings.json` — those remain in Claude Code's own config; Meko has no equivalent tool.
|
|
266
289
|
- Knowledge-base documents — would need an S3 upload path and `knowledgebase_trigger_index_creation` wiring.
|
|
267
|
-
- Transcripts from other coding agents (Aider, Continue.dev, Windsurf, Codex
|
|
290
|
+
- Transcripts from other coding agents (Aider, Continue.dev, Windsurf, Codex). Claude Code + Cursor only.
|
|
268
291
|
- `user_id` is left null on every call (the server fills it from the API key). Multi-user routing is a follow-up.
|
|
269
292
|
|
|
270
293
|
## Client Compatibility Matrix
|
|
271
294
|
|
|
272
|
-
| Capability | Claude Code | Claude Desktop | Cursor |
|
|
273
|
-
|
|
274
|
-
| One-command install | Yes | Yes | Yes |
|
|
275
|
-
| MCP server registration | via `claude mcp add` | via `claude_desktop_config.json` merge using `mcp-remote` stdio bridge | via `.cursor/mcp.json` merge |
|
|
276
|
-
| Backup before config write | `.bak` on `~/.claude/settings.json` | `.bak` on `claude_desktop_config.json` | `.bak` on Cursor config |
|
|
277
|
-
| Automatic conversation capture | Yes (hooks) | **No** — see [issue #8](https://github.com/amiramm/meko-mcp-server/issues/8) | Yes (hybrid hook mode) |
|
|
278
|
-
| Automatic memory persistence | Yes (hooks + skill) | Skill only (proactive `memory_add`) | Yes (hooks + skill) |
|
|
279
|
-
| Skill install | Plugin marketplace (automatic) | `.skill` bundle auto-built, user drags into app | Copy into `.cursor/skills` |
|
|
280
|
-
| Uninstall | Full automatic | MCP entry removed; skill must be removed manually from app | MCP + hooks + skills cleaned up |
|
|
281
|
-
| `agent_id` used by skill | `claude_code` | `claude_desktop` | `
|
|
282
|
-
| Transport | HTTP only | HTTP (or stdio via hand-edited config) | HTTP only |
|
|
283
|
-
|
|
|
295
|
+
| Capability | Claude Code | Claude Desktop | Cursor | Codex (CLI + App) |
|
|
296
|
+
|---|---|---|---|---|
|
|
297
|
+
| One-command install | Yes | Yes | Yes | Yes |
|
|
298
|
+
| MCP server registration | via `claude mcp add` | via `claude_desktop_config.json` merge using `mcp-remote` stdio bridge | via `.cursor/mcp.json` merge | via `codex mcp add` (CLI) or direct TOML write (App-only) |
|
|
299
|
+
| Backup before config write | `.bak` on `~/.claude/settings.json` | `.bak` on `claude_desktop_config.json` | `.bak` on Cursor config | `.bak` on `~/.codex/config.toml` and `~/.codex/AGENTS.md` |
|
|
300
|
+
| Automatic conversation capture | Yes (hooks) | **No** — see [issue #8](https://github.com/amiramm/meko-mcp-server/issues/8) | Yes (hybrid hook mode) | **No** — Codex has no user-installable hooks; AGENTS.md prompts proactive memory tool calls instead |
|
|
301
|
+
| Automatic memory persistence | Yes (hooks + skill) | Skill only (proactive `memory_add`) | Yes (hooks + skill) | Skill + AGENTS.md (proactive `memory_add`) |
|
|
302
|
+
| Skill install | Plugin marketplace (automatic) | `.skill` bundle auto-built, user drags into app | Copy into `.cursor/skills` | Copy into `~/.agents/skills/meko-mcp-tools/` |
|
|
303
|
+
| Uninstall | Full automatic | MCP entry removed; skill must be removed manually from app | MCP + hooks + skills cleaned up | MCP entry, skill dir, and AGENTS.md block all cleaned up |
|
|
304
|
+
| `agent_id` used by skill | `claude_code:<repo>` per project (via SessionStart hook); cross-project facts go to `meko_agent` | `claude_desktop` | `cursor:<repo>` per project (via Cursor hook); cross-project facts go to `meko_agent` | Whatever the agent derives by following the meko-mcp-tools skill (no hook injects an agent_id; the AGENTS.md block defers to the skill) |
|
|
305
|
+
| Transport | HTTP only | HTTP (or stdio via hand-edited config) | HTTP only | HTTP (Codex's `bearer_token_env_var` model) |
|
|
306
|
+
| Auth model | inline `Authorization: Bearer ...` header | inline header via `mcp-remote` | inline header | env-var name reference (`MEKO_API_KEY` exported in shell or via `launchctl setenv`) |
|
|
307
|
+
| Project scope | Yes (`--scope project`) | No | Yes (`--scope project`) | No (warns and degrades to user scope) |
|
|
308
|
+
| Deferred to a follow-up | — | `.mcpb` Desktop Extension packaging — see [issue #7](https://github.com/amiramm/meko-mcp-server/issues/7) | — | Auto-capture (blocked on upstream Codex exposing user-installable hooks) |
|
|
284
309
|
|
|
285
310
|
## Cloud vs Local
|
|
286
311
|
|
|
@@ -288,7 +313,7 @@ memory errs: 0 (failed memory_add calls; re-run with --force to
|
|
|
288
313
|
|---|-----------|-----------|
|
|
289
314
|
| **URL** | Provided by app.mekodev.com > Datapacks > Connect | `http://localhost:8000/mcp` |
|
|
290
315
|
| **Authentication** | Requires `--api-key` or `$MEKO_API_KEY` env var | None |
|
|
291
|
-
| **MCP registration** | Includes `-H "
|
|
316
|
+
| **MCP registration** | Includes `-H "Authorization: Bearer <key>"` header | No auth header |
|
|
292
317
|
| **Hook env vars** | Both `MEKO_MCP_URL` and `MEKO_API_KEY` written to settings | Only `MEKO_MCP_URL` written |
|
|
293
318
|
| **Infrastructure** | Hosted, no local setup needed | Requires `docker compose up -d` running the Meko stack |
|
|
294
319
|
| **Use case** | Production, team collaboration | Development, testing |
|
|
@@ -315,6 +340,97 @@ The installer auto-detects cloud vs local based on the URL: any URL containing `
|
|
|
315
340
|
|
|
316
341
|
Before modifying `~/.claude/settings.json`, the installer creates a `.bak` copy at `~/.claude/settings.json.bak`. The merge is additive: existing keys are preserved unless explicitly overridden.
|
|
317
342
|
|
|
343
|
+
## Upgrading
|
|
344
|
+
|
|
345
|
+
There is no separate upgrade command — re-running the installer is the upgrade mechanism. The steps below cover the canonical paths and what to expect.
|
|
346
|
+
|
|
347
|
+
### Upgrading via `npx` (recommended)
|
|
348
|
+
|
|
349
|
+
```bash
|
|
350
|
+
npx @yugabytedb/meko-mcp@latest
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
The `@latest` tag is load-bearing. `npx` aggressively caches the installer tarball based on semver resolution, so plain `npx @yugabytedb/meko-mcp` can silently re-run a stale cached copy and appear to do nothing. `@latest` forces a registry lookup and pulls the newest published version. This applies to every `npx @yugabytedb/meko-mcp ...` example earlier in this README — append `@latest` whenever you intend to upgrade rather than re-run the same version.
|
|
354
|
+
|
|
355
|
+
### Upgrading a globally-installed copy
|
|
356
|
+
|
|
357
|
+
If you installed via `npm install -g @yugabytedb/meko-mcp`, the `npx` path above will not touch the global copy. Update the global package first, then re-run:
|
|
358
|
+
|
|
359
|
+
```bash
|
|
360
|
+
npm update -g @yugabytedb/meko-mcp
|
|
361
|
+
create-meko-setup
|
|
362
|
+
```
|
|
363
|
+
|
|
364
|
+
### What a re-run actually does
|
|
365
|
+
|
|
366
|
+
Re-running the installer is idempotent but not inert. A re-run:
|
|
367
|
+
|
|
368
|
+
- Overwrites the `env` block in `~/.claude/settings.json` (with a `.bak` backup — see the Security section above for backup semantics and locations).
|
|
369
|
+
- Prunes stale Meko hook entries in `settings.json.hooks` that reference a prior install path (e.g., a frozen `capture.js` from an old `npx` cache or homebrew-global copy). The current install's hook entries — whether they come from the plugin (`${CLAUDE_PLUGIN_ROOT}/...`) or an absolute path matching the current `hooks-handlers/` root — are preserved. Non-Meko hooks in the same arrays are untouched.
|
|
370
|
+
- Rewrites the Cursor skill directory and hooks config if `--client cursor` is targeted.
|
|
371
|
+
- Auto-updates the skills plugin if it's already installed (via `claude plugin update meko-agent-skills@meko-agent-skills`), otherwise installs it. See "Updating the skills plugin" below.
|
|
372
|
+
- Rebuilds the Claude Desktop `.skill` bundle if `--client claude-desktop` is targeted. You must re-drag the rebuilt bundle into Claude Desktop to pick up the new skill content.
|
|
373
|
+
|
|
374
|
+
### Updating the skills plugin (Claude Code)
|
|
375
|
+
|
|
376
|
+
The `meko-agent-skills` plugin is distributed via the Claude Code plugin marketplace and versions independently of the installer npm package. Re-running the installer now picks up the latest skill definitions automatically: it probes `claude plugin list` and, when the plugin is already present, calls
|
|
377
|
+
|
|
378
|
+
```bash
|
|
379
|
+
claude plugin update meko-agent-skills@meko-agent-skills --scope <scope>
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
using the qualified `plugin@marketplace` form required by Claude Code CLI 2.1.x. Older CLIs that don't know `plugin update` fall back to an uninstall-then-install dance to achieve the same refresh. You can still run the update manually if you want to bypass the installer:
|
|
383
|
+
|
|
384
|
+
```bash
|
|
385
|
+
claude plugin update meko-agent-skills@meko-agent-skills
|
|
386
|
+
```
|
|
387
|
+
|
|
388
|
+
#### Inside an active Claude Code session
|
|
389
|
+
|
|
390
|
+
If you're already in a session and want to pull the latest skill content without exiting:
|
|
391
|
+
|
|
392
|
+
```
|
|
393
|
+
/plugin marketplace update meko-agent-skills
|
|
394
|
+
/reload-plugins
|
|
395
|
+
```
|
|
396
|
+
|
|
397
|
+
The first command refetches the marketplace's source and rebuilds the plugin cache; the second activates the new content without restarting. Run `/doctor` afterward to confirm there are no plugin load errors.
|
|
398
|
+
|
|
399
|
+
#### Enabling auto-update so future skill changes land automatically
|
|
400
|
+
|
|
401
|
+
Auto-update is **per-marketplace and disabled by default for third-party marketplaces** (only Anthropic-official marketplaces auto-update out of the box). To opt in:
|
|
402
|
+
|
|
403
|
+
1. Open the in-session `/plugin` command, switch to the **Marketplaces** tab, select `meko-agent-skills`, and toggle **Enable auto-update**.
|
|
404
|
+
2. Or set it directly in your settings file (`~/.claude/settings.json` for user scope, or a project's `.claude/settings.json`):
|
|
405
|
+
|
|
406
|
+
```json
|
|
407
|
+
{
|
|
408
|
+
"extraKnownMarketplaces": {
|
|
409
|
+
"meko-agent-skills": {
|
|
410
|
+
"autoUpdate": true
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
```
|
|
415
|
+
|
|
416
|
+
Once enabled, Claude Code refreshes the marketplace and pulls the latest plugin version on each session start. There's no global "auto-update everything" switch — opt in per marketplace.
|
|
417
|
+
|
|
418
|
+
### Checking your installed version
|
|
419
|
+
|
|
420
|
+
```bash
|
|
421
|
+
create-meko-setup --version
|
|
422
|
+
```
|
|
423
|
+
|
|
424
|
+
### Rollback
|
|
425
|
+
|
|
426
|
+
If an upgrade breaks something, restore the `.bak` backups the installer wrote before its changes:
|
|
427
|
+
|
|
428
|
+
```bash
|
|
429
|
+
cp ~/.claude/settings.json.bak ~/.claude/settings.json
|
|
430
|
+
```
|
|
431
|
+
|
|
432
|
+
See the Security section above for the full list of backup locations across Claude Code, Claude Desktop, and Cursor.
|
|
433
|
+
|
|
318
434
|
## Troubleshooting
|
|
319
435
|
|
|
320
436
|
### Claude Code CLI not found
|
|
@@ -338,14 +454,25 @@ Connection refused. Is the MCP server running?
|
|
|
338
454
|
For local Meko, ensure `docker compose up -d` has started the stack.
|
|
339
455
|
```
|
|
340
456
|
|
|
341
|
-
For local setups, confirm the stack is running and the MCP endpoint is accessible:
|
|
457
|
+
For local setups, confirm the stack is running and the MCP endpoint is accessible. Note that the `Accept` header **must** advertise both `application/json` and `text/event-stream` per the MCP Streamable HTTP spec — sending only one yields HTTP 406:
|
|
342
458
|
|
|
343
459
|
```bash
|
|
344
460
|
curl -s http://localhost:8000/mcp -X POST \
|
|
345
461
|
-H "Content-Type: application/json" \
|
|
462
|
+
-H "Accept: application/json, text/event-stream" \
|
|
346
463
|
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-03-26","capabilities":{},"clientInfo":{"name":"test","version":"1.0.0"}}}'
|
|
347
464
|
```
|
|
348
465
|
|
|
466
|
+
For cloud, swap the URL and add `-H "Authorization: Bearer $MEKO_API_KEY"`.
|
|
467
|
+
|
|
468
|
+
### HTTP 406 Not Acceptable
|
|
469
|
+
|
|
470
|
+
```
|
|
471
|
+
Server returned HTTP 406: ... "Client must accept both application/json and text/event-stream"
|
|
472
|
+
```
|
|
473
|
+
|
|
474
|
+
The MCP server is enforcing strict Streamable HTTP compliance: clients must advertise both content types in their `Accept` header. The installer does this automatically; if you see this error, you're likely on an older installer release. Upgrade with `npx @yugabytedb/meko-mcp@latest`.
|
|
475
|
+
|
|
349
476
|
### Authentication failure (401 / 403)
|
|
350
477
|
|
|
351
478
|
```
|
|
@@ -354,6 +481,8 @@ Server returned 401. Verify your API key is correct and has not expired.
|
|
|
354
481
|
|
|
355
482
|
- Confirm the API key at app.mekodev.com > Datapacks > Connect.
|
|
356
483
|
- If using `$MEKO_API_KEY` env var, ensure it is exported in the current shell.
|
|
484
|
+
- Confirm the key environment matches the URL: PATs minted on `app.mekodev.com` only validate against `mcp.mekodev.com`; PATs minted on `cloud.mekodata.ai` only validate against `mcp.mekodata.ai`.
|
|
485
|
+
- The installer normalizes API keys (trims surrounding whitespace and a single matching pair of quotes) so a paste with a trailing newline or a literal `"…"` from a `.env` file is fine — but your raw shell variable might still be contaminated. Echo it (`echo "[$MEKO_API_KEY]"`) and check the brackets bracket the key tightly with no extra characters.
|
|
357
486
|
- Re-run the installer interactively to re-enter the key.
|
|
358
487
|
|
|
359
488
|
### Plugin marketplace already registered
|
|
@@ -380,10 +509,10 @@ cp ~/.claude/settings.json.bak ~/.claude/settings.json
|
|
|
380
509
|
### Missing core tools
|
|
381
510
|
|
|
382
511
|
```
|
|
383
|
-
Missing core tools: memory_search, conversation_create. Found 0 tool(s) total.
|
|
512
|
+
Missing core tools: memory_search, memory_get_by_id, conversation_create. Found 0 tool(s) total.
|
|
384
513
|
```
|
|
385
514
|
|
|
386
|
-
The MCP server responded but does not expose the expected tools (`memory_search`, `conversation_create`, `db_summarize_database`). This usually means a server version mismatch. Update the MCP server or check which datapack is connected.
|
|
515
|
+
The MCP server responded but does not expose the expected tools (`memory_search`, `memory_get_by_id`, `conversation_create`, `db_summarize_database`). This usually means a server version mismatch. Update the MCP server or check which datapack is connected. `memory_get_by_id` is used by the canary round-trip for direct-row verification (see [Post-install validation](#post-install-validation-canary-round-trip) above), so an older server that exposes `memory_search` but not `memory_get_by_id` will fail the canary check.
|
|
387
516
|
|
|
388
517
|
### DNS lookup failed
|
|
389
518
|
|
|
@@ -457,7 +586,7 @@ node installer/bin/create-meko-setup.mjs --uninstall --verbose
|
|
|
457
586
|
| # | Scenario | Steps | Expected Result |
|
|
458
587
|
|---|----------|-------|-----------------|
|
|
459
588
|
| M1 | Fresh local install | `node installer/bin/create-meko-setup.mjs --local --yes` with docker stack running | All 5 steps pass, validation shows 3 green checks |
|
|
460
|
-
| M2 | Fresh cloud install | Run interactively, provide Cloud Meko URL + API key | MCP registered with
|
|
589
|
+
| M2 | Fresh cloud install | Run interactively, provide Cloud Meko URL + API key | MCP registered with `Authorization: Bearer` header, env vars set, validation passes |
|
|
461
590
|
| M3 | Existing config | Run installer when `meko` MCP is already registered | Prompts to overwrite; answering No keeps existing config |
|
|
462
591
|
| M4 | No claude CLI | Run on a machine without `claude` in PATH | Exits with error message and install link |
|
|
463
592
|
| M5 | Server unreachable | Install with `--skip-validation`, then re-run without it | Install succeeds; validation warns about connectivity |
|
|
@@ -486,17 +615,27 @@ installer/
|
|
|
486
615
|
create-meko-setup.mjs # CLI entry point (arg parsing, orchestration)
|
|
487
616
|
lib/
|
|
488
617
|
installer.mjs # Shared multi-client orchestration
|
|
489
|
-
clients/ # Per-client adapters (claude-code/desktop/cursor)
|
|
490
|
-
claude-code.mjs # Backward-compatible Claude wrapper
|
|
618
|
+
clients/ # Per-client adapters (claude-code/desktop/cursor), aliases, common helpers
|
|
491
619
|
config.mjs # Safe JSON read/merge/write + path helpers
|
|
492
620
|
detect.mjs # Claude CLI and existing config detection
|
|
493
621
|
logger.mjs # ANSI-colored console output (respects NO_COLOR)
|
|
494
622
|
prompt.mjs # Interactive readline prompts (choice, text, secret, yes/no)
|
|
495
|
-
validate.mjs # Post-install validation (config, connectivity, tools)
|
|
623
|
+
validate.mjs # Post-install validation (config, connectivity, tools, canary)
|
|
624
|
+
migrate.mjs # Migrate subcommand orchestration + per-datapack state
|
|
625
|
+
migrate/
|
|
626
|
+
id.mjs # datapackKeyFromUrl + agent-id / seed helpers
|
|
627
|
+
orchestrator.mjs, daemon.mjs, state.mjs, progress.mjs, lockfile.mjs, logger.mjs
|
|
628
|
+
claude-parser.mjs, mcp-client.mjs, adapters/
|
|
629
|
+
scripts/
|
|
630
|
+
bundle-assets.mjs # prepack: copy skill/hook assets into the npm tarball
|
|
631
|
+
prepublish-smoke.sh # Pre-publish smoke harness (run before `npm publish`)
|
|
496
632
|
test/
|
|
497
633
|
config.test.mjs # Unit tests for JSON merge/read/write
|
|
498
|
-
clients.test.mjs # Unit tests for cursor
|
|
499
|
-
validate.test.mjs # Unit tests for validation logic
|
|
634
|
+
clients.test.mjs # Unit tests for cursor/claude-code/desktop adapters
|
|
635
|
+
validate.test.mjs # Unit tests for validation logic (including the canary round-trip)
|
|
636
|
+
migrate.test.mjs # Unit tests for migrator + datapackKeyFromUrl helper
|
|
637
|
+
migrate-integration.test.mjs # Integration tests for migrator scoping + legacy state back-compat
|
|
638
|
+
prepublish-smoke.test.mjs # Piped-stdin smoke tests, gated by SMOKE_HARNESS=1
|
|
500
639
|
installer.test.mjs # Integration tests for full install flow
|
|
501
640
|
fixtures/ # Mock settings files for tests
|
|
502
641
|
```
|
|
@@ -520,12 +659,26 @@ npm run test:integration
|
|
|
520
659
|
export MEKO_TEST_CLOUD_URL=https://<your-mcp>.mekodev.com/mcp
|
|
521
660
|
export MEKO_TEST_API_KEY=<your-cloud-api-key>
|
|
522
661
|
npm run test:integration:cloud
|
|
662
|
+
|
|
663
|
+
# Pre-publish smoke harness: npm pack → install tarball into a throwaway
|
|
664
|
+
# $HOME → exercise the installed CLI (`--version`, `--help`, `--dry-run`)
|
|
665
|
+
# via both the raw node entry and the `node_modules/.bin/meko-mcp` symlink
|
|
666
|
+
# that `npx` resolves through. Gated piped-stdin tests in
|
|
667
|
+
# `test/prepublish-smoke.test.mjs` (SMOKE_HARNESS=1) are run by the harness.
|
|
668
|
+
npm run smoke
|
|
523
669
|
```
|
|
524
670
|
|
|
525
671
|
The cloud round-trip tests point the installer at a throw-away `$HOME` via
|
|
526
672
|
`spawnSync`, so the developer's real `~/.claude/settings.json` is never
|
|
527
673
|
modified. They skip cleanly when either env var is unset.
|
|
528
674
|
|
|
675
|
+
The pre-publish smoke harness is the last gate before `npm publish`. See
|
|
676
|
+
[`RELEASING.md`](../RELEASING.md) at the repo root for the full release
|
|
677
|
+
procedure (version bump → smoke harness → manual TTY checklist → tag → CI
|
|
678
|
+
publish workflows). A CI workflow at `.github/workflows/prepublish-smoke.yml`
|
|
679
|
+
runs the harness on Ubuntu and macOS for every push to a `release/*`
|
|
680
|
+
branch.
|
|
681
|
+
|
|
529
682
|
### Design Principles
|
|
530
683
|
|
|
531
684
|
- **Zero external dependencies** -- Node.js built-ins only (`fs`, `path`, `readline`, `child_process`, `url`, `http`, `https`, `os`, `node:test`, `node:assert`), matching the pattern of `capture.js`.
|