@wdio/mcp 2.5.3 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +270 -17
- package/lib/server.js +2032 -1579
- package/lib/server.js.map +1 -1
- package/package.json +17 -18
package/README.md
CHANGED
|
@@ -1,56 +1,198 @@
|
|
|
1
1
|
# WebDriverIO MCP Server
|
|
2
2
|
|
|
3
|
-
A Model Context Protocol (MCP) server that enables
|
|
3
|
+
A Model Context Protocol (MCP) server that enables AI assistants to interact with web browsers and mobile applications
|
|
4
4
|
using WebDriverIO. Automate Chrome, Firefox, Edge, and Safari browsers plus iOS and Android apps—all through a unified interface.
|
|
5
5
|
|
|
6
6
|
## Installation
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
[](https://glama.ai/mcp/servers/webdriverio/mcp)
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
Add the following configuration to your MCP client settings:
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
**Standard config** (works in most clients):
|
|
13
13
|
|
|
14
14
|
```json
|
|
15
15
|
{
|
|
16
16
|
"mcpServers": {
|
|
17
17
|
"wdio-mcp": {
|
|
18
18
|
"command": "npx",
|
|
19
|
-
"args": [
|
|
20
|
-
"-y",
|
|
21
|
-
"@wdio/mcp"
|
|
22
|
-
]
|
|
19
|
+
"args": ["-y", "@wdio/mcp@latest"]
|
|
23
20
|
}
|
|
24
21
|
}
|
|
25
22
|
}
|
|
26
23
|
```
|
|
27
24
|
|
|
28
|
-
|
|
25
|
+
[](https://insiders.vscode.dev/redirect?url=vscode%3Amcp%2Finstall%3F%257B%2522name%2522%253A%2522wdio-mcp%2522%252C%2522command%2522%253A%2522npx%2522%252C%2522args%2522%253A%255B%2522-y%2522%252C%2522%2540wdio%252Fmcp%2540latest%2522%255D%257D)
|
|
26
|
+
[](https://insiders.vscode.dev/redirect?url=vscode-insiders%3Amcp%2Finstall%3F%257B%2522name%2522%253A%2522wdio-mcp%2522%252C%2522command%2522%253A%2522npx%2522%252C%2522args%2522%253A%255B%2522-y%2522%252C%2522%2540wdio%252Fmcp%2540latest%2522%255D%257D)
|
|
27
|
+
[<img src="https://cursor.com/deeplink/mcp-install-dark.svg" alt="Install in Cursor">](https://cursor.com/en/install-mcp?name=WebDriverIO&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkB3ZGlvL21jcEBsYXRlc3QiXX0%3D)
|
|
28
|
+
|
|
29
|
+
<details>
|
|
30
|
+
<summary>Claude Desktop</summary>
|
|
31
|
+
|
|
32
|
+
Edit `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS), `%APPDATA%\Claude\claude_desktop_config.json` (Windows), or `~/.config/Claude/claude_desktop_config.json` (Linux):
|
|
33
|
+
|
|
34
|
+
```json
|
|
35
|
+
{
|
|
36
|
+
"mcpServers": {
|
|
37
|
+
"wdio-mcp": {
|
|
38
|
+
"command": "npx",
|
|
39
|
+
"args": ["-y", "@wdio/mcp@latest"]
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
</details>
|
|
45
|
+
|
|
46
|
+
<details>
|
|
47
|
+
<summary>Claude Code</summary>
|
|
29
48
|
|
|
30
49
|
```bash
|
|
31
|
-
|
|
50
|
+
claude mcp add wdio-mcp -- npx -y @wdio/mcp@latest
|
|
32
51
|
```
|
|
52
|
+
</details>
|
|
33
53
|
|
|
34
|
-
|
|
54
|
+
<details>
|
|
55
|
+
<summary>Cline</summary>
|
|
56
|
+
|
|
57
|
+
Add to your VS Code `settings.json` or `cline_mcp_settings.json` file:
|
|
35
58
|
|
|
36
59
|
```json
|
|
37
60
|
{
|
|
38
61
|
"mcpServers": {
|
|
39
62
|
"wdio-mcp": {
|
|
40
|
-
"
|
|
63
|
+
"type": "stdio",
|
|
64
|
+
"command": "npx",
|
|
65
|
+
"args": ["-y", "@wdio/mcp@latest"]
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
</details>
|
|
71
|
+
|
|
72
|
+
<details>
|
|
73
|
+
<summary>Cursor</summary>
|
|
74
|
+
|
|
75
|
+
Go to `Cursor Settings` → `MCP` → `Add new MCP Server`, or create `.cursor/mcp.json`:
|
|
76
|
+
|
|
77
|
+
```json
|
|
78
|
+
{
|
|
79
|
+
"mcpServers": {
|
|
80
|
+
"wdio-mcp": {
|
|
81
|
+
"command": "npx",
|
|
82
|
+
"args": ["-y", "@wdio/mcp@latest"]
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
</details>
|
|
88
|
+
|
|
89
|
+
<details>
|
|
90
|
+
<summary>Codex</summary>
|
|
91
|
+
|
|
92
|
+
Use the Codex CLI:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
codex mcp add wdio-mcp npx "@wdio/mcp@latest"
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Or edit `~/.codex/config.toml`:
|
|
99
|
+
|
|
100
|
+
```toml
|
|
101
|
+
[mcp_servers.wdio-mcp]
|
|
102
|
+
command = "npx"
|
|
103
|
+
args = ["@wdio/mcp@latest"]
|
|
104
|
+
```
|
|
105
|
+
</details>
|
|
106
|
+
|
|
107
|
+
<details>
|
|
108
|
+
<summary>Goose</summary>
|
|
109
|
+
|
|
110
|
+
Go to `Advanced settings` → `Extensions` → `Add custom extension`, or run:
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
goose configure
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Or edit `~/.config/goose/config.yaml`:
|
|
117
|
+
|
|
118
|
+
```yaml
|
|
119
|
+
extensions:
|
|
120
|
+
wdio-mcp:
|
|
121
|
+
name: WebDriverIO MCP
|
|
122
|
+
cmd: npx
|
|
123
|
+
args: [-y, "@wdio/mcp@latest"]
|
|
124
|
+
enabled: true
|
|
125
|
+
type: stdio
|
|
126
|
+
```
|
|
127
|
+
</details>
|
|
128
|
+
|
|
129
|
+
<details>
|
|
130
|
+
<summary>Windsurf</summary>
|
|
131
|
+
|
|
132
|
+
Edit `~/.codeium/windsurf/mcp_config.json`:
|
|
133
|
+
|
|
134
|
+
```json
|
|
135
|
+
{
|
|
136
|
+
"mcpServers": {
|
|
137
|
+
"wdio-mcp": {
|
|
138
|
+
"command": "npx",
|
|
139
|
+
"args": ["-y", "@wdio/mcp@latest"]
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
```
|
|
144
|
+
</details>
|
|
145
|
+
|
|
146
|
+
<details>
|
|
147
|
+
<summary>Zed</summary>
|
|
148
|
+
|
|
149
|
+
Edit Zed settings (`~/.config/zed/settings.json`):
|
|
150
|
+
|
|
151
|
+
```json
|
|
152
|
+
{
|
|
153
|
+
"context_servers": {
|
|
154
|
+
"wdio-mcp": {
|
|
155
|
+
"source": "custom",
|
|
156
|
+
"command": "npx",
|
|
157
|
+
"args": ["-y", "@wdio/mcp@latest"]
|
|
41
158
|
}
|
|
42
159
|
}
|
|
43
160
|
}
|
|
44
161
|
```
|
|
162
|
+
</details>
|
|
45
163
|
|
|
46
|
-
>
|
|
164
|
+
<details>
|
|
165
|
+
<summary>VS Code (Copilot)</summary>
|
|
47
166
|
|
|
48
|
-
|
|
167
|
+
```bash
|
|
168
|
+
code --add-mcp '{"name":"wdio-mcp","command":"npx","args":["-y","@wdio/mcp@latest"]}'
|
|
169
|
+
```
|
|
170
|
+
</details>
|
|
49
171
|
|
|
50
|
-
|
|
51
|
-
|
|
172
|
+
----
|
|
173
|
+
> ⚠️ **Restart Required**: After adding the configuration, fully restart your MCP client to apply the changes.
|
|
52
174
|
|
|
53
|
-
|
|
175
|
+
### Option 2: Global Installation
|
|
176
|
+
|
|
177
|
+
If you prefer to install globally:
|
|
178
|
+
|
|
179
|
+
```bash
|
|
180
|
+
npm install -g @wdio/mcp
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
Then use `wdio-mcp` as the command:
|
|
184
|
+
|
|
185
|
+
```json
|
|
186
|
+
{
|
|
187
|
+
"mcpServers": {
|
|
188
|
+
"wdio-mcp": {
|
|
189
|
+
"command": "wdio-mcp"
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
📖 **Need help?** Follow the [MCP install guide](https://modelcontextprotocol.io/quickstart/user).
|
|
54
196
|
|
|
55
197
|
### Prerequisites For Mobile App Automation
|
|
56
198
|
|
|
@@ -74,6 +216,117 @@ appium
|
|
|
74
216
|
# Server runs at http://127.0.0.1:4723 by default
|
|
75
217
|
```
|
|
76
218
|
|
|
219
|
+
## BrowserStack
|
|
220
|
+
|
|
221
|
+
Run browser and mobile app tests on [BrowserStack](https://www.browserstack.com/) real devices and browsers without any local setup.
|
|
222
|
+
|
|
223
|
+
### Prerequisites
|
|
224
|
+
|
|
225
|
+
Set your credentials as environment variables:
|
|
226
|
+
|
|
227
|
+
```bash
|
|
228
|
+
export BROWSERSTACK_USERNAME=your_username
|
|
229
|
+
export BROWSERSTACK_ACCESS_KEY=your_access_key
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
Or add them to your MCP client config:
|
|
233
|
+
|
|
234
|
+
```json
|
|
235
|
+
{
|
|
236
|
+
"mcpServers": {
|
|
237
|
+
"wdio-mcp": {
|
|
238
|
+
"command": "npx",
|
|
239
|
+
"args": ["-y", "@wdio/mcp@latest"],
|
|
240
|
+
"env": {
|
|
241
|
+
"BROWSERSTACK_USERNAME": "your_username",
|
|
242
|
+
"BROWSERSTACK_ACCESS_KEY": "your_access_key"
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
### Browser Sessions
|
|
250
|
+
|
|
251
|
+
Run a browser on a specific OS/version combination:
|
|
252
|
+
|
|
253
|
+
```javascript
|
|
254
|
+
start_session({
|
|
255
|
+
provider: 'browserstack',
|
|
256
|
+
platform: 'browser',
|
|
257
|
+
browser: 'chrome', // chrome | firefox | edge | safari
|
|
258
|
+
browserVersion: 'latest', // default: latest
|
|
259
|
+
os: 'Windows', // e.g. "Windows", "OS X"
|
|
260
|
+
osVersion: '11', // e.g. "11", "Sequoia"
|
|
261
|
+
reporting: {
|
|
262
|
+
project: 'My Project',
|
|
263
|
+
build: 'v1.2.0',
|
|
264
|
+
session: 'Login flow'
|
|
265
|
+
}
|
|
266
|
+
})
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
### Mobile App Sessions
|
|
270
|
+
|
|
271
|
+
Test on BrowserStack real devices. First upload your app (or use an existing `bs://` URL):
|
|
272
|
+
|
|
273
|
+
```javascript
|
|
274
|
+
// Upload a local .apk or .ipa (returns a bs:// URL)
|
|
275
|
+
upload_app({ path: '/path/to/app.apk' })
|
|
276
|
+
|
|
277
|
+
// Start a session with the returned URL
|
|
278
|
+
start_session({
|
|
279
|
+
provider: 'browserstack',
|
|
280
|
+
platform: 'android', // android | ios
|
|
281
|
+
app: 'bs://abc123...', // bs:// URL or custom_id from upload
|
|
282
|
+
deviceName: 'Samsung Galaxy S23',
|
|
283
|
+
platformVersion: '13.0',
|
|
284
|
+
reporting: {
|
|
285
|
+
project: 'My Project',
|
|
286
|
+
build: 'v1.2.0',
|
|
287
|
+
session: 'Checkout flow'
|
|
288
|
+
}
|
|
289
|
+
})
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
Use `list_apps` to see previously uploaded apps:
|
|
293
|
+
|
|
294
|
+
```javascript
|
|
295
|
+
list_apps() // own uploads, sorted by date
|
|
296
|
+
list_apps({ sortBy: 'app_name' })
|
|
297
|
+
list_apps({ organizationWide: true }) // all uploads in your org
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
### BrowserStack Local
|
|
301
|
+
|
|
302
|
+
To test against URLs that are only accessible on your local machine or internal network, enable the BrowserStack Local tunnel:
|
|
303
|
+
|
|
304
|
+
```javascript
|
|
305
|
+
start_session({
|
|
306
|
+
provider: 'browserstack',
|
|
307
|
+
platform: 'browser',
|
|
308
|
+
browser: 'chrome',
|
|
309
|
+
browserstackLocal: true // starts tunnel automatically
|
|
310
|
+
})
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
### Reporting Labels
|
|
314
|
+
|
|
315
|
+
All session types support `reporting` labels that appear in the BrowserStack Automate dashboard:
|
|
316
|
+
|
|
317
|
+
| Field | Description |
|
|
318
|
+
|---------------------------|--------------------------------------------|
|
|
319
|
+
| `reporting.project` | Group sessions under a project name |
|
|
320
|
+
| `reporting.build` | Tag sessions with a build/version label |
|
|
321
|
+
| `reporting.session` | Name for the individual test session |
|
|
322
|
+
|
|
323
|
+
### BrowserStack Tools
|
|
324
|
+
|
|
325
|
+
| Tool | Description |
|
|
326
|
+
|---------------|----------------------------------------------------------------------------------|
|
|
327
|
+
| `upload_app` | Upload a local `.apk` or `.ipa` to BrowserStack; returns a `bs://` URL |
|
|
328
|
+
| `list_apps` | List apps previously uploaded to your BrowserStack account |
|
|
329
|
+
|
|
77
330
|
## Features
|
|
78
331
|
|
|
79
332
|
### Browser Automation
|