playwright-stealth-mcp-server 0.0.1 → 0.0.2
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
CHANGED
|
@@ -62,11 +62,12 @@ Add to your Claude Desktop config file:
|
|
|
62
62
|
|
|
63
63
|
### Environment Variables
|
|
64
64
|
|
|
65
|
-
| Variable
|
|
66
|
-
|
|
|
67
|
-
| `STEALTH_MODE`
|
|
68
|
-
| `HEADLESS`
|
|
69
|
-
| `TIMEOUT`
|
|
65
|
+
| Variable | Description | Default |
|
|
66
|
+
| -------------------- | -------------------------------------------------------------------------- | ------- |
|
|
67
|
+
| `STEALTH_MODE` | Enable stealth mode with anti-detection measures | `false` |
|
|
68
|
+
| `HEADLESS` | Run browser in headless mode | `true` |
|
|
69
|
+
| `TIMEOUT` | Default timeout for Playwright actions (click, fill, etc.) in milliseconds | `30000` |
|
|
70
|
+
| `NAVIGATION_TIMEOUT` | Default timeout for page navigation (goto, reload, etc.) in milliseconds | `60000` |
|
|
70
71
|
|
|
71
72
|
## Available Tools
|
|
72
73
|
|
package/package.json
CHANGED
package/shared/server.js
CHANGED
|
@@ -44,6 +44,9 @@ export class PlaywrightClient {
|
|
|
44
44
|
: undefined,
|
|
45
45
|
});
|
|
46
46
|
this.page = await this.context.newPage();
|
|
47
|
+
// Apply timeout configuration to Playwright
|
|
48
|
+
this.page.setDefaultTimeout(this.config.timeout);
|
|
49
|
+
this.page.setDefaultNavigationTimeout(this.config.navigationTimeout);
|
|
47
50
|
// Capture console messages
|
|
48
51
|
this.page.on('console', (msg) => {
|
|
49
52
|
this.consoleMessages.push(`[${msg.type()}] ${msg.text()}`);
|
|
@@ -139,10 +142,12 @@ export function createMCPServer() {
|
|
|
139
142
|
(() => {
|
|
140
143
|
const headless = process.env.HEADLESS !== 'false';
|
|
141
144
|
const timeout = parseInt(process.env.TIMEOUT || '30000', 10);
|
|
145
|
+
const navigationTimeout = parseInt(process.env.NAVIGATION_TIMEOUT || '60000', 10);
|
|
142
146
|
activeClient = new PlaywrightClient({
|
|
143
147
|
stealthMode,
|
|
144
148
|
headless,
|
|
145
149
|
timeout,
|
|
150
|
+
navigationTimeout,
|
|
146
151
|
});
|
|
147
152
|
return activeClient;
|
|
148
153
|
});
|