Skip to content

fix(settings): surface the server's validation detail on Add MCP Server failure - #6283

Open
AmirF194 wants to merge 1 commit into
odysseus-dev:devfrom
AmirF194:fix/6215-settings-js-detail-message
Open

AmirF194 wants to merge 1 commit into
odysseus-dev:devfrom
AmirF194:fix/6215-settings-js-detail-message

Conversation

@AmirF194

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #6215. After merging, reviewer o3LL noted that static/js/settings.js's Add MCP Server failure branch still shows a generic Failed (${r.status}) instead of the server's actual validation message, and flagged it as fine for a separate PR. routes/mcp/mcp_routes.py's add_server() returns HTTPException(400, "...") for every validation failure (missing command, missing URL, malformed Args), and FastAPI puts that message in the response body's detail field. static/js/admin.js's own Add MCP Server handler already reads it (data.detail || \Failed (${res.status})``, admin.js:2391); settings.js's copy of the same form never picked it up. This fix mirrors that existing line exactly.

Target branch

  • This PR targets dev, not main.

Linked Issue

Fixes #6282

Type of Change

  • Bug fix (non-breaking, fixes a confirmed issue)

Checklist

  • I searched open issues and open PRs, this is not a duplicate.
  • This PR targets dev
  • My changes are limited to the scope described above, no unrelated refactors or whitespace changes mixed in.
  • I actually ran the app (docker compose up or uvicorn app:app) and verified the change works end-to-end. Type-checks and unit tests are not enough.
  • I did not run the app/runtime validation and stated that gap in How to Test.

How to Test

  1. node --check static/js/settings.js passes.
  2. Extracted the exact uf-mcp-save click handler, the real source lines rather than a rewritten copy, from both origin/dev and this branch, and ran each in a Node vm sandbox with a mocked 400 response carrying {"detail": "command is required for stdio transport"}: the dev version renders Failed (400), this branch renders the server's actual message. The other three branches of that if/else (needs_auth, connected, plain Saved) are untouched by the diff.
  3. Not run: the actual app end-to-end, so no screenshot below. This module has no existing test harness reaching initUnifiedIntegrations's MCP form (tests/helpers/test_settings_shell*.js cover the extracted settings/*.js shell modules, a different file), and the equivalent line in admin.js is likewise untested today.

Visual / UI changes, REQUIRED if you touched anything that renders

  • Screenshot or short clip of the change in the running app, not attached, see point 3 above.
  • Style match: no new CSS, colors, or component patterns; reuses the existing #uf-mcp-msg status line and the exact fallback already used at admin.js:2391 for the same failure.
  • No new component patterns.
  • I am not an LLM agent submitting a bulk PR. Per this note's own instruction for that case: the issue (settings.js Add MCP Server failure path shows generic status instead of the server's detail message #6282) was opened first, describing the problem, before this PR.

@github-actions

Copy link
Copy Markdown

⚠️ PR description is complete; validation evidence is still outstanding

Changed-file classification: UI-sensitive.

Author-reported runtime / visual state

  • The author explicitly reports that app/runtime validation was not performed.
  • The screenshot/clip checkbox is not checked for this UI-sensitive change.
  • The Screenshots / clips section does not contain an actual attachment or link.

Checkboxes are author attestations. GitHub Actions results remain the execution evidence for CI; this check does not prove that a local command ran.


This comment updates automatically when the description or changed files change.

@github-actions github-actions Bot added needs runtime validation Runtime validation not attested — tick the app-run box after running it, or state the gap needs visual evidence UI-sensitive change without an attested screenshot or clip from the running app labels Sep 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs runtime validation Runtime validation not attested — tick the app-run box after running it, or state the gap needs visual evidence UI-sensitive change without an attested screenshot or clip from the running app

Projects

None yet

Development

Successfully merging this pull request may close these issues.

settings.js Add MCP Server failure path shows generic status instead of the server's detail message

1 participant