Skip to content

feat(cli): add connect/discover timeout override flags for manual introspect#150

Merged
bug-ops merged 1 commit into
masterfrom
144-145-timeout-overrides
Jul 9, 2026
Merged

feat(cli): add connect/discover timeout override flags for manual introspect#150
bug-ops merged 1 commit into
masterfrom
144-145-timeout-overrides

Conversation

@bug-ops

@bug-ops bug-ops commented Jul 9, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add --connect-timeout-secs / --discover-timeout-secs flags to the manual (non---from-config) introspect and generate commands, routed through the same validate_server_config chokepoint used by the mcp.json (--from-config) path, so both paths accept/reject identical values. Flags conflict with --from-config via clap.
  • Document the decision to permanently reject a 0 connect/discover timeout rather than treat it as "no timeout": an unbounded wait would let a hung or malicious server block this tool's non-interactive CLI/MCP-server invocations forever, reopening the DoS exposure these timeouts were introduced to close. No behavior change.
  • Resolves the two TODO(critic) markers left by feat(core): allow mcp.json to override connect/discover timeouts #136.

Closes #144, closes #145

Test plan

  • cargo +nightly fmt --check
  • cargo +stable clippy --all-targets --all-features --workspace -- -D warnings
  • cargo nextest run --all-features --workspace --no-fail-fast (739 passed)
  • cargo test --doc --all-features --workspace
  • RUSTDOCFLAGS="--deny rustdoc::broken_intra_doc_links -D warnings" cargo doc --no-deps --workspace
  • Manual smoke test: --connect-timeout-secs 0 rejected with the same error as the mcp.json path; --connect-timeout-secs 5 accepted; --from-config X --connect-timeout-secs 5 rejected by clap as conflicting args

@github-actions github-actions Bot added area: cli CLI commands and interface area: core Core types and infrastructure crate: mcp-core Changes to mcp-core crate (foundation types, traits, errors) crate: mcp-cli Changes to mcp-cli crate (command-line interface) type: documentation Documentation changes (*.md, docs/, comments) breaking change Contains breaking API changes (requires major version bump) release Release preparation (changelog, version bumps) labels Jul 9, 2026
@bug-ops
bug-ops enabled auto-merge (squash) July 9, 2026 17:19
…rospect

Expose --connect-timeout-secs and --discover-timeout-secs on the manual
(non-from-config) introspect and generate commands, routed through the
same validate_server_config chokepoint used by mcp.json's
connectTimeoutSecs/discoverTimeoutSecs, so both paths accept and reject
identical values.

Also documents the decision to permanently reject a zero timeout rather
than treat it as "no timeout": an unbounded wait would let a hung or
malicious server block this tool's non-interactive CLI/MCP-server
invocations forever, reopening the DoS exposure these timeouts were
introduced to close.

Resolves the two TODO(critic) markers left by #136.

Closes #144, #145
@bug-ops
bug-ops force-pushed the 144-145-timeout-overrides branch from 0deab80 to 881b6eb Compare July 9, 2026 17:21
@bug-ops
bug-ops merged commit 7e99f58 into master Jul 9, 2026
17 checks passed
@bug-ops
bug-ops deleted the 144-145-timeout-overrides branch July 9, 2026 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: cli CLI commands and interface area: core Core types and infrastructure breaking change Contains breaking API changes (requires major version bump) crate: mcp-cli Changes to mcp-cli crate (command-line interface) crate: mcp-core Changes to mcp-core crate (foundation types, traits, errors) release Release preparation (changelog, version bumps) type: documentation Documentation changes (*.md, docs/, comments)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

revisit whether an infinite-timeout option is needed for connect/discover expose connect/discover timeout flags for manual introspect

1 participant