Skip to content

fix(cli): preserve MCP call results and structured errors - #1731

Merged
Dumbris merged 4 commits into
mainfrom
codex/ux-cli-result-parity
Oct 22, 2026
Merged

Dumbris merged 4 commits into
mainfrom
codex/ux-cli-result-parity

Conversation

@Dumbris

@Dumbris Dumbris commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

Description

Fix UX audit F4: CLI calls converted content arrays to Go map text and dropped MCP result metadata. CLI now opts into a full MCP result envelope and preserves content, structuredContent, isError, and _meta. Existing REST consumers retain their response shape. Runtime JSON failures remain machine-readable; MCP isError results return nonzero in JSON and pretty output, without a false success message.

Testing

  • Reproduced content and metadata loss before the fix.
  • Full CLI-client package and focused CLI/server/HTTP API tests; core build and go vet ./cmd/mcpproxy pass.
  • Live scratch daemon verified CLI/MCP semantic parity for text+image content, structuredContent, metadata, text errors, empty-content errors and image-first errors. JSON failures parse and exit nonzero. Pretty-mode errors exit nonzero without success text. Ordinary REST remains an array; opted-in REST preserves the envelope.
  • Independent fresh-context Claude CLI (claude-fable-5-1) review: VERDICT: PASS at 0035525 after error-envelope, pretty-exit and unreachable-code fixes.
  • Exact-head qa-gate: success. CI must pass before merge.

The opt-in X-MCPProxy-Result-Envelope: 1 compatibility contract is documented in docs/cli-output-formatting.md; tool refusal/security classification stays ahead of envelope preservation.

Live fixture CLI excerpt (same semantic result as MCP):

{"content":[{"type":"text","text":"{\"project\":\"audit-fixture\",\"status\":\"healthy\"}"},{"type":"image","data":"YWJj","mimeType":"image/png"}],"isError":false,"structuredContent":{"count":2,"status":"healthy"},"_meta":{"fixture":"cli-live"}}

A fixture isError: true returns exit 1 in both JSON and pretty modes.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Deploying mcpproxy-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 0035525
Status: ✅  Deploy successful!
Preview URL: https://bb3a7ba2.mcpproxy-docs.pages.dev
Branch Preview URL: https://codex-ux-cli-result-parity.mcpproxy-docs.pages.dev

View logs

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 63.82979% with 34 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cmd/mcpproxy/call_cmd.go 56.81% 18 Missing and 1 partial ⚠️
internal/cliclient/client.go 42.10% 11 Missing ⚠️
internal/reqcontext/toolresult.go 0.00% 4 Missing ⚠️

📢 Thoughts on this report? Let us know!

@github-actions

Copy link
Copy Markdown
Contributor

📦 Build Artifacts

Workflow Run: View Run
Branch: codex/ux-cli-result-parity

Available Artifacts

  • archive-darwin-amd64 (32 MB)
  • archive-darwin-arm64 (28 MB)
  • archive-linux-amd64 (19 MB)
  • archive-linux-arm64 (17 MB)
  • archive-windows-amd64 (31 MB)
  • archive-windows-arm64 (28 MB)
  • frontend-dist-pr (0 MB)
  • installer-dmg-darwin-amd64 (28 MB)
  • installer-dmg-darwin-arm64 (25 MB)
  • smart-mcp-proxymcpproxy-goUDDXXE.dockerbuild (0 MB)

How to Download

Option 1: GitHub Web UI (easiest)

  1. Go to the workflow run page linked above
  2. Scroll to the bottom "Artifacts" section
  3. Click on the artifact you want to download

Option 2: GitHub CLI

gh run download 39722580601 --repo smart-mcp-proxy/mcpproxy-go

Note: Artifacts expire in 14 days.

@Dumbris
Dumbris merged commit ba51774 into main Oct 22, 2026
54 checks passed
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.

2 participants