Summary
Programmatic-ergonomics flags and env-var fixes for the CLI:
--method initialize — connect-only probe; prints {serverInfo, protocolVersion, capabilities, instructions}.
--tool-args-json '{"k":"v"}' — pass tool args verbatim as JSON (no string→number coercion); mutually exclusive with --tool-arg.
--connect-timeout <ms> — default 15000 for ad-hoc --server-url invocations, 0 (none) for catalog/config-driven runs (withConnectTimeout() helper).
MCP_CATALOG_PATH no longer conflicts with an ad-hoc --server-url/target invocation (env catalog ignored when ad-hoc).
MCP_STORAGE_DIR honored alongside the per-file env override.
Reference implementation (PR #1510)
Re-implement informed by these changes at 33fac3f:
Depends on
- CLI exit-code map + error envelopes (usage errors and timeout classification build on it)
Wave 3 (CLI) lane — sequential with the other cli.ts issues; parallel to the Apps-host lane.
Notes
- Add a dedicated test for the ad-hoc vs file-based default-timeout split (the PR relies on integration coverage).
- Document new flags and env-var semantics in
clients/cli/README.md (docs rule).
- Coverage gate ≥90 on all four dimensions (
cli.ts is measured in-process via runCli()).
Part of the PR #1510 decomposition (see tracking issue).
Summary
Programmatic-ergonomics flags and env-var fixes for the CLI:
--method initialize— connect-only probe; prints{serverInfo, protocolVersion, capabilities, instructions}.--tool-args-json '{"k":"v"}'— pass tool args verbatim as JSON (no string→number coercion); mutually exclusive with--tool-arg.--connect-timeout <ms>— default 15000 for ad-hoc--server-urlinvocations, 0 (none) for catalog/config-driven runs (withConnectTimeout()helper).MCP_CATALOG_PATHno longer conflicts with an ad-hoc--server-url/target invocation (env catalog ignored when ad-hoc).MCP_STORAGE_DIRhonored alongside the per-file env override.Reference implementation (PR #1510)
Re-implement informed by these changes at
33fac3f:initializebranch incallMethod,--tool-args-jsonparse/merge,DEFAULT_CONNECT_TIMEOUT_MS+withConnectTimeout(),adHocdetection gatingMCP_CATALOG_PATHDepends on
Wave 3 (CLI) lane — sequential with the other
cli.tsissues; parallel to the Apps-host lane.Notes
clients/cli/README.md(docs rule).cli.tsis measured in-process viarunCli()).Part of the PR #1510 decomposition (see tracking issue).