Summary
App-probing and machine-readable output for the CLI:
--method tools/call --tool-name <t> --app-info — prints one JSON line describing the tool's app posture (hasApp, resourceUri, csp, permissions, …) without invoking the tool; exits 0 when the tool has an app, 2 (no_app) when it doesn't — so a shell pipeline can short-circuit before touching a browser.
--method tools/list --app-info — one NDJSON line per tool with its _meta.ui posture, over a single connect.
--format json — a single JSON envelope on stdout (result + appInfo as sibling keys, no banner) for any method.
Reference implementation (PR #1510)
Re-implement informed by these changes at 33fac3f:
Depends on
- core
AppInfo + extractAppInfo()
- CLI exit-code map + error envelopes (
NO_APP = 2 via CliExitCodeError)
mcp_app_demo test-server preset (live fixture for the tests)
- CLI ergonomics issue (same
cli.ts lane; land first)
--format json and --app-info are combined here because emitResult() branches on both — splitting them creates an artificial seam.
Notes
- Resource-read failures during the probe should be tolerated and reported in a
resourceError field, not thrown.
- Document
--app-info, --format json, NDJSON shape, and the exit-2 semantics in clients/cli/README.md.
- Coverage gate ≥90 on all four dimensions.
Part of the PR #1510 decomposition (see tracking issue).
Summary
App-probing and machine-readable output for the CLI:
--method tools/call --tool-name <t> --app-info— prints one JSON line describing the tool's app posture (hasApp,resourceUri,csp,permissions, …) without invoking the tool; exits 0 when the tool has an app, 2 (no_app) when it doesn't — so a shell pipeline can short-circuit before touching a browser.--method tools/list --app-info— one NDJSON line per tool with its_meta.uiposture, over a single connect.--format json— a single JSON envelope on stdout (result+appInfoas sibling keys, no banner) for any method.Reference implementation (PR #1510)
Re-implement informed by these changes at
33fac3f:collectAppInfo()(uses coreextractAppInfo()+ resource read), NDJSON loop intools/list,emitResult()output envelope,OutputFormattype--format jsonenvelope testsDepends on
AppInfo+extractAppInfo()NO_APP = 2viaCliExitCodeError)mcp_app_demotest-server preset (live fixture for the tests)cli.tslane; land first)--format jsonand--app-infoare combined here becauseemitResult()branches on both — splitting them creates an artificial seam.Notes
resourceErrorfield, not thrown.--app-info,--format json, NDJSON shape, and the exit-2 semantics inclients/cli/README.md.Part of the PR #1510 decomposition (see tracking issue).