Skip to content

fix(mcp): classify network, TLS, and HTTP errors in inspect failures#688

Merged
esengine merged 1 commit into
esengine:mainfrom
dimasd-angga:fix/issue-101-make-reasonix-mcp-inspect-errors-actiona
May 12, 2026
Merged

fix(mcp): classify network, TLS, and HTTP errors in inspect failures#688
esengine merged 1 commit into
esengine:mainfrom
dimasd-angga:fix/issue-101-make-reasonix-mcp-inspect-errors-actiona

Conversation

@dimasd-angga

Copy link
Copy Markdown

Summary

Extends formatMcpInspectFailure to cover the long tail of failure modes the maintainer flagged as still missing: DNS/network errors, TLS cert validation errors, and HTTP non-2xx responses from the SSE and Streamable-HTTP transports. Each new branch turns a raw Node error code or bare status line into a targeted — try: … hint so users have a next step instead of a stack-trace fragment. Protocol-version mismatch is intentionally left out per the maintainer's note that it depends on tightening client.initialize() first.

Changes

  • src/cli/commands/mcp-inspect.ts: add classifier branches for ENOTFOUND/EAI_AGAIN (DNS), ECONNRESET (transient), ETIMEDOUT (firewall/reachability), and the TLS code family (CERT_HAS_EXPIRED, DEPTH_ZERO_SELF_SIGNED_CERT, UNABLE_TO_VERIFY_LEAF_SIGNATURE, SELF_SIGNED_CERT_IN_CHAIN).
  • src/cli/commands/mcp-inspect.ts: add matchTransportHttpStatus + hintForHttpStatus helpers that match the three exact message shapes emitted by src/mcp/sse.ts and src/mcp/streamable-http.ts and map 401/403/404/5xx to auth, permission, endpoint-path, and server-side hints respectively.
  • tests/mcp-inspect.test.ts: add five tests covering DNS, reset/timeout, TLS, 401 across all three transport message shapes, and 403/404/5xx.

Testing

npm test -- tests/mcp-inspect.test.ts — passes.

Notes

  • The HTTP-status branch is anchored to the literal message shapes in src/mcp/sse.ts and src/mcp/streamable-http.ts. If those strings drift, the regex falls through to the existing unchanged tail rather than misclassifying — same safe default as today, but worth knowing if those transports get reworded.
  • Protocol-version mismatch is deliberately not handled here; per the earlier comment that needs client.initialize() tightened first and is better as a separate change.

Closes #101

Raw Node error codes and bare HTTP status lines from SSE/Streamable-HTTP transports leave users guessing at the next step. Mapping DNS/connection/TLS codes and 401/403/404/5xx responses to targeted `try:` hints turns `reasonix mcp inspect` output into something users can act on without reading the source.
@esengine esengine merged commit e22904d into esengine:main May 12, 2026
3 checks passed
esengine added a commit that referenced this pull request May 12, 2026
…il, CardStream fix (#705)

npm-only release. The Tauri desktop source is in the repo and the CLI
subcommand works, but installer bundles for macOS / Windows / Linux
don't ship this round (separate release once signing's settled).

Highlights:
- Tauri desktop client with multi-tab concurrent runtimes (#689)
  plus a near-full polish pass: wallet balance, version chip, active-
  plan rail, abortable pause-gates, edit-gate pill, en + zh-CN i18n,
  shared pause-policy module dedup'd with the CLI TUI (#701)
- checkpoint API + git-changes panel in the embedded dashboard (#682)
- outside-sandbox file access approval modal (#696)
- MCP loading pill + readiness gate on tool dispatch (#687)
- escalate-after flag for flash → pro threshold (#699)

Fixes:
- CardStream Maximum-update-depth crash, quantize window so boundary
  cards stop oscillating (#700, #702)
- `reasonix code` bridges config key to env + lazy subagent client so
  fresh installs can reach the setup wizard (#703)
- pinned-mode scroll shrinks coalesced (#666), generic CSI key decode
  (#692), shell-confirm preview clamp (#691), frontmatter BOM/folded
  lines (#690), MCP error classification (#688), and more
ChasLui pushed a commit to ChasLui/DeepSeek-Reasonix that referenced this pull request May 23, 2026
…sengine#688)

Raw Node error codes and bare HTTP status lines from SSE/Streamable-HTTP transports leave users guessing at the next step. Mapping DNS/connection/TLS codes and 401/403/404/5xx responses to targeted `try:` hints turns `reasonix mcp inspect` output into something users can act on without reading the source.
ChasLui pushed a commit to ChasLui/DeepSeek-Reasonix that referenced this pull request May 23, 2026
…il, CardStream fix (esengine#705)

npm-only release. The Tauri desktop source is in the repo and the CLI
subcommand works, but installer bundles for macOS / Windows / Linux
don't ship this round (separate release once signing's settled).

Highlights:
- Tauri desktop client with multi-tab concurrent runtimes (esengine#689)
  plus a near-full polish pass: wallet balance, version chip, active-
  plan rail, abortable pause-gates, edit-gate pill, en + zh-CN i18n,
  shared pause-policy module dedup'd with the CLI TUI (esengine#701)
- checkpoint API + git-changes panel in the embedded dashboard (esengine#682)
- outside-sandbox file access approval modal (esengine#696)
- MCP loading pill + readiness gate on tool dispatch (esengine#687)
- escalate-after flag for flash → pro threshold (esengine#699)

Fixes:
- CardStream Maximum-update-depth crash, quantize window so boundary
  cards stop oscillating (esengine#700, esengine#702)
- `reasonix code` bridges config key to env + lazy subagent client so
  fresh installs can reach the setup wizard (esengine#703)
- pinned-mode scroll shrinks coalesced (esengine#666), generic CSI key decode
  (esengine#692), shell-confirm preview clamp (esengine#691), frontmatter BOM/folded
  lines (esengine#690), MCP error classification (esengine#688), and more
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make reasonix mcp inspect errors actionable

2 participants