Skip to content

Support ?autoConnect=true query param to connect on page load #1183

@renatogcarvalho

Description

@renatogcarvalho

Problem

The Inspector already honors several query params to pre-populate the connection form on launch:

Together these let an external tool build a deep-link that drops the user directly into a fully-configured Inspector session — except the user still has to click Connect manually. There is currently no query param, env var, or config flag that asks the Inspector to call connectMcpServer() once the initial state is hydrated from the URL.

Use case

We launch the Inspector as a docker-compose sidecar next to our MCP server during local development. The dev script (up.sh) builds a deep-link with transport, serverUrl, and the freshly-generated MCP_PROXY_AUTH_TOKEN and opens it in the developer's default browser, so the Inspector is ready the moment the MCP server is healthy.

The "Connect" click after every restart is a small but constant friction point — the deep-link contains every piece of information needed to connect, so requiring a manual click is essentially a UX gap, not a security or design constraint.

Other plausible callers with the same problem: editor extensions that "open in Inspector", CLI debuggers, CI smoke tests that drive the Inspector via Playwright, demo scripts.

Proposed behavior

Add a ?autoConnect=true query param. When present, the Inspector calls connectMcpServer() once after the initial connection state has been populated from the URL/localStorage.

Desirable properties:

  • Opt-in. Default behavior is unchanged for users who type the URL or click bookmarks.
  • One-shot. The param is consumed on first use and stripped from the URL, so refreshes / disconnect cycles don't re-trigger.
  • Composable. Works alongside the existing pre-fill params — no new server-side flag, no /config change.
  • Transport-aware. For transport=stdio it requires serverCommand to also be present (which getInitialCommand() already supports), so the same flag works across transports.

Alternatives considered

  • Server-side flag (e.g. an env var on the Inspector process): rejected because it would apply globally to every browser tab, including humans who just want to inspect a different server. A query param scopes the behavior to the launch.
  • Bookmarklet / external auto-clicker: brittle, fragile against UI changes, and doesn't work cleanly across browsers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions