fix(plugins): improve MCP setup and configuration

Merged
WE
17h ago
+335-43

Description

MCP setup focuses Server Name when opened and when returning from Authentication.

MCP setup shows neutral indicators until a valid server URL starts discovery. Spinners begin after the existing 700-millisecond debounce. Clearing or changing the URL resets both indicators and cancels the previous probe.

OAuth Pass-through appears in the authentication dropdown when Onyx supports OAuth login, even with advanced settings collapsed. It remains an explicit choice.

Configuration now shows the server URL. Users with edit permission can change it; other viewers see a read-only field. Saving a new URL uses the existing backend credential reset and opens Authentication to reconnect and discover tools. The saved response replaces cached server data before reloading. Whitespace-only edits preserve the existing connection, and metadata-only saves omit the URL.

The preview also exposed missing client boundaries in Opal. The date-range picker and toast hooks now declare their client boundary at their source modules.

How Has This Been Tested?

  • Setup focus regression: 40 component tests passed; signed-in browser confirmed Server Name receives initial focus.
  • MCP setup and authentication component suites: 79 tests pass.
  • MCP configuration and detail component suites: 51 tests pass, including invalid URLs, edit permissions, unchanged URL preservation, and a failed reload after saving a new URL.
  • Date-range picker component suite: 6 tests pass.
  • Changed-file pre-commit checks pass, including TypeScript and type coverage, formatting, lint, and feature-map integrity.
  • Live signed-in preview: Configuration shows the saved URL and permits admin edits, with no browser page errors. No live server URL was changed.
  • Live preview: /app and /admin/plugins render without page errors. Blank MCP setup shows both discovery stages idle.

Additional Options

  • [Optional] Please cherry-pick this PR to the latest release version.

Summary by CodeRabbit

  • New Features

    • MCP server URLs can be edited with required HTTP(S) validation and remain read-only for viewers.
    • URL changes trigger authentication, reconnection, and tool rediscovery as needed.
    • OAuth pass-through is available whenever OAuth login is enabled.
    • Probe stages clearly show idle, pending, successful, and failed states.
    • Direct tab navigation and improved focus handling are supported in server setup and details.
  • Bug Fixes

    • Clearing or changing a URL resets probe status and cancels outdated checks.
    • Metadata-only saves preserve the existing endpoint.
    • Updated server details remain visible if reloading fails.