Skip to content

web: deep-link auto-connect (?serverUrl&transport&autoConnect) + machine-readable connection status #1576

Description

@cliffhall

Summary

URL-driven auto-connect with a machine-readable status surface, so a driver can reach a connected inspector with one navigate:

http://127.0.0.1:6274/?serverUrl=<url>&transport=http|sse&autoConnect=<token>
  • parseDeepLink() / deepLinkParseStatus() in a new clients/web/src/utils/deepLink.ts: serverUrl restricted to http(s) (rejects javascript:/data:/file:); autoConnect must equal the per-launch MCP_INSPECTOR_API_TOKEN (CSRF gate — same exposure as the existing ?MCP_INSPECTOR_API_TOKEN= param); stable deep-link server id so reloads reconnect to the same row.
  • App.tsx: ensure/connect effects — upsert the full server config (not just the URL), then connect via a fresh closure; connectErrorMessage records connection-level failures.
  • InspectorView header: data-testid="connection-status" with data-status, data-error-message, and data-deeplink="parsed|rejected|none" so drivers can waitForSelector and read failure reasons without scraping toasts.

Why

Reaching a connected inspector today takes several manual steps; automation has no deterministic signal for "connected" or "why not". This implements the v2 version of #1183 (?autoConnect query param).

Reference implementation (PR #1510)

Re-implement informed by these changes at 33fac3f:

Depends on

Wave 4 — after the Wave 2/3 lanes. The openApp/appArgs/autoOpen params are a separate follow-up issue.

Refs #1183.

Notes

  • The token gate is the security boundary: a launcher/agent that knows the token can mint links; a third-party page cannot. Keep the validation inside parseDeepLink() so a returned DeepLink is proof of validation.
  • Document the deep-link scheme and the data-* contract in clients/web/README.md.
  • Coverage gate ≥90 on all four dimensions.

Part of the PR #1510 decomposition (see tracking issue).

Metadata

Metadata

Assignees

Labels

v2Issues and PRs for v2

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions