mcp-playwright-ts
by LokeshSinhaN
Overview
An AI-powered web automation server using Playwright that allows AI models to interpret natural language commands to interact with web browsers, perform actions, extract information, and provide real-time visual feedback.
Installation
cd backend && npm run devEnvironment Variables
- GEMINI_API_KEY
- GEMINI_MODEL
- PORT
- CHROMEDRIVER_PATH
Security Notes
The server exposes direct browser automation actions (navigate, click, type) via the `/api/execute` endpoint. If this server is exposed to untrusted external users, it presents significant risks: - **Server-Side Request Forgery (SSRF) / Open Redirect:** The `navigate` action allows an attacker to direct the server's browser to arbitrary URLs, potentially including internal network resources or malicious external sites. - **Arbitrary Browser Interaction:** The `click` and `type` actions take user-controlled selectors and text, enabling arbitrary interaction with web pages, which could lead to data exfiltration or manipulation if sensitive pages are accessed. - **Code Injection (Critical):** The `generateSelenium` function directly embeds user-provided `cmd.target` and `cmd.value` into a Python script string without apparent sanitization. If the `commands` array is controllable by an untrusted entity, this is a severe arbitrary code injection vulnerability, allowing them to execute any Python code on the server. - **Reliance on AI Safety:** While Gemini AI is used to interpret commands, if the AI itself is susceptible to prompt injection attacks, the underlying direct browser control functions remain exploitable.
Similar Servers
playwright-mcp
Provides a Model Context Protocol (MCP) server for LLMs to automate browser interactions using Playwright's accessibility tree, avoiding pixel-based vision models.
crawl-mcp
A comprehensive Model Context Protocol (MCP) server that wraps the crawl4ai library for advanced web crawling, content extraction, and AI-powered summarization from various sources including web pages, PDFs, Office documents, and YouTube videos.
verdex-mcp
AI-first browser automation for Playwright test authoring, enabling AI coding assistants to generate robust, container-scoped, and content-filtered Playwright selectors for end-to-end tests.
playwright-mcp-server
Provides a robust, token-aware Playwright browser automation server for Large Language Models (LLMs) and coding agents to interact with web content, supporting advanced features like anti-detection and multi-page management.