WebMCP Bridge

Use this skill to operate @webmcp-bridge/local-mcp through one fixed uxc shortcut command per site.

If the target site does not expose native WebMCP and does not already have a fallback adapter, switch to $webmcp-adapter-creator.

Prerequisites

Core Workflow

  1. Identify the bridge source mode before creating any link:
    • Native or polyfill target: use --url <url>.
    • Built-in adapter preset: use --site <site>.
    • Third-party adapter module: use --adapter-module <specifier> and optionally --url <url>.
  2. Pick one stable site name and one site-scoped profile path:
    • default profile root: ~/.uxc/webmcp-profile/<site>
    • never share one profile across different sites
  3. Create or refresh the fixed link for that site:
    • command -v <site>-webmcp-cli
    • if the link is missing or the source config changed, run skills/webmcp-bridge/scripts/ensure-links.sh
  4. Inspect the bridge and tool schema before calling tools:
    • <site>-webmcp-cli -h
    • <site>-webmcp-cli <operation> -h
    • <site>-webmcp-cli <operation> field=value
    • <site>-webmcp-cli <operation> '{"field":"value"}'
  5. Treat presentation mode as explicit runtime state, not command-name intent:
    • check current state with <site>-webmcp-cli bridge.session.status
    • or <site>-webmcp-cli bridge.session.mode.get
    • --headless or --no-headless only sets the preferred default for bridge-managed sessions
    • the actual runtime mode is presentationMode
  6. Switch modes explicitly when needed:
    • for normal automation, stay in headless
    • for login, MFA, or human collaboration, run <site>-webmcp-cli bridge.session.mode.set '{"mode":"headed"}'
    • then open or focus the visible session with <site>-webmcp-cli bridge.open
    • if the user manually closes that window, the headed owner session ends; run bridge.open again to start a new headed session on the same profile
    • close the visible owner session with <site>-webmcp-cli bridge.close
  7. Parse JSON output only:
    • success path: .ok == true, consume .data
    • failure path: .ok == false, inspect .error.code and .error.message

When Only Bridge Tools Are Visible

If <site>-webmcp-cli -h only shows bridge.* tools, do not keep retrying site tools blindly. The bridge is alive, but the page runtime is not attached to site tools yet.

Use this recovery order:

  1. Inspect session state first:
    • <site>-webmcp-cli bridge.session.status
  2. If the session is bootstrap-only or auth is incomplete:
    • run <site>-webmcp-cli bridge.session.bootstrap
    • complete login in the browser window
    • then re-run <site>-webmcp-cli -h
  3. If a browser/profile already exists but the session is not attached to page tools:
    • run <site>-webmcp-cli bridge.session.attach
    • then re-run <site>-webmcp-cli -h
  4. If the task needs a visible browser:
    • run <site>-webmcp-cli bridge.session.mode.set '{"mode":"headed"}'
    • run <site>-webmcp-cli bridge.open
  5. Only call site operations after help output shows site tools again.

For auth-sensitive adapter sites such as x and google, seeing only bridge tools during first use is expected until bootstrap or attach completes successfully.

Link Contract

Every site gets one fixed command:

The link must keep one stable site profile and daemon lock:

The generated command should default to:

This keeps automation deterministic while still allowing runtime switching through:

Do not treat one command invocation as a guarantee that the current runtime has already switched. Always inspect presentationMode when mode matters.

Guardrails

References