mcp-browser-testing-server
Provides AI test-plan generation through the Google GenAI/Gemini API, allowing the Dashboard to select models, verify API connections, and generate structured test cases, with transient-error retry support.
Provides AI test-plan generation through the OpenAI Responses API, allowing the Dashboard to select models, verify API connections, and generate structured test cases from a Playwright page map.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-browser-testing-server Navigate to https://example.com/login, sign in as demo@example.com, screenshot dashboard"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcp-browser-testing-server
An open-source Model Context Protocol (MCP) server that lets AI agents control a headless Chromium browser through Playwright for browser automation, end-to-end testing, screenshots, and debugging.
Legal Disclaimer
This tool is developed and provided exclusively for legitimate automated end-to-end (E2E) testing and academic research. You are responsible for ensuring that every target, account, and dataset you access is authorized and that your use complies with all applicable laws, policies, and third-party Terms of Service.
The authors and contributors are not responsible or liable for misuse of this software, including but not limited to unauthorized scraping, spam, abusive automation, bypassing bot-detection or access-control systems, or any activity that violates a third party's Terms of Service. Do not use this project to evade technical safeguards or to access systems without explicit permission.
For transparency, every browser context automatically uses a User-Agent that contains the project identifier:
Mozilla/5.0 ... (MCP-Browser-Testing-Bot/1.0; OpenSource-Disclaimer-Applied)Related MCP server: jev-browser
Features
Headless Chromium automation powered by Playwright and its auto-wait behavior.
A persistent browser session shared across MCP tool calls.
Automatic page mapping of visible fields, buttons, and links with labels and stable selectors.
CSS and XPath locator support.
Full-page, viewport, and element screenshots returned directly as MCP image content.
Standard input/output transport for Claude Desktop and other MCP hosts.
Local AI Test Studio UI for asking QA questions and generating structured test cases.
Bilingual English/Vietnamese Dashboard, with English selected by default.
OpenAI and Google Gemini providers with server-side API key support.
Executable test plans with assertions, screenshots, per-step timing, and pass/fail results.
Separate ESM executables for the MCP server and local Dashboard, generated with tsup.
Available tools
Tool | Purpose |
| Open an absolute HTTP or HTTPS URL. |
| Detect visible input areas and actions with labels and reusable selectors. |
|
|
| Capture the full page, viewport, or one selected element as PNG. |
Requirements
Node.js 20 or newer.
A supported Playwright Chromium binary.
An OpenAI API key and/or a Google Gemini API key for AI test-plan generation.
A ChatGPT Plus subscription does not include OpenAI API usage. ChatGPT and the API Platform use separate billing systems. Create and fund an API account at platform.openai.com before using the OpenAI provider.
Install and run with npx
After this package has been published to npm, install the Chromium binary once:
npx playwright install chromiumThen start the MCP server:
npx -y mcp-browser-testing-server@latestThe process communicates through stdio, so it normally appears idle when started directly. An MCP host launches it and exchanges JSON-RPC messages over stdin/stdout.
Claude Desktop configuration
Add the server to claude_desktop_config.json:
{
"mcpServers": {
"browser-testing": {
"command": "npx",
"args": ["-y", "mcp-browser-testing-server@latest"]
}
}
}Restart Claude Desktop after saving the file. On Windows, if Claude Desktop
cannot resolve npx, set command to npx.cmd.
AI Test Studio Dashboard
Copy the environment template and add at least one provider key:
cp .env.example .envOPENAI_API_KEY=your_openai_api_key
OPENAI_MODEL=gpt-4o-mini
GEMINI_API_KEY=your_gemini_api_key
GEMINI_MODEL=gemini-3.5-flashBuild and start the local Dashboard:
npm run build
npm run dashboardOpen http://127.0.0.1:3210. The Dashboard lets you:
Enter the target website. The QA description is optional.
Select OpenAI or Google Gemini and choose a model.
Verify the API connection before generating content.
Let Playwright map visible fields and actions, then generate validated IT test cases from that context.
Open a target URL in the Playwright-powered browser viewport beside the case list.
Run an individual case and watch the rendered page update after every step.
Track running, passed, or failed states in real time, including timing and screenshot evidence.
When a plan is generated, Playwright first inspects the rendered page and sends the AI a compact page map containing visible field labels, placeholders, input types, required/disabled state, actions, and reusable selectors. This means the tester can leave the description empty or provide only a short business goal.
An API key may also be entered temporarily in the Dashboard. A temporary key is sent only to the local loopback backend for the current request and is not saved to local storage or a file. For regular use, environment variables are recommended.
The Dashboard binds to 127.0.0.1 by default. Do not expose it publicly without
adding authentication, TLS, origin controls, and network access restrictions.
Supported generated actions
Action | Behavior |
| Open an HTTP or HTTPS target. |
| Click the first matching element. |
| Fill a field with generated test data. |
| Scroll an element into view. |
| Verify that an element is visible. |
| Verify that an element contains expected text. |
| Capture a page or element screenshot. |
Local development
npm install
npx playwright install chromium
npm run typecheck
npm run build
npm startFor development without building first:
npm run devTool examples
Navigate to a test target:
{
"url": "https://example.com"
}Type into an input:
{
"action": "type",
"selector": "input[name='email']",
"text": "tester@example.com"
}Capture a selected element:
{
"selector": "main"
}Playwright accepts CSS selectors by default. Prefix XPath selectors with
xpath=, for example xpath=//button[@type='submit'].
Architecture
src/index.ts MCP transport and core MCP tools
src/dashboard.ts Local Dashboard HTTP server and API routes
src/browser.ts Playwright lifecycle and browser operations
src/test-runner.ts Structured test-case execution engine
src/domain/test-case.ts Shared Zod schemas and domain types
src/ai/provider.ts AI provider abstraction and provider factory
src/ai/openai-provider.ts OpenAI Responses API adapter
src/ai/gemini-provider.ts Google GenAI adapter with transient-error retry
web/ Browser UI assetsThe MCP layer depends on the BrowserController abstraction, while all browser
lifecycle and interaction details remain isolated in src/browser.ts. Chromium
starts lazily on the first browser tool call and closes on SIGINT or SIGTERM.
Build output
npm run build creates two executable entry points:
dist/index.js— the stdio MCP server.dist/dashboard.js— the local AI Test Studio.
The MCP SDK and schema validation code are bundled. Playwright remains a runtime dependency because its browser binaries and executable discovery are managed separately.
License
Released under the MIT License.
Available Tools
4 toolsbrowser_inspectInspect page controlsA
Automatically identify visible input areas, buttons, and links on the current page, including human-readable labels and stable selectors.
Inputs: no named parameters.
browser_interactInteract with browserC
Click, type into, or scroll an element into view using a CSS or XPath selector.
Inputs: action (required), selector (required), text.
browser_screenshotCapture screenshotB
Capture a PNG screenshot of the whole page, viewport, or a selected element.
Inputs: fullPage, selector.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool maps to a distinct browser action: navigation, inspection, interaction, and screenshot capture. There is no meaningful overlap between inspecting elements and interacting with them, since one discovers selectors and the other acts on them.
All tools use the same browser_ prefix followed by a concise action-oriented name. browser_screenshot uses a noun form, but it is conventionally understood as an action and does not break the overall pattern.
Four tools is well within the ideal range and each tool has a clear role in the core browser testing loop. The surface is compact without feeling arbitrarily truncated.
The core workflow of navigate, inspect, interact, and screenshot is covered, but important browser-testing operations are missing, such as waiting for elements or page load, extracting text, capturing console/network errors, and closing the browser session. These gaps could cause flaky automation or dead ends.
Maintenance
Related MCP Connectors
Control a real browser from AI agents: navigate, click, type, screenshot, read the page.
Official Browserless MCP server: browser automation, scraping, screenshots and PDFs for AI agents.
Web scraping, browser automation, screenshots and AI data extraction for AI agents via MCP.
Playwright browser automation — navigate, click, fill forms, extract, screenshot — 17 agent tools.
Related MCP Servers
FlicenseAqualityCmaintenanceEnables coding agents to drive a real Playwright-backed browser session, navigating, observing, interacting, and capturing proof on web pages via MCP tools across stdio and Streamable HTTP transports.152-- AlicenseNot gradedqualityBmaintenanceEnables browser automation through MCP with native Playwright operations, deterministic assertions, and natural-language grounded actions, structured extraction, and bounded agent workflows over live page elements.13Apache 2.0
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to drive real Chromium, WebKit, or Firefox browsers — opening named sessions, running ordered steps like clicks, typing, and assertions, and reading back text, console/network logs, and screenshots — so web apps can be tested and explored end to end. It starts and shares dev servers, attaches to already-running browsers, and can fake API responses or device settings.2 npmMIT
- AlicenseNot gradedqualityAmaintenanceEnables AI agents to automate a real Chromium browser through the unchanged upstream Playwright MCP tool surface, covering navigation, research, testing, and daily web workflows in plain language. It ships via npm or Docker over stdio or Streamable HTTP, and supports persistent login profiles, Chrome extension loading, proxy/GeoIP matching, and humanized mouse, keyboard, and scroll behavior.431 npmMIT