feat(ui): remove MCP UI A/B test — widgets on for everyone, with showMcpUI opt-out setting - #494
feat(ui): remove MCP UI A/B test — widgets on for everyone, with showMcpUI opt-out setting#494edgarsskore wants to merge 6 commits into
Conversation
Add a user-editable showMcpUI config field that explicitly controls whether tools advertise interactive UI widgets. Decision priority: explicit override > A/B experiment assignment > default ON. - The decision is resolved once per server process so a session renders consistently; changing the setting takes effect after the client restarts the MCP server (mid-session tools-list flips confuse hosts that bind UI to the cached list). - set_config_value response and the field description note the restart requirement. - Config editor shows the effective decision when the value is unset, so the toggle reflects reality instead of rendering unset as off. - Config editor now shows a quiet inline "Saved" confirmation next to the setting that changed (covers toggles, inputs, shell select, and list modals); errors keep the floating tooltip. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
📝 WalkthroughWalkthroughThis PR changes ChangesMCP UI configuration and editor flow
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant MCPClient
participant ConfigTools
participant ConfigManager
participant MCPServer
MCPClient->>ConfigTools: get_config
ConfigTools->>ConfigManager: read showMcpUI
ConfigTools-->>MCPClient: effective showMcpUI value
MCPClient->>MCPServer: list_tools
MCPServer->>ConfigManager: resolve MCP UI decision
MCPServer-->>MCPClient: tool metadata with UI visibility
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/ui/config-editor/src/app.ts`:
- Line 593: The inline save-status chip (the <span class="setting-save-status"
data-save-status-key="${escapeHtml(entry.key)}" ...>) lacks live-region
semantics; update the span rendered in app.ts (the element that uses class
"setting-save-status" and data-save-status-key) to include role="status",
aria-live="polite", and aria-atomic="true" so assistive tech announces save
confirmations, and apply the same attributes to the other occurrences of the
same span (lines around where controlHtml is injected).
- Around line 642-643: The selector built with
querySelector(`[data-save-status-key="${key}"]`) can break for keys containing
CSS-special characters; update the lookup to escape the key using CSS.escape
before embedding it in the selector so the element is reliably found (i.e.,
replace the plain `${key}` usage when constructing the selector for
data-save-status-key used to set const chip = container.querySelector(...)).
Ensure you reference CSS.escape(key) so the selection logic always returns the
correct HTMLElement or null.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 4c5429b6-1fa3-4dd9-b532-09f72ca58612
📒 Files selected for processing (8)
src/config-field-definitions.tssrc/config-manager.tssrc/server.tssrc/tools/config.tssrc/ui/config-editor/src/app.tssrc/ui/styles/apps/config-editor.csssrc/utils/mcp-ui-ab-test.tstest/ab-test.test.js
The inline save-status chip replaced the floating live-region tooltip for success messages, which dropped screen-reader announcements. Mark the chip as a polite atomic status region so saves are announced again. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Keys currently come from CONFIG_FIELD_KEYS and are selector-safe, but the editor accepts arbitrary entry keys from structuredContent, so escape before embedding in querySelector. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
set_config_value already tagged server_call_tool with the key name, so we knew the setting was used but not which way it was set. Tag the boolean value for showMcpUI specifically (no path/PII concern); other config keys stay key-name only.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/server.ts`:
- Around line 1231-1233: The telemetry capture for the showMcpUI configuration
is not validating the input type before stringifying it. Add a type guard to
verify that the value is actually a boolean using typeof check before setting
telemetryData.set_config_value_bool. Only when the value passes the boolean type
check should you then stringify it and assign it to the telemetry field. This
prevents malformed client payloads from leaking arbitrary text into the
telemetry metric.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
kemo04
left a comment
There was a problem hiding this comment.
AI Code Review (PR Review Agent)
- [Test Coverage · High] —
src/utils/mcp-ui-ab-test.ts(diff line 307): New session-level memoization (sessionDecision) lacks tests to verify it persists across multiple calls.
kemo04
left a comment
There was a problem hiding this comment.
AI Code Review (PR Review Agent)
- [Test Coverage · High] —
src/utils/mcp-ui-ab-test.ts(diff line 307): New session-level memoization (sessionDecision) lacks tests to verify it persists across multiple calls.
rajpratham1
left a comment
There was a problem hiding this comment.
Nice addition! The showMcpUI override is well integrated with the existing A/B test flow, the session-level caching avoids inconsistent UI during runtime, and the accompanying tests cover the important decision paths. The config editor UX improvements (inline save status and restart note) are also a nice touch.
One small non-blocking suggestion: when recording showMcpUI telemetry, consider only capturing the value if it's actually a boolean to avoid malformed client payloads being stringified into telemetry. Otherwise, this looks good to me.
…wMcpUI kill switch The McpUiPreviews experiment is over — the remote flags now serve 100% showMCPUi, so the client-side A/B machinery is dead weight. Tools now always advertise UI widgets unless the user opts out. - Delete src/utils/mcp-ui-ab-test.ts and the A/B decision path; drop the now-unconsumed getABTestVariant accessor (hasFeature stays — the welcome page uses it). - Add showMcpUI config field (ports the functional half of #494 without the A/B layer): explicit boolean wins, anything else means shown. Decision stays pinned per server process so a session renders consistently; changes apply after the client restarts the server. - Config editor shows the effective decision while unset; set_config_value answers with a restart note and captures on/off telemetry for this key. - Stop emitting server_mcp_ui_ab_decision. - Prune the MCP UI cases from test/ab-test.test.js (general framework tests stay); add test-mcp-ui-toggle.js for the override matrix. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017nWHhwZuke1wLVUC6NKaDQ
…pUI override Resolves in favor of the cleanup for every overlap: the A/B decision layer is gone (flags serve 100% showMCPUi since v2.2.2), so the showMcpUI setting now reads 'explicit boolean wins, otherwise shown' via src/utils/mcp-ui.ts. The config-editor Saved-chip UX from this branch is unchanged. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017nWHhwZuke1wLVUC6NKaDQ
Add a user-editable showMcpUI config field that explicitly controls whether tools advertise interactive UI widgets. Decision priority: explicit override > A/B experiment assignment > default ON.
Summary by CodeRabbit
showMcpUIconfiguration so leaving it unset now shows MCP UI widgets by default (effective value is used in the config viewer).showMcpUIincludes an in-app note that it takes effect after restarting.