Repository navigation
cli: flag unpinned npx/uvx package specs in mcp list - #275
Zongwei9888 merged 3 commits into
Conversation
|
Thank you, @raymondginger2018-sudo, and thanks for picking up the suggestion from #269. Keeping it as a concern on
|
The posture line counts only servers whose configuration resolves, and launcher availability differs by host (Windows path / uvx missing on CI), so a hardcoded 9 failed upstream while passing locally. Derive the count from the CONFIG column instead; the concerns map assertion is unchanged.
The scan skipped flags but consumed their values as positionals: `uvx --python 3.12 pkg==0.3.0` and `uvx --with httpx pkg==0.3.0` were flagged for the option value instead of the package, and `npx --cache /tmp/c pkg` stopped at the path and missed the real concern. Read the package from `--package`/`-p` (npx) and `--from` (uvx) when present, and consume the values of other value-taking options (`--cache`, `--registry`, `--call`/ `-c`; `--python`, `-p`, `--with`, `--index-url`). npm reads a partial version as a range (`pkg@1` means every `1.x`), so count only a full `x.y.z` with an optional pre-release suffix as pinned for npx; uvx's `==` matches exactly at any precision and stays as it was. Per review comment 6336671036.
f302ad8 to
1767abb
Compare
|
@Zongwei9888 — both changes are pushed as
Local CI-equivalent preflight of this exact head (Python 3.12/3.13/3.14, lint, package, desktop, secret scan): no new failures — the only red is the already-tracked Windows-only lifecycle flake. CI re-runs on the new head; dependency review, secret scan and lint are already green there. |
|
Thank you, @raymondginger2018-sudo, both changes work. Merged on 2026-10-27 as befd393. I ran every case against One small gap, fixed on top in f427a77: a local path given through |
Responds to the closing invitation on #269: "a small PR that adds a concern to
mcp listitself, for example an unpinned package (npx/uvxwith@latestor no version) or a server that receives credential environment variables."
Of those two examples the credential-env concern already exists on main
(
cred->sends-credential, merged via #241 / 2fafe40), so this PR adds theremaining one:
unpinned-package. It replaces #269's separatemcp auditcommand with a concern on
mcp listitself, as suggested.What it does
mcp listnow reportsunpinned-packageon a stdio server row when it islaunched through
npx/uvxand its package argument floats -- no version atall (
npx -y left-pad) or a floating tag (npx -y left-pad@latest,pkg@next). Those resolve whatever the registry serves at each start, so theeffective code was never chosen by the operator.
Recognition rules
npx -y left-padnpx -y left-pad@latestnpx -y left-pad@nextuvx mcp-server-timenpx -y left-pad@1.2.3uvx mcp-server-time==0.3.0npx @modelcontextprotocol/server-filesystem@delimiter is only searched past position 0)npx --index-url https://... pkgpkgis the package tokennpx ./server.js,npx C:\x.jsnpx --version(flags only)python3 server.py.cmd/.exe/.bat/.ps1) are stripped beforematching, so
C:\Program Files\nodejs\npx.cmd -y left-padis caught.server's own operands (
npx -y pkg /data).vin the version (pkg@v1.2.3) counts as pinned.Scope
command/argskeys ofmcp_server_view-- noserializer,
McpServerInfo, or JSON-output change (consistent with how theexisting concerns are table-only).
cli/mcp_cli.py(+65),tests/test_mcp_cli.py(+88); pure additions.Testing
test_mcp_list_flags_unpinned_launcher_packagescovers the rows above.tests/test_mcp_cli.py: 8 passed; pinned ruff 0.15.21 check + format clean;local CI preflight
KNOWN-RED | new=0(the 2 known reds are the documentedWindows environment baselines:
job-windows-lifecycle:group2_rc,job-desktop-quality:test_rc).