@shiplightai/mcp 0.1.4 → 0.1.6
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.
Potentially problematic release.
This version of @shiplightai/mcp might be problematic. Click here for more details.
- package/README.md +64 -337
- package/dist/index.d.ts +1 -95
- package/dist/index.js +500 -597
- package/dist/index.js.map +1 -0
- package/package.json +4 -8
package/README.md
CHANGED
|
@@ -1,400 +1,127 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @shiplightai/mcp
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
MCP server for browser UI exploration. Provides tools to launch browser sessions, navigate pages, inspect the DOM, perform actions, and collect locators — designed for coding agents that explore UI then write Playwright tests with [`@shiplightai/sdk`](https://www.npmjs.com/package/@shiplightai/sdk).
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
## Why Shiplight
|
|
8
|
-
|
|
9
|
-
Other browser MCP servers (like [Playwright MCP](https://github.com/microsoft/playwright-mcp)) give your coding agent basic browser control. Shiplight goes further:
|
|
10
|
-
|
|
11
|
-
| Capability | Playwright MCP | Shiplight |
|
|
12
|
-
|------------|---------------|-----------|
|
|
13
|
-
| Browser automation (click, type, scroll) | Yes | Yes |
|
|
14
|
-
| AI-powered assertions (`verify`) | No | Yes * |
|
|
15
|
-
| AI data extraction (`ai_extract`) | No | Yes * |
|
|
16
|
-
| Natural language test flows (YAML DSL) | No | Yes |
|
|
17
|
-
| Conditional logic (`IF`/`ELSE`) | No | Yes * |
|
|
18
|
-
| Loops (`WHILE`) | No | Yes * |
|
|
19
|
-
| Cloud test execution & results | No | Yes |
|
|
20
|
-
| Test case management (CRUD, folders) | No | Yes |
|
|
21
|
-
| Enrichment workflow (DRAFT to ACTION) | No | Yes |
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
\* Uses the web agent (secondary LLM)
|
|
25
|
-
|
|
26
|
-
Shiplight also uses **set-of-mark** technology for better identifying interactive elements and handles **cross-frame elements transparently** — no manual iframe switching needed.
|
|
27
|
-
|
|
28
|
-
Shiplight is not just a browser driver — it's a complete test automation platform accessible through MCP.
|
|
29
|
-
|
|
30
|
-
## Quick Start
|
|
31
|
-
|
|
32
|
-
### Install
|
|
5
|
+
## Installation
|
|
33
6
|
|
|
34
7
|
```bash
|
|
35
8
|
npm install -g @shiplightai/mcp
|
|
36
9
|
```
|
|
37
10
|
|
|
38
|
-
|
|
11
|
+
## Usage
|
|
39
12
|
|
|
40
|
-
|
|
41
|
-
claude mcp add shiplight -- shiplight-mcp \
|
|
42
|
-
-e GOOGLE_API_KEY=your-google-api-key \
|
|
43
|
-
-e WEB_AGENT_MODEL=gemini-2.5-pro \
|
|
44
|
-
-e PWDEBUG=console
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
### Claude Desktop
|
|
13
|
+
### Claude Code
|
|
48
14
|
|
|
49
|
-
Add to
|
|
15
|
+
Add to your Claude Code MCP config (`~/.claude/settings.json`):
|
|
50
16
|
|
|
51
17
|
```json
|
|
52
18
|
{
|
|
53
19
|
"mcpServers": {
|
|
54
20
|
"shiplight": {
|
|
55
|
-
"command": "shiplight-mcp"
|
|
56
|
-
"env": {
|
|
57
|
-
"GOOGLE_API_KEY": "your-google-api-key",
|
|
58
|
-
"WEB_AGENT_MODEL": "gemini-2.5-pro",
|
|
59
|
-
"PWDEBUG": "console"
|
|
60
|
-
}
|
|
21
|
+
"command": "shiplight-mcp"
|
|
61
22
|
}
|
|
62
23
|
}
|
|
63
24
|
}
|
|
64
25
|
```
|
|
65
26
|
|
|
66
|
-
###
|
|
27
|
+
### Claude Desktop
|
|
67
28
|
|
|
68
|
-
Add to
|
|
29
|
+
Add to your Claude Desktop config:
|
|
69
30
|
|
|
70
31
|
```json
|
|
71
32
|
{
|
|
72
33
|
"mcpServers": {
|
|
73
34
|
"shiplight": {
|
|
74
|
-
"command": "
|
|
75
|
-
"
|
|
76
|
-
"GOOGLE_API_KEY": "your-google-api-key",
|
|
77
|
-
"WEB_AGENT_MODEL": "gemini-2.5-pro",
|
|
78
|
-
"PWDEBUG": "console"
|
|
79
|
-
}
|
|
35
|
+
"command": "npx",
|
|
36
|
+
"args": ["-y", "@shiplightai/mcp"]
|
|
80
37
|
}
|
|
81
38
|
}
|
|
82
39
|
}
|
|
83
40
|
```
|
|
84
41
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
- **AI-powered actions**: `verify`, `ai_extract`, `ai_wait_until`
|
|
88
|
-
- **Natural language test steps**: DRAFT statements and VERIFY assertions in test flows
|
|
89
|
-
- **Conditional evaluation**: IF/ELSE and WHILE conditions written in natural language
|
|
90
|
-
|
|
91
|
-
Browser actions like `click`, `input_text`, `scroll` etc. do **not** require the web agent — they execute deterministically.
|
|
92
|
-
|
|
93
|
-
You can use either a Google or Anthropic API key. Set `WEB_AGENT_MODEL` to match your provider:
|
|
42
|
+
### Cursor / Windsurf
|
|
94
43
|
|
|
95
|
-
|
|
96
|
-
|----------|---------|-----------------|
|
|
97
|
-
| Google | `GOOGLE_API_KEY` | `gemini-2.5-pro`, `gemini-3-pro-preview` |
|
|
98
|
-
| Anthropic | `ANTHROPIC_API_KEY` | `claude-haiku-4-5`, `claude-sonnet-4-5`, `claude-opus-4-5` |
|
|
99
|
-
|
|
100
|
-
To unlock cloud test management, add your Shiplight API token:
|
|
44
|
+
Add to your MCP config (`.cursor/mcp.json` or equivalent):
|
|
101
45
|
|
|
102
46
|
```json
|
|
103
47
|
{
|
|
104
|
-
"
|
|
105
|
-
"
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
48
|
+
"mcpServers": {
|
|
49
|
+
"shiplight": {
|
|
50
|
+
"command": "npx",
|
|
51
|
+
"args": ["-y", "@shiplightai/mcp"]
|
|
52
|
+
}
|
|
109
53
|
}
|
|
110
54
|
}
|
|
111
55
|
```
|
|
112
56
|
|
|
113
|
-
##
|
|
114
|
-
|
|
115
|
-
No Shiplight account needed. Launch a browser, interact with any web app, and verify UI state — all driven by your AI coding agent.
|
|
116
|
-
|
|
117
|
-
**Your coding agent can verify UI features by:**
|
|
118
|
-
|
|
119
|
-
- Opening a browser and navigating to your app
|
|
120
|
-
- Inspecting page state via screenshots and DOM structure
|
|
121
|
-
- Interacting with elements: click, type, select, scroll, upload files
|
|
122
|
-
- Asserting UI state with natural language (e.g., "the login form should be visible")
|
|
123
|
-
- Capturing console errors and network requests
|
|
57
|
+
## Tools
|
|
124
58
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
```
|
|
128
|
-
Add a "Forgot Password?" link below the login form. After implementing,
|
|
129
|
-
Use Shiplight to verify your implementation in the browser.
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
### Free Tools
|
|
59
|
+
### Session Management (5)
|
|
133
60
|
|
|
134
61
|
| Tool | Description |
|
|
135
62
|
|------|-------------|
|
|
136
|
-
| `new_session` |
|
|
63
|
+
| `new_session` | Launch a browser session with optional device emulation |
|
|
64
|
+
| `save_storage_state` | Save cookies/localStorage for session reuse |
|
|
137
65
|
| `close_session` | Close a browser session |
|
|
138
66
|
| `close_all` | Close all browser sessions |
|
|
139
|
-
| `get_session_state` | Get current URL and session
|
|
140
|
-
| `save_storage_state` | Save cookies/localStorage for fast session restore |
|
|
141
|
-
| `navigate` | Navigate to a URL |
|
|
142
|
-
| `get_page_info` | Get current page URL and title |
|
|
143
|
-
| `inspect_page` | Screenshot + DOM with interactive element indices |
|
|
144
|
-
| `act` | Perform browser actions (click, type, scroll, verify, etc.) |
|
|
145
|
-
| `get_locator` | Extract Playwright locator/xpath for an element |
|
|
146
|
-
| `update_variables` | Set session variables for use in actions |
|
|
147
|
-
| `clear_execution_history` | Reset session action history |
|
|
148
|
-
| `get_browser_console_logs` | Get browser console output with filtering |
|
|
149
|
-
| `get_browser_network_logs` | Get network requests with status filtering |
|
|
150
|
-
| `clear_logs` | Clear console and network logs |
|
|
151
|
-
| `get_artifact` | Retrieve a saved screenshot or DOM snapshot |
|
|
152
|
-
|
|
153
|
-
### Browser Actions
|
|
154
|
-
|
|
155
|
-
The `act` tool supports the following actions for interacting with the page:
|
|
156
|
-
|
|
157
|
-
| Action | Description |
|
|
158
|
-
|--------|-------------|
|
|
159
|
-
| `click` | Click an element |
|
|
160
|
-
| `double_click` | Double-click an element |
|
|
161
|
-
| `right_click` | Right-click an element |
|
|
162
|
-
| `hover` | Hover over an element |
|
|
163
|
-
| `input_text` | Type text into an input field |
|
|
164
|
-
| `clear_input` | Clear an input field |
|
|
165
|
-
| `press` | Press a key or key combination (e.g., `Enter`, `Control+A`) |
|
|
166
|
-
| `send_keys_on_element` | Send keys to a specific element |
|
|
167
|
-
| `select_dropdown_option` | Select from a dropdown by value or label |
|
|
168
|
-
| `get_dropdown_options` | List all options in a dropdown |
|
|
169
|
-
| `set_date_for_native_date_picker` | Set date on a native date picker input |
|
|
170
|
-
| `scroll` | Scroll up or down by number of pages |
|
|
171
|
-
| `scroll_to_text` | Scroll until specific text is visible |
|
|
172
|
-
| `scroll_on_element` | Scroll within a specific scrollable element |
|
|
173
|
-
| `go_to_url` | Navigate to a URL |
|
|
174
|
-
| `go_back` | Go back in browser history |
|
|
175
|
-
| `reload_page` | Reload the current page |
|
|
176
|
-
| `switch_tab` | Switch to a different browser tab |
|
|
177
|
-
| `close_tab` | Close a browser tab |
|
|
178
|
-
| `upload_file` | Upload a file via file input |
|
|
179
|
-
|
|
180
|
-
### Utility Actions
|
|
181
|
-
|
|
182
|
-
| Action | Description |
|
|
183
|
-
|--------|-------------|
|
|
184
|
-
| `wait` | Wait for a specified duration |
|
|
185
|
-
| `wait_for_page_ready` | Wait until the page finishes loading |
|
|
186
|
-
| `wait_for_download_complete` | Wait for a file download to complete |
|
|
187
|
-
| `save_variable` | Save a value to a session variable |
|
|
188
|
-
| `generate_2fa_code` | Generate a TOTP 2FA code from a secret key |
|
|
189
|
-
|
|
190
|
-
### AI-Powered Actions *
|
|
191
|
-
|
|
192
|
-
These actions use the AI model specified by `WEB_AGENT_MODEL` to reason about the page:
|
|
193
|
-
|
|
194
|
-
| Action | Description |
|
|
195
|
-
|--------|-------------|
|
|
196
|
-
| `verify` * | Assert page state with a natural language statement |
|
|
197
|
-
| `ai_extract` * | Extract data from the page into a variable |
|
|
198
|
-
| `ai_wait_until` * | Wait until an AI-evaluated condition is true |
|
|
199
|
-
|
|
200
|
-
## Writing Tests in Natural Language
|
|
201
|
-
|
|
202
|
-
Shiplight tests are written in YAML using natural language. Start with plain English, then optionally enrich with locators for speed.
|
|
203
|
-
|
|
204
|
-
**No lock-in**: Test flows are exported as pure Playwright + [Shiplight Agent SDK](https://github.com/ShiplightAI/sdk-examples) code for execution. The YAML DSL is an authoring format — what actually runs is standard Playwright with an AI agent layer on top. You can eject at any time.
|
|
205
|
-
|
|
206
|
-
### Basic Test (all natural language)
|
|
207
|
-
|
|
208
|
-
```yaml
|
|
209
|
-
goal: Verify user can create a new project
|
|
210
|
-
url: https://app.example.com/projects
|
|
211
|
-
statements:
|
|
212
|
-
- Click the "New Project" button
|
|
213
|
-
- Enter "My Test Project" in the project name field
|
|
214
|
-
- Select "Public" from the visibility dropdown
|
|
215
|
-
- Click "Create"
|
|
216
|
-
- "VERIFY: Project page shows title 'My Test Project'"
|
|
217
|
-
teardown:
|
|
218
|
-
- Delete the created project
|
|
219
|
-
```
|
|
220
|
-
|
|
221
|
-
Every line is a plain English instruction. The AI resolves each one at runtime by looking at the page and performing the right action.
|
|
222
|
-
|
|
223
|
-
### Enriched Test (with locator)
|
|
224
|
-
|
|
225
|
-
After exploring the UI with the free browser tools, you can add locators for deterministic, fast replay:
|
|
226
|
-
|
|
227
|
-
```yaml
|
|
228
|
-
goal: Verify user can create a new project
|
|
229
|
-
url: https://app.example.com/projects
|
|
230
|
-
statements:
|
|
231
|
-
- STEP: Create project
|
|
232
|
-
statements:
|
|
233
|
-
- description: Click the New Project button
|
|
234
|
-
action_entity:
|
|
235
|
-
action_data:
|
|
236
|
-
action_name: click
|
|
237
|
-
locator: "getByRole('button', { name: 'New Project' })"
|
|
238
|
-
- description: Enter project name
|
|
239
|
-
action_entity:
|
|
240
|
-
action_data:
|
|
241
|
-
action_name: input_text
|
|
242
|
-
kwargs:
|
|
243
|
-
text: "My Test Project"
|
|
244
|
-
locator: "getByRole('textbox', { name: 'Project name' })"
|
|
245
|
-
- description: Click Create
|
|
246
|
-
action_entity:
|
|
247
|
-
action_data:
|
|
248
|
-
action_name: click
|
|
249
|
-
locator: "getByRole('button', { name: 'Create' })"
|
|
250
|
-
- "VERIFY: Project page shows title 'My Test Project'"
|
|
251
|
-
teardown:
|
|
252
|
-
- Delete the created project
|
|
253
|
-
```
|
|
254
|
-
|
|
255
|
-
**Natural language statements** (~10-15s each): AI reads the page and figures out what to do.
|
|
256
|
-
**Action statements with locator** (~1s each): Replay deterministically without AI.
|
|
257
|
-
**VERIFY statements**: Always use AI — just provide a clear assertion in plain English.
|
|
258
|
-
|
|
259
|
-
**Locators are a cache, not a hard dependency.** When the UI changes and a locator becomes stale, Shiplight's agentic layer [auto-heals](https://docs.shiplight.ai/sdk/self-healing.html) by falling back to the natural language description. When running on the Shiplight cloud, the platform automatically updates the cached locator after a successful self-heal — so future runs replay at full speed without manual maintenance.
|
|
260
|
-
|
|
261
|
-
### Statement Types
|
|
262
|
-
|
|
263
|
-
| Type | Syntax | Description |
|
|
264
|
-
|------|--------|-------------|
|
|
265
|
-
| Natural language * | `- Click the login button` | AI resolves at runtime |
|
|
266
|
-
| Action with locator | `- description: ...` + `action_entity: ...` | Deterministic replay |
|
|
267
|
-
| Verify * | `- "VERIFY: page shows welcome message"` | AI-powered assertion |
|
|
268
|
-
| Step group | `- STEP: Login` + `statements: [...]` | Group related actions |
|
|
269
|
-
| Conditional * | `- IF: cookie banner is visible` + `THEN: [...]` | Conditional execution |
|
|
270
|
-
| Loop * | `- WHILE: more items to load` + `DO: [...]` | Repeat until condition |
|
|
271
|
-
|
|
272
|
-
### Conditional Logic & Loops
|
|
273
|
-
|
|
274
|
-
Shiplight tests support branching and looping — handle real-world UI variability without separate test cases.
|
|
275
|
-
|
|
276
|
-
**IF / ELSE** — handle optional UI elements:
|
|
277
|
-
|
|
278
|
-
```yaml
|
|
279
|
-
statements:
|
|
280
|
-
- IF: cookie consent dialog is visible
|
|
281
|
-
THEN:
|
|
282
|
-
- Click "Accept All"
|
|
283
|
-
- IF: user is logged in
|
|
284
|
-
THEN:
|
|
285
|
-
- Click the logout button
|
|
286
|
-
ELSE:
|
|
287
|
-
- Click the login button
|
|
288
|
-
- Enter credentials and submit
|
|
289
|
-
```
|
|
290
|
-
|
|
291
|
-
**WHILE** — repeat until a condition is met:
|
|
292
|
-
|
|
293
|
-
```yaml
|
|
294
|
-
statements:
|
|
295
|
-
- WHILE: "Load More" button is visible
|
|
296
|
-
DO:
|
|
297
|
-
- Click the "Load More" button
|
|
298
|
-
- Wait for new items to appear
|
|
299
|
-
- "VERIFY: all items are loaded"
|
|
300
|
-
```
|
|
67
|
+
| `get_session_state` | Get current URL and session type |
|
|
301
68
|
|
|
302
|
-
|
|
69
|
+
### Browser Interaction (7)
|
|
303
70
|
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
71
|
+
| Tool | Description |
|
|
72
|
+
|------|-------------|
|
|
73
|
+
| `navigate` | Navigate to a URL |
|
|
74
|
+
| `get_page_info` | Get page URL and title (lightweight) |
|
|
75
|
+
| `inspect_page` | Screenshot + DOM with element indices |
|
|
76
|
+
| `act` | Perform browser actions using element indices |
|
|
77
|
+
| `get_locator` | Extract Playwright locator for an element |
|
|
78
|
+
| `update_variables` | Set session variables for browser tasks |
|
|
79
|
+
| `clear_execution_history` | Clear action history for a session |
|
|
309
80
|
|
|
310
|
-
###
|
|
81
|
+
### Debug (4)
|
|
311
82
|
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
83
|
+
| Tool | Description |
|
|
84
|
+
|------|-------------|
|
|
85
|
+
| `get_browser_console_logs` | Get console logs (errors, warnings) |
|
|
86
|
+
| `get_browser_network_logs` | Get network request logs |
|
|
87
|
+
| `clear_logs` | Clear console and network logs |
|
|
88
|
+
| `get_artifact` | Retrieve screenshots or DOM snapshots |
|
|
317
89
|
|
|
318
|
-
|
|
90
|
+
## Resources
|
|
319
91
|
|
|
320
|
-
|
|
92
|
+
The server exposes two resources for coding agents:
|
|
321
93
|
|
|
322
|
-
|
|
94
|
+
- **`shiplight://schemas/action-entity`** — Parameter docs for all browser actions
|
|
95
|
+
- **`shiplight://docs/agent-sdk`** — API documentation for `@shiplightai/sdk`, including a workflow guide for turning UI exploration into test code
|
|
323
96
|
|
|
324
|
-
|
|
97
|
+
## Workflow
|
|
325
98
|
|
|
326
|
-
**
|
|
99
|
+
1. **Explore** — Use `inspect_page` + `act` to navigate the app
|
|
100
|
+
2. **Collect locators** — Use `get_locator` on elements you want to test
|
|
101
|
+
3. **Write tests** — Use the locators in Playwright tests, with `@shiplightai/sdk` for AI-powered assertions and self-healing
|
|
327
102
|
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
- Manage test infrastructure: environments, test accounts, folders
|
|
103
|
+
```typescript
|
|
104
|
+
import { test, expect } from '@playwright/test';
|
|
105
|
+
import { createAgent, configureSdk } from '@shiplightai/sdk';
|
|
332
106
|
|
|
333
|
-
|
|
107
|
+
configureSdk({ env: { GOOGLE_API_KEY: process.env.GOOGLE_API_KEY! } });
|
|
334
108
|
|
|
335
|
-
|
|
336
|
-
|
|
109
|
+
test('checkout flow', async ({ page }) => {
|
|
110
|
+
const agent = createAgent({ model: 'gemini-2.5-pro' });
|
|
337
111
|
|
|
338
|
-
|
|
339
|
-
|
|
112
|
+
await page.goto('https://myshop.example.com');
|
|
113
|
+
await page.getByRole('button', { name: 'Add to Cart' }).click();
|
|
114
|
+
await agent.assert(page, 'Item was added to cart');
|
|
115
|
+
await agent.run(page, 'Complete checkout with test data');
|
|
116
|
+
});
|
|
340
117
|
```
|
|
341
118
|
|
|
342
|
-
|
|
119
|
+
## Environment Variables
|
|
343
120
|
|
|
344
|
-
|
|
|
345
|
-
|
|
346
|
-
| `
|
|
347
|
-
| `
|
|
348
|
-
| `get_test_case` | Get test case details (supports YAML output) |
|
|
349
|
-
| `run_test_case` | Trigger a cloud test run |
|
|
350
|
-
| `list_test_runs` | List test runs with filtering |
|
|
351
|
-
| `get_test_run_details` | Get run status and test case results |
|
|
352
|
-
| `get_test_case_result` | Get detailed result with runner logs (stdout/stderr) |
|
|
353
|
-
| `get_test_case_result_steps` | Get step-by-step execution details |
|
|
354
|
-
| `get_step_artifacts` | Download screenshots and artifacts for a step |
|
|
355
|
-
| `list_environments` | List testing environments |
|
|
356
|
-
| `list_test_accounts` | List test accounts for an environment |
|
|
357
|
-
| `get_test_account` | Get test account details |
|
|
358
|
-
| `create_test_account` | Create a test account with login config |
|
|
359
|
-
| `list_folders` | List test case folders |
|
|
360
|
-
| `create_folder` | Create a folder for organizing test cases |
|
|
361
|
-
| `get_folder` | Get folder details with full path |
|
|
362
|
-
|
|
363
|
-
## Workflow Examples
|
|
364
|
-
|
|
365
|
-
Shiplight MCP fits naturally into AI-driven development. Your coding agent can verify UI changes in a live browser as you code, and automatically create enriched test cases from the session — no context switching needed. See the [workflow guide](https://docs.shiplight.ai/mcp/workflows) for detailed examples, including how to set up a Claude Code custom agent for fully autonomous test creation.
|
|
366
|
-
|
|
367
|
-
## Coming Soon
|
|
368
|
-
|
|
369
|
-
- **Coordinate-based actions** — `click_by_coordinates`, `drag_drop` for pixel-precise interactions (canvas, maps, visual editors)
|
|
370
|
-
|
|
371
|
-
## Configuration
|
|
372
|
-
|
|
373
|
-
| Variable | Required | Description | Default |
|
|
374
|
-
|----------|----------|-------------|---------|
|
|
375
|
-
| `GOOGLE_API_KEY` | One of these | Google AI API key | — |
|
|
376
|
-
| `ANTHROPIC_API_KEY` | required | Anthropic API key | — |
|
|
377
|
-
| `WEB_AGENT_MODEL` | Yes | AI model for browser automation | — |
|
|
378
|
-
| `PWDEBUG` | No | Set to `console` to enable Playwright debug logging | — |
|
|
379
|
-
| `API_TOKEN` | For cloud features | Shiplight API token | — |
|
|
380
|
-
| `API_BASE_URL` | No | Shiplight API URL | `https://api.shiplight.ai` |
|
|
381
|
-
|
|
382
|
-
## Resources & Prompts
|
|
383
|
-
|
|
384
|
-
The server exposes MCP resources with schema documentation:
|
|
385
|
-
|
|
386
|
-
| Resource | Description |
|
|
387
|
-
|----------|-------------|
|
|
388
|
-
| `shiplight://schemas/testflow-v1.2.0` | TestFlow YAML/JSON format, statement types, examples |
|
|
389
|
-
| `shiplight://schemas/action-entity` | Browser action parameters for the `act` tool |
|
|
390
|
-
|
|
391
|
-
## Getting an API Token
|
|
392
|
-
|
|
393
|
-
To unlock cloud test management:
|
|
394
|
-
|
|
395
|
-
1. Visit [shiplight.ai](https://shiplight.ai) to create an account
|
|
396
|
-
2. Generate an API token from your account settings
|
|
397
|
-
3. Set `API_TOKEN` in your MCP server configuration
|
|
121
|
+
| Variable | Default | Description |
|
|
122
|
+
|----------|---------|-------------|
|
|
123
|
+
| `WEB_AGENT_MODEL` | `gemini-2.5-pro` | AI model for browser agent |
|
|
124
|
+
| `TERMINATION_TIMEOUT` | (none) | Session auto-close timeout in ms |
|
|
398
125
|
|
|
399
126
|
## License
|
|
400
127
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,96 +1,2 @@
|
|
|
1
|
-
import { AxiosError, AxiosRequestConfig, AxiosResponse } from 'axios';
|
|
2
1
|
|
|
3
|
-
|
|
4
|
-
* MCP Server Logger
|
|
5
|
-
*
|
|
6
|
-
* For STDIO-based MCP servers, we must NEVER write to stdout.
|
|
7
|
-
* All logging output goes to stderr to avoid corrupting JSON-RPC messages.
|
|
8
|
-
*/
|
|
9
|
-
declare class MCPLogger {
|
|
10
|
-
private static _instance;
|
|
11
|
-
private _logLevel;
|
|
12
|
-
private constructor();
|
|
13
|
-
static getInstance(): MCPLogger;
|
|
14
|
-
setLevel(level: number): void;
|
|
15
|
-
/**
|
|
16
|
-
* Log debug messages (only shown when LOG_LEVEL=DEBUG)
|
|
17
|
-
*/
|
|
18
|
-
debug(...args: unknown[]): void;
|
|
19
|
-
/**
|
|
20
|
-
* Log informational messages
|
|
21
|
-
*/
|
|
22
|
-
info(...args: unknown[]): void;
|
|
23
|
-
/**
|
|
24
|
-
* Log warning messages
|
|
25
|
-
*/
|
|
26
|
-
warn(...args: unknown[]): void;
|
|
27
|
-
/**
|
|
28
|
-
* Log error messages (always shown)
|
|
29
|
-
*/
|
|
30
|
-
error(...args: unknown[]): void;
|
|
31
|
-
/**
|
|
32
|
-
* Alias for info (for compatibility)
|
|
33
|
-
*/
|
|
34
|
-
log(...args: unknown[]): void;
|
|
35
|
-
}
|
|
36
|
-
declare const logger: MCPLogger;
|
|
37
|
-
|
|
38
|
-
declare const LogLevel: {
|
|
39
|
-
ERROR: number;
|
|
40
|
-
WARN: number;
|
|
41
|
-
INFO: number;
|
|
42
|
-
DEBUG: number;
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Axios Retry Utility
|
|
47
|
-
*
|
|
48
|
-
* Provides retry logic for axios requests with exponential backoff
|
|
49
|
-
*/
|
|
50
|
-
|
|
51
|
-
interface RetryConfig {
|
|
52
|
-
maxRetries?: number;
|
|
53
|
-
initialDelayMs?: number;
|
|
54
|
-
maxDelayMs?: number;
|
|
55
|
-
backoffMultiplier?: number;
|
|
56
|
-
retryableStatuses?: number[];
|
|
57
|
-
onRetry?: (attempt: number, error: AxiosError) => void;
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Retry an axios request with exponential backoff
|
|
61
|
-
*/
|
|
62
|
-
declare function retryAxios<T = unknown>(requestFn: () => Promise<AxiosResponse<T>>, config?: RetryConfig): Promise<AxiosResponse<T>>;
|
|
63
|
-
/**
|
|
64
|
-
* Create a retry wrapper for axios instance
|
|
65
|
-
*/
|
|
66
|
-
declare function createRetryAxios(retryConfig?: RetryConfig): {
|
|
67
|
-
get: <T = unknown>(url: string, config?: AxiosRequestConfig) => Promise<AxiosResponse<T, any, {}>>;
|
|
68
|
-
post: <T = unknown>(url: string, data?: unknown, config?: AxiosRequestConfig) => Promise<AxiosResponse<T, any, {}>>;
|
|
69
|
-
put: <T = unknown>(url: string, data?: unknown, config?: AxiosRequestConfig) => Promise<AxiosResponse<T, any, {}>>;
|
|
70
|
-
delete: <T = unknown>(url: string, config?: AxiosRequestConfig) => Promise<AxiosResponse<T, any, {}>>;
|
|
71
|
-
patch: <T = unknown>(url: string, data?: unknown, config?: AxiosRequestConfig) => Promise<AxiosResponse<T, any, {}>>;
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* Shiplight MCP Server
|
|
76
|
-
*
|
|
77
|
-
* MCP server implementation for Shiplight AI test automation platform.
|
|
78
|
-
* Uses shared tools from mcp-tools with default backends.
|
|
79
|
-
*/
|
|
80
|
-
declare class ShiplightMCPServer {
|
|
81
|
-
private server;
|
|
82
|
-
private registry;
|
|
83
|
-
private sessionBackend;
|
|
84
|
-
private apiClient;
|
|
85
|
-
private sessionTools;
|
|
86
|
-
private browserTools;
|
|
87
|
-
private debugTools;
|
|
88
|
-
private testCaseTools;
|
|
89
|
-
private testResultTools;
|
|
90
|
-
private dataTools;
|
|
91
|
-
constructor();
|
|
92
|
-
private setupHandlers;
|
|
93
|
-
run(): Promise<void>;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
export { LogLevel, type RetryConfig, ShiplightMCPServer, createRetryAxios, logger, retryAxios };
|
|
2
|
+
export { }
|