Skip to content

feat(ui): remove MCP UI A/B test — widgets on for everyone, with showMcpUI opt-out setting - #494

Open
edgarsskore wants to merge 6 commits into
mainfrom
feat/config-ui-enable
Open

feat(ui): remove MCP UI A/B test — widgets on for everyone, with showMcpUI opt-out setting#494
edgarsskore wants to merge 6 commits into
mainfrom
feat/config-ui-enable

Conversation

@edgarsskore

@edgarsskore edgarsskore commented Jun 5, 2026

Copy link
Copy Markdown
Collaborator

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.

Summary by CodeRabbit

  • New Features
    • Updated the showMcpUI configuration so leaving it unset now shows MCP UI widgets by default (effective value is used in the config viewer).
    • Changing showMcpUI includes an in-app note that it takes effect after restarting.
  • UI Improvements
    • Config editor now shows per-setting “Saved” confirmation chips after successful updates (with inline success feedback).
  • Bug Fixes
    • UI-origin config/tool calls now have improved telemetry and UI-specific handling.
    • Tool execution now returns gentle warnings for unsupported parameters instead of failing.
  • Tests
    • Added tests for MCP UI enablement/override boolean handling, and adjusted A/B related test coverage.

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>
@coderabbitai

coderabbitai Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

This PR changes showMcpUI so widgets are shown unless explicitly disabled, adds serialized and non-blocking config persistence, updates server and config-tool behavior, removes the prior A/B override path, and adds inline saved indicators to the configuration editor.

Changes

MCP UI configuration and editor flow

Layer / File(s) Summary
Configuration persistence and onboarding state
src/config-manager.ts
Config writes are serialized or coalesced in the background, setValueNonBlocking() is added, onboarding eligibility is defaulted and backfilled, and unset showMcpUI is documented as shown.
MCP UI visibility decision
src/utils/mcp-ui.ts, src/utils/mcp-ui-ab-test.ts, src/utils/ab-test.ts
MCP UI settings accept boolean overrides, cache the process-wide decision, and no longer use explicit overrides in the previous A/B preview resolver; the unused variant helper is removed.
Config tools and server integration
src/config-field-definitions.ts, src/tools/config.ts, src/server.ts
Tool metadata and config responses use shouldShowMcpUi(), descriptions document restart behavior, and showMcpUI updates emit dedicated telemetry.
Inline configuration save feedback
src/ui/config-editor/src/app.ts, src/ui/styles/apps/config-editor.css
Successful updates display keyed, temporary “Saved” indicators beside the affected setting controls, with fallback tooltip handling.
MCP UI behavior tests
test/test-mcp-ui-toggle.js, test/ab-test.test.js
Tests cover boolean and non-boolean MCP UI values, while obsolete A/B override decision tests and helpers are removed.

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
Loading

Possibly related PRs

Suggested reviewers: wonderwhy-er

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 37.50% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: removing the MCP UI A/B test and making widgets enabled by default with a showMcpUI opt-out.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/config-ui-enable

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@edgarsskore
edgarsskore marked this pull request as ready for review June 10, 2026 11:35

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 7126346 and d3f6696.

📒 Files selected for processing (8)
  • src/config-field-definitions.ts
  • src/config-manager.ts
  • src/server.ts
  • src/tools/config.ts
  • src/ui/config-editor/src/app.ts
  • src/ui/styles/apps/config-editor.css
  • src/utils/mcp-ui-ab-test.ts
  • test/ab-test.test.js

Comment thread src/ui/config-editor/src/app.ts Outdated
Comment thread src/ui/config-editor/src/app.ts Outdated
edgarsskore and others added 3 commits June 10, 2026 14:55
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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a0023003-4c9c-4b51-a2dc-71865b001252

📥 Commits

Reviewing files that changed from the base of the PR and between 6e685ea and c2c70c0.

📒 Files selected for processing (1)
  • src/server.ts

Comment thread src/server.ts

@kemo04 kemo04 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 kemo04 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 rajpratham1 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

edgarsskore and others added 2 commits July 30, 2026 11:11
…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
@edgarsskore edgarsskore changed the title feat(config): add showMcpUI setting to enable/disable MCP UI widgets feat(ui): remove MCP UI A/B test — widgets on for everyone, with showMcpUI opt-out setting Jul 30, 2026
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.

4 participants