fix: encode the mcp subcommand in server.json package arguments - #2275
Conversation
A registry-format launcher (e.g. one consuming /.well-known/mcp.json or the MCP registry entry) starts the server from the package descriptor only; without the positional "mcp" argument it runs the bare CLI instead of the stdio MCP server (bin.ts only starts the MCP server for the mcp subcommand). Enforce the argument in scripts/sync-mcp-metadata.mjs so sync and the CI/prepack checks (check:mcp-metadata) keep server.json correct, and regenerate server.json.
Size Report
npm unpacked components
Startup median (7 runs, lower is better):
Top changed chunks:
Top changed packed files
|
|
BLOCKED at exact head 87fadfd. The packageArguments shape is correct and matches the MCP Registry schema, but the regression proof is incomplete: add an owning metadata test/gate assertion that finds the agent-device npm package entry and requires the exact fixed positional argument [{ type: "positional", value: "mcp" }], with planted-red evidence for a missing/wrong argument. The current check only demonstrates the corrected file is self-consistent. Also add a concise Unreleased changelog entry: registry-format clients currently launch the bare CLI, so this is a user-visible release fix. No device proof is required; exact-head CI and size are otherwise clean. |
- scripts/__tests__/mcp-metadata.test.ts asserts the checked-in server.json's agent-device npm package entry declares the exact fixed positional mcp argument (and stays stdio-only), so a missing or wrong argument fails the unit lane in both directions. Wired into the unit-core project include list. - Changelog: user-visible release fix under Unreleased.
|
Both asks addressed in 21083ca: 1. Owning metadata test with planted-red evidence — new Red #1 — argument missing (server.json reverted to the pre-fix shape): Red #2 — wrong argument ( Green — with the shipped file: 2. Changelog — Unreleased entry added:
|
|
Re-review of Still not merge-ready on exact-head evidence: Repo Guards failed in the unchanged |
|
Both exact-head failures are infrastructure flakes in code this PR does not touch; reran the failed jobs (runs 33850336605 / 33850336650):
Awaiting the reruns to finish; this head should then be READY per the re-review. |
|
Reruns finished green: Repo Guards pass (3m44s) and the rerun Smoke Tests iOS runner lane pass (15m39s). Full check suite is green on exact head 21083ca — per the re-review, this head is READY. |
|
Problem
Registry-format launchers start the server from the package descriptor only.
server.jsondeclared the npm package with a stdio transport but nopackageArguments, so a client honoring the MCP registry entry (or the website's new/.well-known/mcp.jsondiscovery manifest) runs the bareagent-deviceCLI instead of the stdio MCP server —src/bin.tsonly starts the MCP server for themcpsubcommand.Change
scripts/sync-mcp-metadata.mjsnow writes the fixed positionalmcpargument into the package entry, so the sync script, CI (check:mcp-metadata), and prepack all keep the invariant instead of relying on the file being hand-edited.server.jsonaccordingly.Verification
Resulting entry:
Companion: website PR callstack-internal/v0-agent-device#10 ships the same shape at
https://agent-device.dev/.well-known/mcp.jsonso the two sources of truth do not diverge.