@yawlabs/mcp 1.1.13 → 1.1.15

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 CHANGED
@@ -4,6 +4,68 @@ All notable changes to `@yawlabs/mcp` (formerly `@yawlabs/mcph`) are documented
4
4
 
5
5
  ## Unreleased
6
6
 
7
+ ## 1.1.15
8
+
9
+ **Added -- vault recovery codes**
10
+
11
+ A vault created at a terminal now comes with a recovery code: `yaw-mcp secrets set` (on a new vault) and `secrets reset` show a `YAWR-` code once, on an alternate screen, and ask you to type two of its seven groups back before anything is saved. `yaw-mcp secrets recover` takes that code in place of a forgotten passphrase, sets a new passphrase (from `YAW_MCP_VAULT_PASSPHRASE_NEW` or a confirm-twice prompt, never `YAW_MCP_VAULT_PASSPHRASE`) and keeps every entry; `recover --file <path>` brings back a copy `reset` moved aside, and refuses (exit 2) while a vault sits at the vault path. In an AI agent session `recover` exits 2 unless `--no-recovery`, since its new code could not be shown. `secrets recovery new` adds or replaces the code and `secrets recovery remove` drops it. The code is shown only on the terminal you are typing at -- never in a redirected or captured stdout, a `--json` envelope, a log or the audit log -- and never when `CLAUDECODE` or `AI_AGENT` is set; there, off a terminal, and after `set --stdin` has read stdin to its end, the vault is created without one and a one-line nudge (`{"warning":"no-recovery-code"}` under `--json`) says to add one with `recovery new`. An argument refusal never repeats a token shaped like a recovery code. `--no-recovery` skips it on `secrets set`, `reset`, `rotate` and `recover`, and on `yaw-mcp set <server> env.KEY --secret` and `yaw-mcp add --git` for the vault their secret store may create. `yaw-mcp completion` offers `new` and `remove` after `secrets recovery`. Everything stays local. The `set`, `reset`, `rotate`, `recover` and `recovery` `--json` envelopes gain `recovery: "set" | "none"`, and `yaw-mcp set <server> env.KEY --secret --json` relays it in its `secret` object. `secrets audit` records `recovery-issued`, `recovery-used`, `recovery-removed` and `vault-rekeyed` events (no server, no secret name, never the code). A wrong passphrase on a vault with a code now points at `recover` before `reset`, and `reset` says, on every path including `--force`, when the vault has a code that would keep its entries.
12
+
13
+ **Breaking -- vault schema v3, and `rotate` on a vault with a recovery code**
14
+
15
+ New vaults are written as schema v3: entries are encrypted under a random data key that the passphrase (and the recovery code, when there is one) wraps. `rotate`, `recover`, `recovery new` and `recovery remove` all re-encrypt every entry under a FRESH data key, so an old passphrase, an old code or a backup of the old file opens only the old file. `rotate` and `recovery new` upgrade a v1 or v2 vault to v3; every other command leaves it as it is, and the schema-behind notice now says per version what is missing (its `--json` line gains `missing`, and `upgrade` becomes the list of commands that upgrade). A yaw-mcp of 0.73.1 or later reading a v3 vault says it was written by a newer yaw-mcp; **0.73.0 and earlier report a v3 vault as a wrong passphrase** -- upgrade every yaw-mcp that reads the vault, including the one your MCP client launches, before rotating or creating one. `rotate` on a vault that has a recovery code issues a new code, so off a terminal (or in an agent session) it now exits 2 unless `--no-recovery`, which rotates and drops the code with a warning. `rotate`'s `--json` envelope gains `recovery`; its prose line now says "a fresh data key (encryption re-keyed)".
16
+
17
+ **Breaking -- exit codes, refusals and what `import` brings across**
18
+
19
+ `yaw-mcp import <client>` on a client config that does not exist or is empty now prints `Nothing to import: <file> does not exist` (or `is empty`) on stdout and exits 0; it used to print an error on stderr and exit 1. A client with no config is the same expected state as one whose file holds no servers, and exit 1 failed a setup script that imports from every client on the first one the user does not have. A script that used the exit code to detect a missing config (or a mistyped `--project-dir`) must read the output instead. A config that cannot be read or does not parse still exits 1.
20
+
21
+ `yaw-mcp import claude-code` and `import cursor` now skip a server written with a variable the client expands itself -- Claude Code's `${VAR}` and `${VAR:-default}`, Cursor's `${env:NAME}`, and Cursor's `${workspaceFolder}` and `${workspaceFolderBasename}` in its user-scope file -- as `import vscode` and `import cline` already did for theirs. Cursor's `${userHome}`, `${pathSeparator}` and `${/}` are filled in from this machine, and its workspace variables from the project directory. Each skipped server is named on stderr with the spans that caused it, and the exit code is unchanged. These used to be imported with the literal text, which gave a server that could not start; the skip names how to add one by hand for its shape: `yaw-mcp add <name> --command ... --env KEY='${secret:NAME}'` for a local server, `yaw-mcp add <name> --url <url> --header 'Authorization: Bearer ${secret:NAME}'` for a variable in a header, and, for a variable in a url (where `${secret:NAME}` is not filled in), the value written into the url. When every server in the file was skipped, the run says `Nothing imported: every server in <file> was skipped` rather than that the file holds none. For a client with no such rule (Windsurf, for one) an entry carrying `${...}` is still imported as it stands, now with a warning naming the spans. `import` also skips, as yaw-mcp's own, any entry that launches yaw-mcp under another key (`claude mcp add yaw -- npx -y @yawlabs/mcp@latest`, or a `cmd /c` whose program is the `yaw-mcp` bin; a later argument named yaw-mcp, such as a directory, does not count); it used to import it as a server of itself, and such an entry now counts as the wiring `--remove-originals` requires. On Windows an entry stored under the other drive-letter case of the project path counts as that wiring too. A credential in a stored git url, or in the url an entry with a command loses, is no longer printed by `import`.
22
+
23
+ `yaw-mcp enable`, `disable` and `set` no longer reshape a target into a namespace unless it already has the shape of a slug or namespace (lowercase letters, digits, `-` and `_`): `disable "???"` used to edit whatever entry held the namespace `server`, and `enable GitHub` reached `github` where `remove GitHub` refused. A target of any other shape that matches no stored namespace, slug or name now exits 2. A slug-shaped target is still reshaped as before (`enable my-tool` reaches `mytool`), and a stored namespace, slug or name still resolves exactly as before, which is what the README documents.
24
+
25
+ `yaw-mcp audit <namespace>` exits 4, with `could not load <path>`, when bundles.json exists but cannot be loaded; it used to exit 1, the code for "no server with that namespace". No bundles.json at all is still exit 1. `audit` of a git server that is not built yet exits 2 with a message saying so, instead of failing with a spawn `ENOENT`. The README now lists `audit`'s exit codes.
26
+
27
+ `yaw-mcp doctor` exits 2 in two cases it used to pass. A client entry for yaw-mcp with no launch command and no url (`"mcp": {}`) is reported as `has "mcp" entry, but it has no launch command`, and `doctor --json` client probes gain a `launchNoCommand` field. And the launch checks now run on the entry as the client's own format normalises it, so a Cline entry in the nested `transport` form is checked (a bare `oam`, a missing entry file) where it was passed unread.
28
+
29
+ The secret vault refuses a vault file whose `version` is not a whole number of 1 or more, as corrupt; version 1 and a file with no version still load. A `state.json` written at a schema version newer than this build's is no longer overwritten: yaw-mcp persists no learning state for that session and says so once at load and once when it first skips a save, so an older copy running beside a newer one cannot erase its state; that older copy also stops retrying the skipped save every second. `yaw-mcp reset-learning` no longer prints the state loader's own warning ahead of its message.
30
+
31
+ `yaw-mcp try` and `try-cleanup` answer `Unknown flag: -x` for an unknown single-dash argument, which used to be taken as a positional.
32
+
33
+ **Changed -- routing, discovery and the meta-tools**
34
+
35
+ `mcp_connect_exec` references read a numeric segment on a plain object as a key, so `a.byYear.2024` and `a.ids.007` resolve; a missing one reports `no property "2024"`. Bracket `[n]` is still for arrays only. `mcp_connect_discover`'s usage line prints the number of calls (`used 4x`), not the rounded success credit, and a blank `server` argument is treated as no focus. `mcp_connect_read_tool` and a focused `discover` now count as use of that server for idle eviction. `mcp_connect_bundles` and discover's completions line no longer list a disabled or profile-blocked member as missing: they say `disabled: ... (installed; enable with: yaw-mcp enable ...)` and `blocked by the project profile`. `yaw-mcp bundles match` does the same in its text rows (`missing:`, `disabled:` and `blocked by profile:` segments), and its `--json` partial entries gain `notInstalled`, `disabled` and `blocked` arrays beside the unchanged `missing`. The discover and `bundles match` headers no longer tell you to install when the gap is only a disabled or profile-blocked member. `mcp_connect_health` shows at most five tool names per loaded server, then `(+N more)`. The token-cap refusal says so when one server alone exceeds the ceiling, and points at `mcp_connect_read_tool` and `YAW_MCP_TOOL_TOKEN_CAP` instead of advising a deactivate.
36
+
37
+ Routing learns differently in two places. A re-dispatch is compared with the earlier query after function words are dropped from both, which changes which re-dispatches count as a miss against the first server. The reward grader takes a bare verdict word only when it is in capitals, opens a line or ends one; a lowercase verdict in mid-sentence now gives no grade instead of a guess. The CLI shadow table gains `npm info`, `whoami`, `profile` and `token`, and `mongodump`.
38
+
39
+ **Changed -- spawning and proxying**
40
+
41
+ `MCP_CALL_TIMEOUT` now bounds proxied `resources/read` and `prompts/get` as well as `tools/call`; those two used the SDK default with no override. An edit to `defaultRuntime` in bundles.json is picked up by a running yaw-mcp on the next connect instead of being cached for the life of the process. On Windows, a server env key that matches one of yaw-mcp's own ignoring case (`Path` against `PATH`) replaces every spelling, so the server's value wins. A server entry with no `command` or `url` fails activation with the `Fix "<namespace>" in <file>` pointer, and a git server that is not built yet says to build it and activate again, with no client restart. A slow uv or oam runtime resolution prints a progress line every 5 seconds. The two "also failed" warnings log `oamCategory` and `nodeCategory`, or `managedCategory` and `npxCategory`, in place of a single `category` field. Default result pruning keeps an array that prunes to nothing as `[]` rather than `null`.
42
+
43
+ **Changed -- `install`, `uninstall` and client configs**
44
+
45
+ `install` run from a temporary copy (npx) keeps the entry file a stored `oam run` entry already names when that file is a real installed copy, instead of rewriting the entry to npx. Cline targets on Linux follow an absolute `$XDG_CONFIG_HOME`. A bare `install --dry-run` over a differing entry says the overwrite happens `only with --repair or --force` and that the preview assumes the flag. `uninstall --os <other> --dry-run` prints the target path and a `Not inspected` line instead of `Nothing to do`, and the command it suggests keeps `--scope`. `uninstall`'s preview shows the launch and env keys of a Cline entry in the nested `transport` form. A refused client config is described as `not a JSON object` or `not a TOML table`. The `--token` and config `token` deprecation notes, and `--help`, no longer send you to revoke the token: the hosted service that issued it is retired, so deleting it is all there is to do. The stable entry path is no longer taken from a per-session directory (`fnm_multishells/`, `/run/user/<uid>/`), so an install under fnm writes a path that survives the shell. A `~/.yaw-mcp/` that yaw-mcp creates is created mode `0700`. `yaw-mcp import gemini-cli` now imports a server stored with `httpUrl` as a streamable-HTTP remote (the `httpUrl` wins over a `url` beside it, whatever `type` says); it used to be skipped as having no command or url.
46
+
47
+ **Changed -- `add`, `update`, `secrets` and `sidecars`**
48
+
49
+ `add <slug> --description` now applies on a catalog add, where it was ignored. Re-adding a server with a different launch drops its stored compliance grade, and converting an entry to git drops its stored optional-env marker. `add` names the stored env keys a conversion to a remote server deletes, on a real run and under `--dry-run`. An `add --git` whose start check throws now writes the entry and exits 1 with `"started":false`, as for any failed check; the throw used to escape and leave a build with no entry. A git build that fails before its build step records the step as `layout`, which `doctor` prints. A stored git url that carries a credential in its userinfo is printed with it replaced by `***` in `list --json`, `add --json`, the removal preview and the launch-change note; a bare username (`ssh://git@host/...`) is printed as stored. `update` on an invalid bundles.json reports the line and column and that nothing was written. Warning text from `audit`, `discover` and `health` redacts URL userinfo and `key=` query values.
50
+
51
+ `secrets` counts a git entry's `git.tokenSecret` as a use of that secret, and `secrets reset` names the passphrase's real source. `sidecars` no longer reports a bare package name and `name@latest` as a version conflict, and its failure lines say whether an existing managed install stays in use. A malformed `${secret:...}` reference is quoted up to 27 characters (was 40). `search` prints control characters in catalog text as `?`, and a newline or tab as a space. `foundry export` reports a harvest it cannot read as such instead of as absent. The `trust --revoke` error names `YAW_MCP_ALLOW_UNOWNED_PROJECT_DIRS` only on Windows.
52
+
53
+ **Changed -- `secrets` prompts under `--json`, `--` before a name, and `mcp_connect_secrets` on an unreadable vault**
54
+
55
+ Under `--json`, the passphrase and value prompts, `reset`'s preamble and the retry lines now go to stderr, so stdout carries only the JSON document; a prompt then needs stdin and stderr at a terminal and ignores stdout, so `yaw-mcp secrets get GH --json > out.json` still asks for the passphrase. When no prompt can be shown, the refusal names the end that is not a terminal, and a terminal user who used up the three attempts is told that rather than to "run from a TTY". `secrets get`, `set` and `remove` accept `--` before the name, so a name that starts with `-` can be reached. `mcp_connect_secrets` on a vault that cannot be read now returns the JSON rows alone as the first content item and the status text as the second, still as an error, matching the shape for a missing vault; it used to put both in one text item and report every referenced name as missing.
56
+
57
+ **Fixed -- the secret vault: key handling, the passphrase prompt and the server's vault paths**
58
+
59
+ A server that asked for the vault passphrase while no vault existed, or while it could not be read, kept whatever was typed as the session passphrase and stopped asking, so a vault created later under another passphrase failed every server until a restart; a passphrase that could not be checked is no longer kept, and a missing, unreadable or empty vault now fails before any prompt, naming the missing secrets. A server whose passphrase was verified, and whose vault was then rotated or reset by another process, now says the vault was re-keyed and to restart the client, without booking an activation failure. A corrupt check marker reached from a server or a git token now carries the same hand-fix the CLI prints, the server's refusals say "headers" for a remote server, and the cached key is cleared at shutdown. On a vault created before passphrases were normalized, a damaged check marker is reported as damaged rather than as a wrong passphrase, which `secrets reset` would have acted on, and a vault keyed on the decomposed form of an accented passphrase opens when it is typed composed. An empty vault with no check marker is keyed under a fresh salt and this build's cost settings on its first `set`, instead of whatever the file recorded. Derived keys are zeroed on every failed attempt and when replaced, no longer sit in Node's shared buffer pool, and concurrent unlocks share one key derivation; a `lock()` during an unlock is no longer undone when the derivation finishes. The passphrase prompt restores the terminal if its setup fails, no longer leaves stdin in string mode, keeps non-ASCII characters typed after an Alt+`[`, no longer swallows a Ctrl+J as the first key of the next prompt, and hands back the bytes typed after Enter unchanged. A `secrets reset` an embedder calls with an empty passphrase is refused before the RESET confirmation, and `yaw-mcp set <server> env.KEY --secret` passes its stderr stream through to the vault prompts.
60
+
61
+ **Fixed -- background upgrade and shutdown**
62
+
63
+ The background self-upgrade does nothing for a global npm install whose prefix it cannot resolve, where it used to run npm without `--prefix`, and it removes an upgrade lock it created but could not finish writing, which used to block later upgrades. When `server.shutdown()` rejects, yaw-mcp logs `Shutdown failed` and exits 1 at once instead of waiting for the 10-second watchdog. Activating over a connection in an error state closes the displaced upstream, so its child process does not linger, and a failed background tool-list refresh backs off instead of retrying on every sweep.
64
+
65
+ **Internal -- `release.sh` and the verify scripts**
66
+
67
+ Not part of the published package. `release.sh` ignores a `## ` line inside a fenced code block when it reads CHANGELOG.md, refuses to push when `server.json` or `package.json` no longer carries the registry identity (`io.github.YawLabs/mcp`, `@yawlabs/mcp`), requires `scripts/is-main-module.mjs` in its pre-flight, and no longer suggests a login command under a directory it deletes on exit. `.oam-eval-*.cjs` is ignored by git.
68
+
7
69
  ## 1.1.13
8
70
 
9
71
  **Changed -- MCP SDK moves to `@modelcontextprotocol/server` 2.4.0 and `@modelcontextprotocol/sdk` 1.32.2**
package/README.md CHANGED
@@ -203,7 +203,7 @@ yaw-mcp trust [--yes|--list|--revoke [<path>]] # approve the project-local .
203
203
 
204
204
  `add` is not `install`: `install <client>` connects an AI client to yaw-mcp; `add <slug>` adds an MCP server to yaw-mcp itself. `try` points the client directly at the upstream server, bypassing yaw-mcp, so you can evaluate it in isolation. `try-cleanup`, and `doctor` for an expired trial, take the entry back out of the client's config, Codex CLI's `config.toml` included; when `try-cleanup` cannot, it keeps the trial and exits 1 rather than report a cleanup that did not happen. A `--env` value lands in your shell history and process argv like any argument. With `add` it is stored in plain text in `bundles.json` (written owner-only, mode `0600`, on macOS and Linux; on Windows that mode is not applied -- Node maps it to the read-only attribute only -- so the file is protected by the NTFS permissions it inherits from your user profile) -- keep real credentials in the [local secret vault](#local-secret-vault) and pass `--env KEY='${secret:NAME}'` instead (the single quotes are for bash, zsh and PowerShell; in cmd.exe pass it unquoted, since `$` is not special there and cmd.exe would keep the quotes as part of the value). A `missing` row in `yaw-mcp secrets audit` whose name starts with `<malformed ref>` is a reference that did not parse -- fix the typo in `bundles.json`. With `try` the value is written inline, in plain text, into the client's own config for the trial's lifetime, and is not vault-resolved (the client spawns the server, not yaw-mcp).
205
205
 
206
- **Servers you already have.** If a client is already configured with MCP servers, `yaw-mcp import <client>` reads that client's own config and adds every server in it to your `bundles.json` -- command, args, url, headers and env as they stand, so the imported server starts exactly as it did before. yaw-mcp's own entry is never imported. A server `bundles.json` already has is merged, the client's copy winning; when that would change the stored entry, `import` shows what differs and asks first on a terminal (`[o]verwrite`, `[s]kip` or `[a]bort`, and a bare Enter skips that server), and off one it writes nothing and exits 2 unless you pass `--force`. `--dry-run` shows what would come across without writing anything, and with `--remove-originals` it also lists the client entries a real run would remove, or says why it would remove none.
206
+ **Servers you already have.** If a client is already configured with MCP servers, `yaw-mcp import <client>` reads that client's own config and adds every server in it to your `bundles.json` -- command, args, url, headers and env as they stand, so the imported server starts exactly as it did before. yaw-mcp's own entry is never imported, under any key that launches it. One kind of server is skipped, by name and with the reason on stderr: one written with a variable its client expands itself and yaw-mcp cannot -- VS Code's `${input:...}`, `${env:...}` and every other variable except `${workspaceFolder}` and `${workspaceFolderBasename}` in a workspace file; Cline's `${env:...}`; Cursor's `${env:...}`, plus `${workspaceFolder}` and `${workspaceFolderBasename}` in its user-scope file; Claude Code's `${VAR}` and `${VAR:-default}`. (Cursor's `${userHome}`, `${pathSeparator}` and `${/}` are filled in from this machine, and the workspace variables from the project directory.) yaw-mcp expands only `${secret:NAME}`, so such an entry would launch with the literal text; add it by hand with the value -- `yaw-mcp add <name> --command ... --env KEY='${secret:NAME}'` for a local server, `yaw-mcp add <name> --url <url> --header 'Authorization: Bearer ${secret:NAME}'` for a variable in a header. A variable in a url has no `${secret:NAME}` form (yaw-mcp fills those in only in env and headers), so write the value into the url, or send it as a header if the server accepts one. The skip does not change the exit code; when it took every server, the run says `Nothing imported` rather than that the file holds none. A config file that does not exist or is empty is not an error either: `import` says there is nothing to import and exits 0, while a file it cannot read or parse exits 1. A server `bundles.json` already has is merged, the client's copy winning; when that would change the stored entry, `import` shows what differs and asks first on a terminal (`[o]verwrite`, `[s]kip` or `[a]bort`, and a bare Enter skips that server), and off one it writes nothing and exits 2 unless you pass `--force`. `--dry-run` shows what would come across without writing anything, and with `--remove-originals` it also lists the client entries a real run would remove, or says why it would remove none.
207
207
 
208
208
  From Codex CLI, a server stored with `enabled = false` is imported switched off (`"isActive": false`), so it does not load until `yaw-mcp enable <namespace>`; the run says which ones. A Codex key `bundles.json` has no field for (`cwd`, `startup_timeout_sec`, `enabled_tools`, ...) is not carried over, and each one is named in a warning.
209
209
 
@@ -256,6 +256,8 @@ yaw-mcp compliance <target> # run the compliance suite (88 tests on 2025-11-25
256
256
  yaw-mcp audit <namespace> # audit a stdio server from bundles.json, cache its A-F grade in grades.json
257
257
  ```
258
258
 
259
+ `audit` exit codes: `0` graded and cached; `1` no server with that namespace in bundles.json; `2` nothing was graded (not a stdio server, a git-sourced server not built on this machine -- run `yaw-mcp sidecars install` --, a `${secret:NAME}` the vault could not resolve, a Windows command the suite's shell would split, or the suite ran and failed); `3` graded and printed, but grades.json could not be written; `4` bundles.json exists but could not be loaded, so the namespace could not be looked up.
260
+
259
261
  `heal` exists for the entry that pins a path (see [Running yaw-mcp on oam](#running-yaw-mcp-on-oam)): an app upgrade that deletes the directory the path named leaves the client unable to start the broker, and the client cannot report that because it cannot start the thing that would. The broker runs the same sweep at every startup, cross-client, so a client whose entry still works repairs the ones that do not; `heal` is for the machine whose only configured client is the broken one. It touches only an oam entry that points into an `@yawlabs/mcp` package tree and whose launch file is missing or not a file (a hand-written entry of that shape included) -- a working entry is never rewritten, however unusual it looks -- and prints each old and new path. A stale entry it finds and cannot re-point -- a read-only config file on Windows, say -- is reported on stderr with the step past it, listed under `failed` in `--json`, and makes the run exit 1. `--dry-run` reports without writing; `--quiet` keeps the exit code and `--json` and drops the transcript. `YAW_MCP_AUTO_HEAL=0` turns the startup sweep off; `YAW_MCP_READONLY_DIAGNOSTICS=1` turns both off.
260
262
 
261
263
  To install completion, redirect to your shell's completions dir, e.g. `yaw-mcp completion zsh > "${fpath[1]}/_yaw-mcp"`, or `yaw-mcp completion powershell >> $PROFILE`.
@@ -440,14 +442,19 @@ yaw-mcp secrets get <name> # decrypt and print one value
440
442
  yaw-mcp secrets list # show entry NAMES only (values stay encrypted)
441
443
  yaw-mcp secrets remove <name> # delete an entry
442
444
  yaw-mcp secrets lock # forget this process's cached passphrase -- effectively a no-op from the CLI; cannot reach a running server or change the vault
443
- yaw-mcp secrets rotate # re-encrypt the whole vault under a NEW passphrase
444
- yaw-mcp secrets reset # forgot the passphrase? move the vault aside, list its entry names, start a new one
445
+ yaw-mcp secrets rotate # re-encrypt the whole vault under a NEW passphrase and a fresh data key
446
+ yaw-mcp secrets recover # forgot the passphrase? the recovery code gets you back in, every entry kept
447
+ yaw-mcp secrets recovery new # add (or replace) the vault's recovery code -- needs a terminal
448
+ yaw-mcp secrets recovery remove # drop the recovery code
449
+ yaw-mcp secrets reset # forgot the passphrase AND have no code? move the vault aside, list its entry names, start a new one
445
450
  yaw-mcp secrets audit [--secret NAME] [--server NS] [--json] # who consumed which secret, when
446
451
  ```
447
452
 
448
- The passphrase derives the key via scrypt and is cached in memory for one process; the on-disk file holds only ciphertext (AES-256-GCM, per-entry IV + tag, one vault salt). `rotate` decrypts every entry first and aborts untouched if any fails -- and it re-wraps the **encryption**, not the underlying tokens (a leaked token is still leaked; rotate it at its source). `audit` reads an append-only NDJSON log (mode `0600` on macOS and Linux; Windows does not apply that mode, so it inherits your profile's NTFS permissions) of secret NAME + namespace + timestamp -- never a value -- and writes fail-open so a broken log never blocks a spawn. Under `--json`, `secrets` prints its result as one JSON line on stdout and puts warnings, and on failure the `{"ok":false,"error":...}` envelope, on stderr as one JSON object per line; an argument error also puts one compact line on stdout, `{"ok":false,"error":"<message>","exitCode":2}`, carrying the same message.
453
+ Entries are encrypted (AES-256-GCM, per-entry IV + tag) under a random data key; the passphrase -- through scrypt -- and, optionally, a recovery code each wrap that key in a key slot, and the derived key is cached in memory for one process. The on-disk file holds only ciphertext. `rotate` decrypts every entry first and aborts untouched if any fails; it then re-encrypts everything under a **fresh** data key, so the old passphrase, an old recovery code and any backup of the old file open only the old file. It re-keys the **encryption**, not the underlying tokens (a leaked token is still leaked; rotate it at its source). `rotate` and `recovery new` also upgrade a vault written by an older yaw-mcp (schema v1 or v2) to the current schema, v3; every other command leaves the file as it is and says so on stderr. A yaw-mcp of 0.73.1 or later that meets a v3 file says it was written by a newer yaw-mcp; 0.73.0 and earlier report it as a **wrong passphrase** -- upgrade every yaw-mcp that reads the vault (your MCP client launches one) before you upgrade the vault. `audit` reads an append-only NDJSON log (mode `0600` on macOS and Linux; Windows does not apply that mode, so it inherits your profile's NTFS permissions) of secret NAME + namespace + timestamp -- never a value -- and writes fail-open so a broken log never blocks a spawn. Under `--json`, `secrets` prints its result as one JSON line on stdout and puts warnings, and on failure the `{"ok":false,"error":...}` envelope, on stderr as one JSON object per line; an argument error also puts one compact line on stdout, `{"ok":false,"error":"<message>","exitCode":2}`, carrying the same message. At a terminal, `--json` sends the interactive prompts (passphrase, value, confirmations) to stderr, so stdout carries the envelope and nothing else; a prompt then needs stdin and stderr to be the terminal and ignores stdout, so `yaw-mcp secrets get GH --json > out.json` still asks for the passphrase. A secret name that starts with `-` goes after a `--` end-of-options marker: `yaw-mcp secrets get -- -name`.
454
+
455
+ **Recovery code.** Creating a vault at a terminal (the first `secrets set`, or `reset`) shows a recovery code -- `YAWR-` and seven groups of four -- once, on an alternate screen that clears afterwards, and asks you to type two of its groups back before anything is saved; three wrong tries or Ctrl-C save nothing. Write it down and keep it apart from the passphrase: it opens the vault on its own. It is shown only on the terminal you are typing at -- never in a redirected or captured stdout, a `--json` envelope, a log or the audit log -- and never when an AI agent drives the command (`CLAUDECODE` or `AI_AGENT` set): there, off a terminal, and when `set --stdin` has read the value from stdin to its end, the vault is created without one and a one-line nudge says to run `yaw-mcp secrets recovery new` at a terminal. `--no-recovery` creates a vault without one on purpose; `yaw-mcp set <server> env.KEY --secret` and `yaw-mcp add --git` accept it too, for the vault their secret store may create. `recovery new` adds or replaces the code and `recovery remove` drops it; both re-key the vault, so the old code stops working. `rotate` gives a vault that has a code a new one, so it needs a terminal for that vault -- or `--no-recovery`, which drops the code. It is all local: no server, email or account is involved. No MCP tool ever accepts or shows a recovery code.
449
456
 
450
- **Forgot the passphrase?** There is no recovery: the file holds only ciphertext under a key derived from the passphrase, and nothing else -- no server, no recovery key -- can open it. `yaw-mcp secrets reset` is the way back to a working vault. It prints the entry names the vault holds (plaintext keys, so no passphrase is needed) so you know what to set again, asks you to type `RESET` (or takes `--force` from a script; without it, no TTY means a refusal), moves the old file aside as `secrets.json.reset-<timestamp>` next to the vault -- it still opens under the old passphrase, should that turn up -- and creates an empty vault under a new passphrase, confirmed twice on a TTY or taken from `YAW_MCP_VAULT_PASSPHRASE` when it is set. It refuses when the passphrase it is given already opens the vault: that is `rotate`, not a reset. Afterwards, a yaw-mcp server that is already running keeps the passphrase it started with and needs a restart, and a `YAW_MCP_VAULT_PASSPHRASE` in a client config's `env` block still holds the old value. `yaw-mcp doctor` says whether the passphrase it can see unlocks the vault.
457
+ **Forgot the passphrase?** With the recovery code, `yaw-mcp secrets recover` gets you back in with every entry intact: at a terminal it asks for the code (no echo; a typo gets another try), then a new passphrase -- `YAW_MCP_VAULT_PASSPHRASE_NEW` or a confirm-twice prompt, never `YAW_MCP_VAULT_PASSPHRASE` -- re-keys the vault, and shows a new code (the one you used stops working). `recover --file <path>` brings back a copy that `reset` moved aside; it refuses (exit 2) while a vault sits at the vault path -- move that one aside first (after a `reset`, that is the new empty vault). In an AI agent session `recover` refuses (exit 2) unless `--no-recovery`: the new code could not be shown. Without a code there is no way back in: the file holds only ciphertext, and nothing else -- no server, no account -- can open it. `yaw-mcp secrets reset` is then the way back to a working vault (it points at `recover` first when the vault has a code). It prints the entry names the vault holds (plaintext keys, so no passphrase is needed) so you know what to set again, asks you to type `RESET` (or takes `--force` from a script; without it, no TTY means a refusal), moves the old file aside as `secrets.json.reset-<timestamp>` next to the vault -- it still opens under the old passphrase, should that turn up -- and creates an empty vault under a new passphrase, confirmed twice on a TTY or taken from `YAW_MCP_VAULT_PASSPHRASE` when it is set. It refuses when the passphrase it is given already opens the vault: that is `rotate`, not a reset. Afterwards, a yaw-mcp server that is already running keeps the passphrase it started with and needs a restart, and a `YAW_MCP_VAULT_PASSPHRASE` in a client config's `env` block still holds the old value. `yaw-mcp doctor` says whether the passphrase it can see unlocks the vault.
451
458
 
452
459
  **Threat model.** The vault protects the on-disk file against offline brute-force after exfiltration (stolen laptop, leaked backup): useless without the passphrase, tamper-evident via GCM. It does **not** defend against a process running as you while the passphrase is cached, a keylogger, or a value already leaked at its source.
453
460
 
@@ -499,7 +506,7 @@ Common ones (run `yaw-mcp --help` for the full list):
499
506
  | `YAW_MCP_TOOL_EXPOSURE` | How much of the catalog `tools/list` advertises. `gateway`: the meta-tools plus the servers loaded this session. `lite`: only `mcp_connect_exec` / `find_tool` / `read_tool` plus the loaded servers, for a client that inlines every listed tool into every request; the other meta-tools stay callable by name. `full`: the pre-gateway surface, with a placeholder for every cached-but-unloaded tool. Unset, yaw-mcp picks `lite` when the client's MCP `clientInfo.name` is `typed-cli` and `gateway` otherwise; a set value always wins over that. Re-read on every `tools/list`, so a change lands without a restart. An unrecognised value logs a warning once and falls back to the client default. |
500
507
  | `MCP_CONNECT_TIMEOUT` | Milliseconds to wait for a server's MCP handshake. Default `15000`; a server's own `connectTimeoutMs` in `bundles.json` always wins. Whole milliseconds in `1..2147483647` -- anything else falls back to the default with one warn. When the machine is saturated (CPU at least 50% busy over the wait) and the local child is still running at the deadline, it gets the same deadline once more -- at most twice the value in all (a runtime that reports no CPU load, such as oam before 0.19.2, counts as busy); a per-server `connectTimeoutMs` is never extended. |
501
508
  | `MCP_LIST_TIMEOUT` | Milliseconds to wait for a server's tool/resource/prompt inventory calls after the handshake. Default `15000`; same `1..2147483647` whole-millisecond parse, invalid values fall back with one warn. |
502
- | `MCP_CALL_TIMEOUT` | Milliseconds to wait for a single proxied `tools/call`. Default `60000` (the SDK's own bound); raise it for legitimately slow servers. Same `1..2147483647` whole-millisecond parse, invalid values fall back with one warn. |
509
+ | `MCP_CALL_TIMEOUT` | Milliseconds to wait for a single proxied `tools/call`, `resources/read` or `prompts/get`. Default `60000` (the SDK's own bound); raise it for legitimately slow servers. Same `1..2147483647` whole-millisecond parse, invalid values fall back with one warn. |
503
510
  | `YAW_MCP_IDLE_THRESHOLD` | Non-matching tool calls a loaded server tolerates before it is unloaded. Default `10`; bursty servers earn more patience automatically. The older name `MCP_CONNECT_IDLE_THRESHOLD` still works as a fallback. |
504
511
  | `YAW_MCP_DISABLE_PERSISTENCE` | `1` keeps learning + pack history process-scoped and turns off doctor's 24 h registry cache (CI, containers). Default off. |
505
512
  | `YAW_MCP_READONLY_DIAGNOSTICS` | `1` makes `doctor` (text and `--json`), `bundles`, `yaw-mcp heal` and the broker's startup heal pass write nothing, for a caller that runs them in the background on a timer. `doctor` still scans `yaw-mcp try` trials but does not sweep expired ones out of your client configs: each is reported as a warning (so the run exits 2) and listed in `--json`'s `trials.unswept`, with `trials.sweepHint` naming the fix -- a plain `yaw-mcp doctor` with the variable unset, or `yaw-mcp try-cleanup <slug>`. A pre-0.12 `~/.yaw-mcp.json` or project `.yaw-mcp.json` / `.yaw-mcp.local.json` is not moved into `.yaw-mcp/`; each is reported as a warning instead (its settings are not loaded for that run). `--json` carries `"readOnly": true` on such a run. `doctor` still reads its 24-hour registry cache (`~/.yaw-mcp/registry-cache.json`) but never writes it, so it only saves requests on answers an ordinary `doctor` run stored. `status` never writes, so it is unaffected. Default off. |
@@ -14,7 +14,7 @@ import {
14
14
  recordAttemptAt,
15
15
  runsUnderNpmConfigPrefix,
16
16
  writeCheckMemo
17
- } from "./chunk-GTQLWC66.js";
17
+ } from "./chunk-UHSAFT6S.js";
18
18
  export {
19
19
  PREFIX_REFUSED_REASON,
20
20
  UPGRADE_LOCK_NAME,