# WebDriverIO MCP server

> Enables AI assistants to automate web browsers, local Electron applications, and mobile apps on iOS and Android.

- Repository: https://github.com/webdriverio/mcp
- Page: https://hostedmcp.org/servers/webdriverio/mcp
- Transport: stdio
- Stars: 44
- License: MIT
- Latest version: 4.1.0

## Install

### Claude Code

```sh
claude mcp add mcp -- npx -y @wdio/mcp
```

### Cursor (`~/.cursor/mcp.json`)

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

### VS Code (`.vscode/mcp.json`)

```json
{
  "servers": {
    "mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@wdio/mcp"
      ]
    }
  }
}
```

### VS Code CLI

```sh
code --add-mcp '{"name":"mcp","type":"stdio","command":"npx","args":["-y","@wdio/mcp"]}'
```

### Claude Desktop (`claude_desktop_config.json`)

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

### Codex

```sh
codex mcp add mcp -- npx -y @wdio/mcp
```

### Codex config.toml (`~/.codex/config.toml`)

```toml
[mcp_servers.mcp]
command = "npx"
args = ["-y", "@wdio/mcp"]
```

### Gemini CLI

```sh
gemini mcp add -s user mcp npx -- -y @wdio/mcp
```

### Gemini settings.json (`~/.gemini/settings.json`)

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

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `BROWSERSTACK_ACCESS_KEY` | no | no |  |
| `BROWSERSTACK_USERNAME` | no | no |  |
| `DIGITALAI_ACCESS_KEY` | no | no |  |
| `DIGITALAI_CLOUD_URL` | no | no |  |
| `SAUCE_ACCESS_KEY` | no | no |  |
| `SAUCE_USERNAME` | no | no |  |
| `TESTINGBOT_KEY` | no | no |  |
| `TESTINGBOT_SECRET` | no | no |  |
| `TESTMU_ACCESS_KEY` | no | no |  |
| `TESTMU_USERNAME` | no | no |  |

## Tools (42)

- `upload_app`
- `list_apps`
- `enable_tools`
- `start_session`
- `attach_session`
- `launch_chrome`
- `close_session`
- `emulate_device`
- `open_web_extension`
- `navigate`
- `snapshot`
- `get_elements`
- `get_accessibility_tree`
- `get_screenshot`
- `get_tabs`
- `scroll`
- `execute_script`
- `execute_electron_script`
- `trigger_electron_deeplink`
- `mock`
- `get_mock_calls`
- `manage_mock`
- `switch_tab`
- `switch_frame`
- `click_element`
- `set_value`
- `select_option`
- `press_key`
- `perform_actions`
- `get_cookies`
- `set_cookie`
- `delete_cookies`
- `tap_element`
- `swipe`
- `drag_and_drop`
- `get_contexts`
- `switch_context`
- `get_app_state`
- `rotate_device`
- `hide_keyboard`
- `set_geolocation`
- `query_docs`

## FAQ

### What platforms can I automate?

You can automate Chrome, Firefox, Edge, Safari, Electron, iOS, and Android.

### How do I enable HTTP transport for non-subprocess clients?

You can enable HTTP transport by running the command with the --http flag and specifying a port.

### Can I run tests on cloud providers?

Yes, the server supports BrowserStack, Sauce Labs, LambdaTest, TestingBot, and Digital.ai Testing.
