MCP.so
Sign In

WebdriverIO MCP

@webdriverio

About WebdriverIO MCP

A Model Context Protocol (MCP) server that enables AI assistants to interact with web browsers and mobile applications using WebDriverIO. Automate Chrome browsers, iOS apps, and Android apps—all through a unified interface.

Config

Add this server to your MCP-compatible client using the configuration below.

{
  "mcpServers": {
    "wdio-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@wdio/mcp"
      ]
    }
  }
}

Tools

31

Starts a new browser or mobile automation session. Only one active session at a time — starting another session closes or detaches from the existing session first. Use attach: true to connect to a running Chrome via CDP.

Attaches to an existing remote WebDriver or Appium session by ID without creating a new session. Only one session can be active at a time. The externally managed session is detached, not terminated, by default on close.

Closes the current session or detaches without terminating. Detach preserves app state on the Appium server — sessions with noReset: true auto-detach by default. Closing a browser attach session terminates chromedriver but the Chrome process spawned by launch_chrome remains running.

Launches Chrome with remote debugging enabled. Wipes and recreates a temporary profile directory on each call. Mode "newInstance" (default) runs alongside existing Chrome; "freshSession" starts with an empty profile. Set copyProfileFiles to copy cookies/logins from your Default profile — changes do not sync back. After launch, call start_session with attach: true to connect. Spawns a detached Chrome process that persists if the server exits.

Emulates a mobile or tablet device in the current browser session by setting viewport, DPR, user-agent, and touch events. Requires a BiDi-enabled session (start_session with capabilities: { webSocketUrl: true }). Omit device to list available presets. Pass "reset" to restore desktop defaults. Changes persist for all subsequent tool calls until reset or session close. Browser-only.

Loads a URL in the current tab and waits for the page load event. Resets page state — DOM, JS runtime, timers, and frame context are destroyed. Use instead of clicking links when the target URL is known.

Focuses a browser tab by window handle or 0-based index. All subsequent tool calls operate on the active tab. Provide handle OR index — use get_tabs to find them. Browser-only; use switch_context for mobile webviews.

Switches WebDriver frame context into an iframe by CSS/XPath selector, or back to top-level if selector is omitted. Changes persist — all subsequent click_element, set_value, get_elements calls operate within the switched frame until you switch back. Waits up to 5s for the iframe. Browser-only.

Scrolls the page vertically by a pixel amount. Browser-only — for mobile scrolling use swipe. Only supports up/down; no horizontal scrolling.

Waits for an element, scrolls it into view, and fires element.click(). May trigger navigation, form submission, or modals. Browser sessions only — on iOS element.click() is silently ignored; use tap_element instead. Default timeout: 3000ms.

Clears an input or textarea then types the given text character by character. Always replaces existing content — clearValue() runs first. Triggers input, change, and key events which may fire validation or autocomplete. Scrolls into view by default.

Sets a browser cookie on the active session. The browser must already be on the target domain — cookies cannot be set cross-domain. Use to inject session tokens or feature flags without login flows.

Deletes all cookies or a single cookie by name from the current browser session. Irreversible — deleted cookies cannot be recovered.

Taps a matched element via element.tap() or at absolute screen coordinates (x, y). No scroll-into-view or wait — element must already be visible on screen. Use instead of click_element on iOS where element.click() is ignored. Provide selector OR both x and y. Mobile-only.

Performs a full-screen swipe gesture. Direction is content movement — "up" scrolls content upward (finger moves down). For browser scrolling use scroll; for dragging a specific element use drag_and_drop. No error if content cannot scroll further. Mobile-only.

Drags an element to another element or to relative x/y offsets. x and y are offsets from the source element, not absolute screen coordinates (unlike tap_element). Provide targetSelector OR both x and y. Mobile-only.

Switches between native and webview automation contexts in a hybrid mobile app. In NATIVE_APP context, use accessibility IDs; in WEBVIEW_* context, use CSS/XPath. Changes persist for all subsequent commands. Accepts context name or 1-based index. Use get_contexts to discover available targets. Mobile-only.

Rotates a mobile device to portrait or landscape orientation. Waits for the OS rotation animation to complete. Use to test orientation-dependent layouts. Mobile-only; no effect in browser sessions.

Dismisses the on-screen keyboard on mobile. Call after text entry when the keyboard obscures elements. No-op if already hidden. Mobile-only.

Overrides GPS coordinates for the session. Affects navigator.geolocation in browsers and location services on mobile. Location permissions must already be granted to the app.

Executes arbitrary JavaScript in browser page context or Appium mobile: commands. Can read/modify DOM, trigger events, terminate apps, or run Android shell commands — use only when no dedicated tool covers the action. Browser: pass JS in script, use 'return' for values, string args matching selectors auto-resolve to elements. Mobile: use 'mobile: <command>' syntax in script with args array (e.g. "mobile: pressKey", "mobile: activateApp"). Prefer click_element/set_value/get_elements for standard interactions.

Returns interactable elements on the current page with selectors, text, and bounding boxes. Supports filtering by element type, viewport visibility, and pagination. Use when the wdio://session/current/elements resource does not return desired elements.

Installs a web extension through WebDriver BiDi and opens one of its extension pages so existing MCP tools can inspect and drive its UI. Requires a BiDi-enabled browser session. Use base64 for cloud/remote sessions where the browser driver cannot read the MCP server filesystem.

List apps uploaded to a cloud provider (BrowserStack App Automate, Sauce Labs App Storage, TestMu Real Device Cloud, TestingBot Storage, or Digital.ai Applications). Reads provider-specific credentials from environment.

Upload a local .apk or .ipa to a cloud provider (BrowserStack, Sauce Labs, TestMu, TestingBot, or Digital.ai). Returns the app URL for use in start_session.

Takes a screenshot of the current page or screen and returns a base64-encoded image, resized and compressed for model context limits.

Returns the page accessibility tree with roles, names, and selectors. Browser-only. Supports filtering by ARIA roles and pagination via limit/offset.

Lists all browser tabs with handle, title, URL, and which is active. Use before switch_tab to find the target handle or index. Browser-only.

Returns available automation contexts and the currently active one. Use before switch_context to discover NATIVE_APP and WEBVIEW_* targets. Mobile-only.

Returns the current state of a mobile app: not installed, not running, background, or foreground. Mobile-only.

Returns all cookies for the current session, or a single cookie by name. Use to verify auth state, session tokens, or feature flags after login flows.

Overview

What is WebdriverIO MCP?

WebdriverIO MCP is a Model Context Protocol server that enables Claude Desktop to automate web browsers (Chrome, Firefox, Edge, Safari) and mobile apps (iOS and Android) through WebDriverIO. It provides a unified interface for browser and mobile app testing, including session management, element interaction, gestures, and device control.

How to use WebdriverIO MCP?

Add the server configuration to your Claude Desktop MCP settings using either npx -y @wdio/mcp or a globally installed wdio-mcp binary. For mobile automation, install Appium globally and the required platform drivers (xcuitest for iOS, uiautomator2 for Android). Start an Appium server before using mobile features. Then launch Claude Desktop and interact with browsers or apps using the provided tools (e.g., start_browser, start_app_session, navigate, click_element).

Key features of WebdriverIO MCP

  • Start browser sessions in headed or headless modes
  • Navigate URLs, click elements, fill forms, and take screenshots
  • Manage cookies (get, set, delete)
  • Attach to a running Chrome instance via remote debugging
  • Emulate mobile devices (iPhone 15, Pixel 7) with BiDi sessions
  • Record all tool calls as executable WebDriverIO JS
  • Test native iOS/Android apps with gestures, app lifecycle, and context switching
  • Switch between native and webview contexts for hybrid apps

Use cases of WebdriverIO MCP

  • Automate web application testing across multiple browsers and viewports
  • Test mobile apps on emulators/simulators or real devices with gestures and state preservation
  • Attach to an authenticated browser session to test pre-configured workflows
  • Emulate mobile devices without physical hardware for responsive layout testing
  • Record and export test steps as runnable WebDriverIO scripts

FAQ from WebdriverIO MCP

Which browsers are supported?

Chrome, Firefox, Edge, and Safari. Safari is headed only and requires macOS. Browser sessions support custom capabilities like profiles or extensions.

What are the prerequisites for mobile automation?

Install Appium globally (npm install -g appium), then install platform drivers: appium driver install xcuitest (iOS, requires Xcode) and appium driver install uiautomator2 (Android, requires Android Studio). You need an emulator/simulator or a physical device. For iOS real devices, you need the device UDID.

How do I attach to a running Chrome instance?

First launch Chrome with --remote-debugging-port (e.g., port 9222). Then use the attach_browser tool in Claude Desktop. You can specify a custom port or navigation URL.

How does device emulation work?

Start a BiDi session by setting webSocketUrl: true in capabilities. Then use emulate_device to list presets or apply a specific device (e.g., iPhone 15, Pixel 7). Use reset to restore desktop defaults.

Can I preserve app state between sessions?

Yes. Use noReset: true and fullReset: false when starting a mobile app session. The app remains installed with its data intact across sessions.

Frequently asked questions

Which browsers are supported?

Chrome, Firefox, Edge, and Safari. Safari is headed only and requires macOS. Browser sessions support custom capabilities like profiles or extensions.

What are the prerequisites for mobile automation?

Install Appium globally (`npm install -g appium`), then install platform drivers: `appium driver install xcuitest` (iOS, requires Xcode) and `appium driver install uiautomator2` (Android, requires Android Studio). You need an emulator/simulator or a physical device. For iOS real devices, you need the device UDID.

How do I attach to a running Chrome instance?

First launch Chrome with `--remote-debugging-port` (e.g., port 9222). Then use the `attach_browser` tool in Claude Desktop. You can specify a custom port or navigation URL.

How does device emulation work?

Start a BiDi session by setting `webSocketUrl: true` in capabilities. Then use `emulate_device` to list presets or apply a specific device (e.g., iPhone 15, Pixel 7). Use `reset` to restore desktop defaults.

Can I preserve app state between sessions?

Yes. Use `noReset: true` and `fullReset: false` when starting a mobile app session. The app remains installed with its data intact across sessions.

Comments

More Other MCP servers