Patch Changes
-
#154
bbc786bThanks @tufantunc! - List ssh-mcp on the official MCP registry, and keep the listing current from the release that produces it.registry.modelcontextprotocol.ioverifies that whoever registersio.github.tufantunc/ssh-mcpalso owns the npm package it points at, and it does that by fetchingregistry.npmjs.org/ssh-mcp/<version>— the manifest of one exact version, not the package — and requiring anmcpNamefield in it that matches the server name. npm versions are immutable, so no version already published can ever gain that field: the listing is only reachable through a release, and this is it. There is no behaviour change in the server; the only thing this version adds over 2.3.3 is a manifest the registry will accept.server.jsoncarries the version twice — the listing's own, and the npm version it resolves — and both have to name what actually shipped.scripts/sync-server-json.mjswrites them frompackage.jsonand is wired to theversionnpm script, which is what the changesets action runs when it opens the "Version Packages" pull request; the rewrite is committed there alongside the version bump, so main is already correct by the time anything publishes. The script also refuses amcpName/server.jsonname mismatch, and refuses apackages[].identifierthat is not the npm package name — the registry reports both as ownership failures after npm has published, at the single step of a release that a re-run cannot undo.Publishing to the registry is a second job in the Changesets workflow, gated on the action's
publishedoutput, and not the tag-triggered workflow that shape usually takes: thev*tag is pushed withGITHUB_TOKEN, and GitHub starts no workflows for those pushes — the same loop-breaker that already keepsci.ymloffchangeset-release/main. A workflow listening for that tag would simply never run. It is a separate job rather than more steps on the release job because a registry failure has to be retryable without re-attempting the npm publish, which would fail first and hide it.Both credentials are OIDC, so the registry step adds no secret:
mcp-publisher login github-oidcexchanges the workflow's identity for a registry token, and theio.github.tufantunc/*namespace is authorised from the repository owner in its claims.What review changed
The first version of this was reviewed before merging, and five things it got wrong are worth recording, because each one is a mistake the shape of the change invites.
The publisher binary was executed unverified. Pinning
v1.8.1in the download URL pins a release, not its bytes — GitHub release assets can be replaced in place. That is a weaker pin than any other reference in this workflow, and it lands in the worst possible job: npm's trusted publisher is bound to a workflow filename, and the registry job lives in the samechangesets.yml, so anything executing there can mint a token npm accepts for ssh-mcp. The install step now checks the sha256 published inregistry_1.8.1_checksums.txtbefore extracting, and a version bump means bumping both lines.Two schema rules were copied into the script, on a false premise. A hand-rolled 100-character cap on
titleanddescriptionwas defended by a comment claiming mcp-publisher only reports such things at publish time. It does not:mcp-publisher validatechecks the whole schema — required fields, the name pattern, the enums, every cap — against an endpoint that needs no credentials. The workflow runs it before the npm wait, the copied constant is gone, and the caps that a person can actually get wrong by hand are asserted on the real file intest/unit/sync-server-json.test.ts, which fails on the pull request that writes them rather than on the release two merges later.needs: releasecould strand a published version permanently.needsmeans "only if that job succeeded", and the action pushes the git tag and creates the GitHub release afterchangeset publishreturns — so npm can have the version while the release job fails. The registry job would skip, and no re-run could reach it:changeset publishfinds the version already on npm, releases nothing, and reportspublished: falseforever. The gate is now!cancelled() && …, and alist_onlydispatch input lists the current version without going near the publish path, for the one state the output cannot describe.The npm-visibility wait could not do its job.
npm view pkg@versionfetches the whole packument and resolves locally; npm serves packuments withmax-age=300and defaultsprefer-onlineto false. The loop checked for 290 seconds, entirely inside that window, so in the only scenario it exists for — the version not yet visible on the first attempt — every later attempt could be answered from the same stale cached document, failing while npm was serving the version. It now GETsregistry.npmjs.org/<identifier>/<version>, which is the exact URL the registry's own validator builds, with the identifier read fromserver.jsonrather than hardcoded, and it keeps curl's error rather than reporting every failure as propagation lag.The admin-merge checklist went stale. The comment describing what a "Version Packages" pull request is allowed to touch now has to include
server.json, or every future release PR looks wider than the rule allows.CONTRIBUTING.mdsays whatserver.jsonis and which of its fields are generated.Two deliberate deviations
--checkand theserver.jsonassertions were not in the plan this change was written against; they are additions, kept because the script's guards are otherwise unobservable — on a healthy repo every guard branch is false, andscripts/sits outside Sonar, the coverage report and both tsconfigs, so a guard that stopped firing would look exactly like one that passed.SSH_MCP_KEYis declared withformat: "filepath"and notisSecret, unlike the three password variables. It names a path, not key material; marking it secret would have clients mask a filename while telling the reader something untrue about what the variable holds.