@yawlabs/mcp 1.1.7 → 1.1.9

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,50 @@ All notable changes to `@yawlabs/mcp` (formerly `@yawlabs/mcph`) are documented
4
4
 
5
5
  ## Unreleased
6
6
 
7
+ **Added -- `add --git` builds a TypeScript MCP server from a private git repository and pins its commit**
8
+
9
+ `yaw-mcp add [<name>] --git <url>[#ref]` clones a repository you can read, installs and builds it, and records the resolved 40-character commit in `bundles.json`. Each commit gets its own build directory under `~/.yaw-mcp/git/`, and the server runs as `node <entry>` from there (on oam when it is installed). npm, pnpm and yarn repos build, with frozen lockfiles and through corepack when `packageManager` pins a version; bun repos are refused. `--subdir`, `--entry`, `--project`, `--yes`, `--no-start-check` and `-- <server args>` are supported, and `--dry-run` only resolves the ref. An optional `yaw-mcp.json` in the repo can name the namespace, description, entry, subdir and env declarations, never what runs ([schema](./schemas/yaw-mcp.manifest.v1.json)); a nameless add whose manifest namespace a different server already uses is refused. Authentication is your own git: ssh-agent, `~/.ssh/config`, a credential helper, or `--git-token-secret NAME` for a vault token passed to git through `GIT_ASKPASS`. A URL carrying a token is refused, and no credential is ever written to `bundles.json`, `.git/config` or any output. See [Private git servers](./README.md#private-git-servers).
10
+
11
+ **Added -- a repository's build scripts are approved once, not on every build**
12
+
13
+ The first build of a repository shows its install and build lifecycle scripts, and any repo config that can run code at install (`.npmrc`, `.yarnrc.yml` `yarnPath` and `plugins`, `.pnpmfile.cjs`, `pnpm-workspace.yaml` hooks), and asks before running them. The grant is stored per repository, with SSH and HTTPS forms of the same URL treated as one, and every later build of that repository on this machine -- update, a new ref, a rollback, `sidecars install`, a second server -- runs without asking again. The grant is per machine: a teammate who pulls a project file is asked once on theirs. Off a terminal, a repository with no grant needs `--yes`. Nothing is cloned or built when a server is loaded, prewarmed or activated, and approving a project file with `trust` remains a separate gate.
14
+
15
+ **Added -- `yaw-mcp update` and `yaw-mcp share` for git servers**
16
+
17
+ `update` moves git servers tracking a branch to the commit the branch points at now, building it beside the current build and repointing `bundles.json` only after the build succeeds. `--check` only asks the remote and also reports newer version tags for a server tracking a tag, `--ref` switches what a server tracks, `--to <sha>` goes back to a kept build, and `--project` edits the project file with its comments intact. The current and previous builds are kept, and so is any build another bundles.json on this machine still pins (a project file, or your own); older ones are deleted. `remove` likewise deletes only the builds nothing else pins, and names the ones it keeps. A project file that is not trusted is refused by `update` (even `--check`) and `share`, so its URL and vault secret are never used. `share <name>` prints the one-line `add --git` command coworkers paste (SSH and HTTPS forms where both apply) and the secrets they will be asked for, without env values, vault contents or local paths.
18
+
19
+ **Added -- git servers in `sidecars install`, `trust`, `remove` and `doctor`**
20
+
21
+ `sidecars install` builds any git server whose pinned commit has no build on this machine; a repository whose scripts were never allowed here is reported as `needs-consent` in `--json`, not as a failed build. `trust` shows a project file's git servers with their commits, and any vault token an entry sends together with the host it goes to, and offers the build after approval. `remove` deletes a git server's builds that no other bundles.json pins. `doctor` lists git servers under OAM RUNTIME with the commit, tracked ref, the last `update --check` result and its age, build status, and the node version and platform of the build, and `doctor --json` carries the same rows in `oamRuntime.git`. Doctor reads only what is on disk and never runs git, so a private SSH remote cannot make it prompt or hang. A missing build, a failed build, or a build made for another platform, arch or node major is a warning (exit 2) that names the rebuild command.
22
+
23
+ **Changed -- routing picks the right server and tool more often for plain-English requests**
24
+
25
+ Matching now folds plurals and common suffixes ("pull requests" matches "pull request", "vulnerable" matches "vulnerabilities"), understands common developer abbreviations (PR, k8s, repo, db, gh, deps, ...) and derives aliases from each installed server's own names. `find_tool` ignores filler words and no longer breaks ties alphabetically, so a large server no longer wins ties by having more tools. On a 21-server install, the right server ranked first rose from 75% to 81% of test requests, and the right tool ranked first from 39% to 50%.
26
+
27
+ **Changed -- `discover` auto-loads a server only when the request clearly matches it**
28
+
29
+ A server is auto-loaded only when enough of the request's meaningful words match it. General questions ("what is the capital of France") and requests for products that are not installed no longer start a server. Dispatch is unaffected: it still loads its best match, and now says when that match is weak and names the runner-up.
30
+
31
+ **Changed -- a failure under `--json` prints a document instead of an empty stdout**
32
+
33
+ `add`, `update`, `share` and an argv error now emit `{"ok": false, "error": "...", "exitCode": n}` on stdout when they refuse under `--json`, where stdout used to be zero bytes -- indistinguishable from a success a script had to parse to notice. The human-readable line stays on stderr and exit codes are unchanged (2 for usage/consent, 1 for failure), and the rest of the document shapes are untouched.
34
+
35
+ **Added -- dispatch falls back to a close runner-up when its pick fails to start**
36
+
37
+ When the chosen server fails to start, dispatch tries the next candidate if it scored within 1.3x of the failed one and the failed one matched enough of the request's words to be a confident pick, and says which server failed and which was loaded instead. Otherwise the failure is returned as before, so a request for a product that is not installed no longer loads an unrelated server.
38
+
39
+ **Added -- dispatch replies list the matching tools' arguments, and `exec` checks arguments before calling**
40
+
41
+ After loading a server, dispatch lists its best-matching tools with their required and optional arguments. `exec` now refuses a call that is missing a required argument, or that passes a key the tool's schema forbids, and names the expected arguments (for example `package` -> `name`), instead of forwarding the call.
42
+
43
+ **Added -- GitHub, Terraform and Vault tools are searchable before their server has ever started**
44
+
45
+ `find_tool` and dispatch now rank tools for these three servers from tool lists bundled from their upstream releases (github-mcp-server v2.1.0, terraform-mcp-server v1.4.1, vault-mcp-server v0.2.0), which helps when their docker image cannot start. The server's real tool list replaces the bundled one once it has loaded. `find_tool` also names matching servers whose tools are still unknown.
46
+
47
+ **Changed -- dispatch's description names the installed servers**
48
+
49
+ The dispatch tool description now ends with a short line (at most 800 characters) listing the installed servers and what they cover, so a client that searches tool descriptions can find dispatch for a request like "list my PRs". The server instructions now also say to answer general-knowledge questions directly, to retry with dispatch when `find_tool` misses, and to call a just-loaded tool through `mcp_connect_exec` if the client reports it missing.
50
+
7
51
  ## 1.1.7 -- a server Windows will not start is named with its likely cause, instead of a bare `spawn UNKNOWN`
8
52
 
9
53
  **Fixed -- a server whose executable Windows will not run is named, with the likely cause, instead of a bare `spawn UNKNOWN`**
package/README.md CHANGED
@@ -184,6 +184,9 @@ yaw-mcp status [--json] # read-only snapshot of loaded servers, activity,
184
184
  yaw-mcp add <slug> [--env KEY=value] [--dry-run] # add a catalog server to bundles.json
185
185
  yaw-mcp add <name> --command "npx -y my-mcp" # ...or define a local server yourself
186
186
  yaw-mcp add <name> --url https://host/mcp # ...or a remote one
187
+ yaw-mcp add [<name>] --git <url>[#ref] # ...or build one from a git repo (see Private git servers)
188
+ yaw-mcp update [<name>] [--check] [--to <sha>] # move git servers to their branch's new commit (yaw-mcp itself: upgrade)
189
+ yaw-mcp share <name> [--pin] # print the one-line add --git command coworkers paste
187
190
  yaw-mcp import <client> [--dry-run] # adopt the servers a client already has
188
191
  yaw-mcp remove <slug-or-namespace-or-name> # drop a server
189
192
  yaw-mcp list [--json] # list configured servers with their cached compliance grade
@@ -247,6 +250,59 @@ yaw-mcp audit <namespace> # audit a stdio server from bundles.json, cache it
247
250
 
248
251
  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`.
249
252
 
253
+ ## Private git servers
254
+
255
+ A TypeScript MCP server that lives in a private repository -- your own, or your team's -- does not need to be published to npm. `add --git` clones it, installs its dependencies, builds it, and pins the exact commit:
256
+
257
+ ```bash
258
+ yaw-mcp add acme-tools --git git@github.com:acme/acme-tools-mcp.git#main
259
+ yaw-mcp add --git https://github.com/acme/crm-mcp.git#v1.4.0 # name from the repo's yaw-mcp.json
260
+ yaw-mcp add tools --git git@gitlab.acme.dev:infra/mono.git --subdir packages/mcp --entry dist/index.js -- --verbose
261
+ ```
262
+
263
+ - **The ref** after `#` can be a branch, a tag, or a short or full SHA (default: the remote's default branch). It is resolved to a full 40-character commit, and that commit is what `bundles.json` records. Each build lives in its own directory, `~/.yaw-mcp/git/<namespace>/<sha12>`, and the server runs as `node <entry>` from there, with the node yaw-mcp itself runs on -- on oam when oam is installed, like any other node server.
264
+ - **npm, pnpm and yarn** repos all build. The package manager comes from `packageManager` in the root `package.json` (run through corepack when it pins a version), else from the lockfile. Installs are always frozen (`npm ci`, `pnpm install --frozen-lockfile`, `yarn install --frozen-lockfile` or `--immutable`) and include dev dependencies; yarn 2+ builds with `nodeLinker: node-modules`, and a pnpm workspace subdir builds with `--filter`. The build is `<pm> run build`, run only when the package has a `build` script. bun repos are refused.
265
+ - **The entry** is the package's `bin`, then `main`, unless `--entry` says otherwise. `add` starts the server once and lists its tools before it reports success (`--no-start-check` skips that).
266
+ - `--dry-run` only resolves the ref and prints the commit it would pin.
267
+
268
+ **Build-script consent is asked once per repository.** The first build of a repo shows its install and build lifecycle scripts (pre/post hooks and every workspace package's scripts included), plus any repo config that can run code at install -- `.npmrc`, `.yarnrc`, `.yarnrc.yml` (`yarnPath`, `plugins`), `.pnpmfile.cjs`, `pnpm-workspace.yaml` hooks -- and asks before running them. That config is shown, not blocked. The answer is stored per repository in `~/.yaw-mcp/git/consent.json`, and later builds of the same repo -- `update`, a new ref, `--to`, `sidecars install`, a second server from the same repo -- do not ask again, even when the scripts change. `git@host:org/repo`, `ssh://git@host/org/repo` and `https://host/org/repo.git` count as the same repository. Off a terminal there is nobody to ask, so a repo with no stored grant needs `--yes`, which also records the grant. Nothing is ever cloned or built when yaw-mcp loads, lists, prewarms or activates a server: a server with no build on this machine fails activation with `Run: yaw-mcp sidecars install`.
269
+
270
+ **The repo's `yaw-mcp.json` (optional).** A server repo can carry a `yaw-mcp.json` at its root (and at `<subdir>/yaw-mcp.json`, which overrides the root key by key) so that a bare `add --git <url>` needs no other flags:
271
+
272
+ ```jsonc
273
+ {
274
+ "$schema": "https://raw.githubusercontent.com/YawLabs/mcp/main/schemas/yaw-mcp.manifest.v1.json",
275
+ "version": 1,
276
+ "namespace": "acme_crm",
277
+ "description": "Acme CRM: accounts, deals, contacts",
278
+ "entry": "dist/index.js",
279
+ "env": {
280
+ "CRM_TOKEN": { "secret": "crm_token", "required": true, "help": "https://wiki.acme/crm-token" },
281
+ "CRM_REGION": { "default": "us" }
282
+ }
283
+ }
284
+ ```
285
+
286
+ It can set the namespace, description, entry, subdir and env declarations -- never what runs: a `command`, `args` or `scripts` key is refused with a warning. Flags beat the manifest, and the manifest beats what `package.json` implies. A nameless `add --git` whose manifest names a namespace a different server already uses is refused, so a repo cannot take over another server's env; give the server a name instead. A secret is written to `bundles.json` as a `${secret:NAME}` reference, never as a value, and `add` offers to store a missing one in the [vault](#local-secret-vault). Every `add --git` prints the env keys it writes, each with the vault secret behind it or `a value (not shown)`. The file is strictly optional: everything in it has a flag, a repo may keep it out of a public mirror, and yaw-mcp never creates it or asks you to.
287
+
288
+ **Sharing with coworkers.** `yaw-mcp share <name>` prints the line a coworker pastes -- an `SSH:` and an `HTTPS:` form when the URL converts cleanly -- and the secrets they will be asked for. It prints the ref the server tracks, or the exact commit with `--pin`, and warns when that ref is a branch, since each coworker would get whatever the branch points at that day. It never prints env values, vault contents or local paths, and whatever the repo's `yaw-mcp.json` does not declare is spelled out as flags. Read access to the repository is the whole permission model: there is no registry and no sharing layer.
289
+
290
+ **Updating.** `yaw-mcp update` moves each git server tracking a branch to the commit the branch points at now. The new commit is built beside the current one and `bundles.json` is repointed only after the build succeeds, so a failed build changes nothing. A server tracking a tag or a commit is pinned: it is reported, not moved. `--check` only asks the remote and reports each server as up to date, behind or pinned, plus newer version tags for one tracking a tag. `--ref <ref>` switches what a server tracks, and `--to <sha>` goes back to a build kept on this machine (the current build and the one before it are kept, plus any build another bundles.json on this machine still pins; older ones are deleted). `yaw-mcp remove` deletes the server's builds with it, except one another bundles.json still pins, which it names. A project file you have not trusted is refused by `update` (even `--check`) and `share`, so its URL and vault secret are never used. `update` never touches yaw-mcp itself -- that is `yaw-mcp upgrade`.
291
+
292
+ **Teammates, through a project file.** `add --git --project` and `update --project` write the server, with its pinned commit, into the project's `.yaw-mcp/bundles.json`, keeping the file's comments; commit that file. A teammate who pulls it runs `yaw-mcp trust`, which shows the git server, its commit, and any vault token the entry would send together with the host it goes to, and, after approval, offers to build it (or run `yaw-mcp sidecars install` later). Project trust and repo consent are separate gates: approving the file does not skip the once-per-repo script consent, and a project entry with no pinned commit is refused rather than built from a moving branch. When the file was approved before your own `--project` write, the approval is renewed for you; otherwise it stays unapproved and the command says so.
293
+
294
+ **Doctor.** `yaw-mcp doctor` lists git servers under OAM RUNTIME: commit, tracked ref, the last `update --check` result and its age, build status, and the node version and platform the build was made with. Doctor never runs git (a private SSH remote can prompt or hang), so "behind" is only as fresh as your last `update --check`. A missing build, a failed build, or one made for another platform, arch or node major is a warning (exit 2) that names the rebuild command. `doctor --json` carries the same rows in `oamRuntime.git`.
295
+
296
+ **Credentials.** yaw-mcp uses your own git authentication and never stores a credential:
297
+
298
+ - **SSH** (`git@host:org/repo`, `ssh://...`): whatever your git already uses -- ssh-agent, `~/.ssh/config`, `core.sshCommand` or `GIT_SSH_COMMAND`.
299
+ - **HTTPS**: your git credential helper (Git Credential Manager, osxkeychain, libsecret), or `--git-token-secret NAME` to read a token from the vault. The token reaches git through a `GIT_ASKPASS` helper for that one git call only; it never goes into argv, the URL, `.git/config`, `bundles.json`, logs or `--json`, and only the secret's name is stored.
300
+ - A URL carrying a token or password (`https://TOKEN@host/...`) is refused before anything is written. A bare username (`https://git@host/...`) is fine.
301
+ - Off a terminal, git runs with `GIT_TERMINAL_PROMPT=0` and `GCM_INTERACTIVE=never`, so it fails fast instead of waiting on a prompt nobody can see. Clone and build output is redacted before it is printed or saved.
302
+ - **Windows and ssh-agent:** Git for Windows ships its own `ssh`, which does not use the Windows OpenSSH agent service. If `ssh -T git@github.com` works in PowerShell but the clone fails to authenticate, point git at the Windows client: `git config --global core.sshCommand C:/Windows/System32/OpenSSH/ssh.exe`.
303
+ - **Host keys:** yaw-mcp never accepts an ssh host key for you. A host ssh does not know yet is reported with the fix (`ssh -T git@<host>` once, to accept it); a host key that CHANGED is reported as a possible interception.
304
+ - A teammate who uses the other protocol than a committed project entry does not need to edit the shared file: git's own rewrite covers it, for example `git config --global url."https://github.com/".insteadOf "git@github.com:"`.
305
+
250
306
  ## Configuration -- `.yaw-mcp/`
251
307
 
252
308
  yaw-mcp keeps its config under a `.yaw-mcp/` directory (mirroring `.git/`, `.vscode/`, `.claude/`). It reads `config.json` from three optional scopes, highest precedence first:
@@ -11,7 +11,7 @@ import {
11
11
  recordAttemptAt,
12
12
  runsUnderNpmConfigPrefix,
13
13
  writeCheckMemo
14
- } from "./chunk-TI26KSBV.js";
14
+ } from "./chunk-NYVP3NOV.js";
15
15
  export {
16
16
  UPGRADE_LOCK_NAME,
17
17
  acquireUpgradeLock,
@@ -3868,6 +3868,17 @@ function sidecarsRoot(home = homedir3()) {
3868
3868
  function sidecarsNodeModules(home = homedir3()) {
3869
3869
  return path2.join(sidecarsRoot(home), "node_modules");
3870
3870
  }
3871
+ var GIT_DIRNAME = "git";
3872
+ var GIT_BUILD_SHA_LEN = 12;
3873
+ function gitRoot(home = homedir3()) {
3874
+ return path2.join(userConfigDir(home), GIT_DIRNAME);
3875
+ }
3876
+ function gitBuildDir(namespace, commit, home = homedir3()) {
3877
+ return path2.join(gitRoot(home), namespace, commit.slice(0, GIT_BUILD_SHA_LEN));
3878
+ }
3879
+ function gitFailedPath(namespace, commit, home = homedir3()) {
3880
+ return `${gitBuildDir(namespace, commit, home)}.failed`;
3881
+ }
3871
3882
  function userConfigDir(home = homedir3()) {
3872
3883
  return path2.join(home, CONFIG_DIRNAME);
3873
3884
  }
@@ -5785,17 +5796,17 @@ async function oamFloorLines(probe) {
5785
5796
  }
5786
5797
  async function defaultRunningPrefix(argvPath) {
5787
5798
  if (isTestSandbox()) return null;
5788
- const { detectRunningInstallPrefix: detectRunningInstallPrefix2 } = await import("./auto-upgrade-7FG236LQ.js");
5799
+ const { detectRunningInstallPrefix: detectRunningInstallPrefix2 } = await import("./auto-upgrade-RGWSTKNN.js");
5789
5800
  return detectRunningInstallPrefix2(argvPath);
5790
5801
  }
5791
5802
  async function defaultAcquireLock(prefixDir) {
5792
5803
  if (isTestSandbox()) return () => {
5793
5804
  };
5794
- const { acquireUpgradeLock: acquireUpgradeLock2 } = await import("./auto-upgrade-7FG236LQ.js");
5805
+ const { acquireUpgradeLock: acquireUpgradeLock2 } = await import("./auto-upgrade-RGWSTKNN.js");
5795
5806
  return acquireUpgradeLock2(prefixDir);
5796
5807
  }
5797
5808
  async function upgradeLockPath(prefixDir) {
5798
- const { UPGRADE_LOCK_NAME: UPGRADE_LOCK_NAME2 } = await import("./auto-upgrade-7FG236LQ.js");
5809
+ const { UPGRADE_LOCK_NAME: UPGRADE_LOCK_NAME2 } = await import("./auto-upgrade-RGWSTKNN.js");
5799
5810
  return join11(prefixDir, UPGRADE_LOCK_NAME2);
5800
5811
  }
5801
5812
  async function defaultSpawn(cmd, args, cwd) {
@@ -5858,7 +5869,7 @@ async function runUpgrade(opts = {}) {
5858
5869
  if (method === "global-npm") {
5859
5870
  rawPrefix = await (opts.runningPrefix ?? defaultRunningPrefix)(argvPath);
5860
5871
  if (rawPrefix !== null) {
5861
- const { quoteArgForDisplay: quoteArgForDisplay2, quoteShellArgIfNeeded: quoteShellArgIfNeeded2 } = await import("./auto-upgrade-7FG236LQ.js");
5872
+ const { quoteArgForDisplay: quoteArgForDisplay2, quoteShellArgIfNeeded: quoteShellArgIfNeeded2 } = await import("./auto-upgrade-RGWSTKNN.js");
5862
5873
  const spawnForm = quoteShellArgIfNeeded2(rawPrefix, opts.platform);
5863
5874
  const displayForm = quoteArgForDisplay2(rawPrefix, opts.platform);
5864
5875
  if (spawnForm !== null && displayForm !== null) {
@@ -5990,7 +6001,7 @@ async function runUpgrade(opts = {}) {
5990
6001
  return { exitCode: 3, lines };
5991
6002
  }
5992
6003
  function readCurrentVersion() {
5993
- return true ? "1.1.7" : "dev";
6004
+ return true ? "1.1.9" : "dev";
5994
6005
  }
5995
6006
 
5996
6007
  // src/auto-upgrade.ts
@@ -6282,7 +6293,7 @@ function defaultSpawn2(cmd, args, onDone = () => {
6282
6293
  }
6283
6294
  async function maybeAutoUpgrade(deps = {}) {
6284
6295
  if (isFeatureDisabled("YAW_MCP_AUTO_UPGRADE")) return;
6285
- const current = deps.currentVersion ?? (true ? "1.1.7" : "dev");
6296
+ const current = deps.currentVersion ?? (true ? "1.1.9" : "dev");
6286
6297
  if (current === "dev") return;
6287
6298
  const argvPath = deps.argvPath ?? process.argv[1];
6288
6299
  let method = (deps.isSeaImpl ? await deps.isSeaImpl() : await detectSea()) ? "binary" : detectInstallMethod(argvPath, realpathSync3, ["unknown", "local-node-modules"]);
@@ -6407,6 +6418,10 @@ export {
6407
6418
  CONFIG_DIRNAME,
6408
6419
  sidecarsRoot,
6409
6420
  sidecarsNodeModules,
6421
+ GIT_BUILD_SHA_LEN,
6422
+ gitRoot,
6423
+ gitBuildDir,
6424
+ gitFailedPath,
6410
6425
  userConfigDir,
6411
6426
  normalizeForCompare,
6412
6427
  tildePath,
@@ -6492,8 +6507,11 @@ export {
6492
6507
  oamHeapOomHint,
6493
6508
  oamFailureLabel,
6494
6509
  compareVersions,
6510
+ resolveBinAbsolute,
6495
6511
  probeOam,
6496
6512
  nodeLaunchKind,
6513
+ managedNodeBin,
6514
+ packageEntry,
6497
6515
  resolveStableNpmEntry,
6498
6516
  resolveOamSpawn,
6499
6517
  resolveManagedSpawn,