Add Playwright based MCP server#1647
Conversation
…core - Move playwright from devDependencies to dependencies so it's available at runtime - Add playwright-core to externals to prevent bundling issues - Fixes 'Cannot find module playwright-core' error when running in http mode
…nshots - Add waitForNetworkIdle method to BaseAgent interface in types.ts - Call waitForNetworkIdle after action execution in tool-generator.ts - Update PlaywrightAgent.waitForNetworkIdle to use optional timeout, respecting Playwright's configured navigationTimeout by default This fixes an issue where clicking links that trigger navigation would return screenshots of the old page before the new page finished loading.
Add common tools for browser control that execute directly without AI: - navigate, reload, go_back, go_forward, get_url, get_title Also add web_close tool to playwright-mcp and web-bridge-mcp.
Some MCP clients like Cursor perform client-side tool argument validation that incorrectly rejected string values when the schema specified union([string, number]). Simplified the value field to accept only strings, which fixes compatibility issues while maintaining the same runtime behavior. The transform() call is also removed since it's no longer needed.
✅ Deploy Preview for midscene ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Actions like KeyboardPress with no locate parameter should execute directly without calling the AI model service. Previously, all actions went through aiAction() which requires AI, causing 403 errors when pressing keys like Enter/Tab without specifying an element to locate. Changes: - Add callActionInActionSpace to BaseAgent interface for direct execution - Add actionNeedsAI() to detect if locate fields require AI resolution - Use direct execution when no locate prompt is provided - Fall back to aiAction only when AI reasoning is needed
- Set viewport: null initially to detect natural window size - Cap viewport at 1280x720 maximum for consistency on large screens - Fit to actual window size on smaller screens to prevent overflow - Use innerWidth/innerHeight for accurate viewport detection
|
Thanks for the contribution! However, our current codebase already supports non-bridge mode for the web MCP server. In const isBridge = process.argv.includes('--bridge');
const tools = isBridge
? new WebMidsceneTools() // Bridge mode
: new WebPuppeteerMidsceneTools(); // Default: Puppeteer non-bridge modeThe So we don't think adding a separate Playwright-based MCP package is necessary at this point, as the existing Puppeteer mode already covers this use case. If you have specific requirements that Puppeteer mode doesn't satisfy, feel free to share them and we can discuss further. |
|
If there is still a need, please reopen the current pr |
In v1 the MCP server for web automation only supports bridge mode. This change bring the deprecated MCP server back.