fix(mcp): correct the npx setup command - #191
Merged
Merged
Conversation
The README told MCP clients to run `npx -y @devicecloud.dev/dcd dcd-mcp`. npx runs a package's default bin, which here is `dcd`, so that command ran `dcd dcd-mcp` and printed the CLI's usage instead of starting the server. The server is the package's second bin and has to be named with `npx -y --package=@devicecloud.dev/dcd dcd-mcp`. server.json had the same problem in registry form: clients assemble `npx <runtimeArguments> <identifier>@<version> <packageArguments>`, so a `dcd-mcp` package argument reached the `dcd` bin too. The manifest now puts `-y`, `--package <pkg>@<version>` and `dcd-mcp` in runtimeArguments; the identifier a client appends after them is an extra argument that dcd-mcp ignores. Its version was still the 5.0.0-beta.0 it was written with and nothing kept it current, so it now carries the last stable release and release-please rewrites all three pins on each stable release. It also moves to the current registry schema (the old schema URL no longer resolves), which caps the description at 100 characters. The dcd_list_devices tool description also had its mapping inverted: each platform maps a device to the OS versions it runs, not the other way round.
release-please's json updater replaces the whole matched value, so the extra-files entry pointing at the --package argument would have rewritten '@devicecloud.dev/dcd@5.5.0' to a bare '5.6.0' on the next release and broken the command again. server.json now ends runtimeArguments with a bare --package, so the '<identifier>@<version>' a registry client appends becomes its value, and dcd-mcp moves to packageArguments. The pin lives only in packages[].version, which release-please already rewrites, so that extra-files entry is dropped. The assembled 'npx -y --package @devicecloud.dev/dcd@5.5.0 dcd-mcp' was checked to start the server. The unit test now guards that no argument embeds a version and that release-please only targets bare version fields.
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
README. The MCP setup snippet told clients to run
npx -y @devicecloud.dev/dcd dcd-mcp. npx runs a package's default bin, which here isdcd, so the command randcd dcd-mcpand printed the CLI usage instead of starting the server. It is now["-y", "--package=@devicecloud.dev/dcd", "dcd-mcp"], with a--read-onlyexample.server.json (the MCP registry manifest) had the same bug in registry form. Clients assemble an npm entry as
npx <runtimeArguments> <identifier>@<version> <packageArguments>; VS Code'sMcpManagementServicedoes exactly this. So thedcd-mcppackage argument also reached thedcdbin. Putting--packageinruntimeArgumentsand leavingdcd-mcpas a package argument doesn't work either, because the identifier lands where npx expects the command.The manifest now lists
-y,--package <pkg>@<version>anddcd-mcpall as runtime arguments. The identifier that a client appends after them becomes an extra argument, whichdcd-mcpignores. I checked each form against the published beta:npx -y @devicecloud.dev/dcd@beta dcd-mcp(old README)dcdusagenpx -y --package=@devicecloud.dev/dcd@beta dcd-mcp(new README)initialize+tools/listnpx -y --package @devicecloud.dev/dcd@beta dcd-mcp @devicecloud.dev/dcd@beta(VS Code's assembly of the new server.json)tools/listnpx -y --package=@devicecloud.dev/dcd@beta @devicecloud.dev/dcd@beta dcd-mcp(--packagein runtimeArguments,dcd-mcpleft in packageArguments)No such file or directoryserver.json version. It was still the
5.0.0-beta.0it was written with, and release-please didn't manage it: there were noextra-files. It now carries 5.5.0, the last stable release and the value in.release-please-manifest.json. release-please's JSONextra-filesnow rewrite$.version,$.packages[*].versionand the--packagepin on each stable release.I dry-ran release-please's
GenericJsonupdater logic for 5.6.0: the same jsonpath-plus major, version regex and stringify. Only those three strings change, because the file is now in canonicalJSON.stringify(…, 2)form. The 5.6.0 Release PR (#185) will pick this up when the promotion lands.Other changes:
$schemamoves to2025-12-11/server.schema.json, because the old URL returns 404. The description is shortened to 96 characters to fit that schema's 100-character limit. The file validates cleanly withjsonschema.dcd_list_devicestool description had its mapping inverted: it maps a device to its OS versions, not the other way round.Not done here: the manifest isn't published.
dev.devicecloud/dcdisn't on registry.modelcontextprotocol.io, no workflow publishes it, and the registry's npm ownership check would also need"mcpName": "dev.devicecloud/dcd"inpackage.json. The docs repo'smcp/overview.mdhas the same broken snippet; that's covered separately.Type of change
fix— bug fixfeat— new featureperf— performance improvementrefactor— code change that's neither a fix nor a featuredocs— documentation onlychore/ci/build/test— tooling, no user-facing change!or PR notes a breaking-change footer)Checklist
pnpm lintpasses (0 errors; the 32 existing warnings are unchanged)pnpm typecheckpassespnpm buildpassesCHANGELOG.md(release-please handles this)README.md/STYLE_GUIDE.mdupdated if behaviour or output changedHow to test
pnpm lint && pnpm typecheck && pnpm test(withMOCK_API_DIR): 231 passing, 3 more than before.test/unit/server-json.test.tsassembles the command the way VS Code does, checks that the bin exists, and pins all three versions to the release manifest. A stale or unbumped pin fails CI, including on the Release PR.dcd-mcptolerates the appended@devicecloud.dev/dcd@<version>and still honours a trailing--read-only.npx -y --package=@devicecloud.dev/dcd@beta dcd-mcp, then sendinitialize+tools/list.🤖 Generated with Claude Code