playwright-generate-mcp
playwright-generate-mcp
Un servidor Model Context Protocol (MCP) de nivel empresarial que permite a los asistentes de codificación con IA (Cursor, Claude Desktop, Antigravity, Roo Code, etc.) generar, puntuar, ejecutar y auto-corregir pruebas E2E de Playwright robustas, mantenibles y resistentes a la inestabilidad.
Aplica una arquitectura Domain-Driven Page Object Model (POM), ofrece evaluación de calidad entre archivos, extrae diagnósticos completos de fallos en un solo turno y cumple con estrictas reglas anti-inestabilidad web-first.
✨ Características principales
🏗️ Arquitectura de POM Domain-Driven: Garantiza la separación de responsabilidades entre Specs declarativos, Page Objects, Fixtures personalizadas y Factorías de datos dinámicos.
🔍 Evaluación de calidad POM entre archivos:
score_test_qualityyrun_playwright_testrecorren automáticamente las dependencias de importación (.spec.ts$\rightarrow$.fixture.ts$\rightarrow$*.page.ts/*.component.ts), puntuando localizadores y antipatrones en todos los archivos relacionados.⚡ Diagnósticos completos en un solo turno: Cuando una prueba falla,
run_playwright_testdevuelve de inmediato la ubicación exacta de archivo y línea, la categoría del error, los últimos 3–5 pasos de acción antes del fallo, los registros de la consola del navegador, las peticiones HTTP fallidas (4xx/5xx) y las rutas de las capturas de pantalla en un solo turno.🛡️ Reglas estrictas anti-inestabilidad: Detecta y desaconseja las esperas arbitrarias (
waitForTimeout,setTimeout), las acciones sin await, las dependencias denetworkidley las extracciones manuales de texto, en favor de aserciones web-first con reintento automático.🧭 Auto-detección de la raíz sin estado: Recorre automáticamente los directorios padre para descubrir
playwright.config.{ts,js,mjs,cjs,mts,cts}sin necesidad de configurar rutas manualmente.💬 Confirmaciones interactivas adaptativas: Admite modales de UI interactivos (
ask_question,vscode_askQuestions) o listas numeradas con formato antes de aplicar las auto-correcciones a las pruebas.
Related MCP server: Limetest MCP Server
📁 Estándar de arquitectura
Este MCP guía a los agentes de IA para que estructuren las pruebas siguiendo una jerarquía Domain-Driven limpia:
tests/e2e/
├── domain/ # Grouped by business features
│ └── {feature}/
│ ├── pages/ # Page Objects / Component Objects
│ │ └── {step}.page.ts
│ └── {feature}.fixture.ts # Custom Fixture injecting Page Objects & Data
├── factory/ # Dynamic test data builders
│ └── {entity}.factory.ts # Unique data per run (timestamp / Faker)
└── specs/ # Declarative, readable test specs
└── {feature}.spec.tsReglas de diseño principales
Separación estricta: No se permiten localizadores en bruto ni manipulaciones directas del DOM dentro de los archivos
*.spec.ts. Todas las interacciones de UI residen en los Page/Component Objects.Fixtures personalizadas: Inyecta Page Objects y datos de prueba mediante
test.extend<Fixtures>()en lugar de instanciar manualmentenew Page()en los specs.Factorías de datos dinámicos: Genera datos de prueba dinámicos en cada ejecución para evitar colisiones con las restricciones de unicidad de la base de datos al reejecutar las pruebas.
Localizadores semánticos: Prioriza
getByRole>getByLabel/getByPlaceholder>getByText>getByTestId. El CSS profundamente anidado (div > div > span) está estrictamente prohibido.Convenciones de etiquetado:
@smoke: Caminos felices críticos.@regression: Flujos de usuario completos.@ui: Pruebas de UI/frontend puro que usanpage.route()para simular las respuestas de la API.@integration: Pruebas que validan contra APIs de backend reales.
🛠️ Herramientas MCP
Herramienta | Descripción |
| Ejecuta un archivo spec de Playwright en el proyecto de destino. Devuelve el estado de aprobado/fallido, un |
| Puntúa un archivo spec y sus Page Objects importados según señales de calidad medibles: |
| Inspector de diagnóstico profundo para volver a inspeccionar los detalles específicos de un fallo de prueba a partir de un informe de ejecución anterior. |
| Audita |
| Respaldo en tiempo de ejecución para establecer manualmente la raíz del proyecto de destino si la auto-detección no es aplicable. |
📋 Prompts MCP
playwright_e2e_workflow: Prompt completo de extremo a extremo que instruye a los agentes de IA sobre la arquitectura de POM Domain-Driven, las secuencias de generación de código (del Paso A al Paso E), las reglas estrictas de escritura anti-inestabilidad, los diagnósticos de un solo turno y los flujos de trabajo de auto-corrección seguros.
🚀 Instalación y configuración
1. Compilar desde el código fuente
git clone https://github.com/your-username/playwright-generate-mcp.git
cd playwright-generate-mcp
npm install
npm run build2. Configurar el cliente MCP
Añade el servidor a tu archivo de configuración MCP (por ejemplo, claude_desktop_config.json, Configuración de Cursor o ajustes MCP de Antigravity):
{
"mcpServers": {
"playwright-generate": {
"command": "node",
"args": ["/absolute/path/to/playwright-generate-mcp/dist/index.js"]
}
}
}O cuando se publique en NPM:
{
"mcpServers": {
"playwright-generate": {
"command": "npx",
"args": ["-y", "playwright-generate-mcp"]
}
}
}🧑💻 Desarrollo
npm run dev # tsx watch mode
npm run build # Compile TypeScript to dist/
npm start # Run compiled MCP server📄 Licencia
MIT
Available Tools
8 toolscheck_playwright_configCheck Playwright configA
Statically analyze playwright.config.* (TypeScript AST, not executed) for flakiness-relevant settings (retries, workers, trace, screenshot, video, forbidOnly, fullyParallel) and reporters (HTML/JSON/Allure). Reports whether each value is a literal or a runtime expression. Project-level, not per-spec.
| Name | Required | Description | Default |
|---|---|---|---|
| configPath | No | Path to playwright.config.* relative to project root or absolute. If omitted, auto-detected at project root. | |
| projectRoot | No | Optional path to the project root. If omitted, auto-detected. |
Output Schema
| Name | Required | Description |
|---|---|---|
| note | Yes | |
| found | Yes | |
| analysis | Yes | |
| settings | Yes | |
| warnings | Yes | |
| reporters | No | |
| configPath | Yes | |
| limitations | No | |
| settingDetails | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the burden and does well: 'TypeScript AST, not executed' makes clear this is a side-effect-free static read, and 'Reports whether each value is a literal or a runtime expression' sets expectations for output shape. It omits edge-case behavior such as what happens when no config is found, keeping it short of a 5.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three tight sentences, front-loaded with the core action and resource, with the static-analysis nature and scope placed where they matter most. Every clause earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
An output schema exists so return values need no explanation, and the description covers the static-analysis nature, inspected fields, and project-level scope. Only the absence of any failure/no-config behavior keeps it from being fully complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100% and both parameters (configPath, projectRoot) are fully documented in the schema, including auto-detection defaults. The description adds no syntax or format detail beyond that, so the baseline 3 applies.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb and resource ('Statically analyze playwright.config.*') and enumerates exactly which settings and reporters it inspects. The scope qualifier 'Project-level, not per-spec' cleanly separates it from per-spec siblings like run_playwright_test.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The mention of 'flakiness-relevant settings' implies this is a pre-flight diagnostic for flaky tests, but it never says when to reach for this tool versus check_test_prerequisites or score_test_quality. Usage is inferable but not stated.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
check_test_prerequisitesCheck test prerequisitesA
Read-only preflight check for a target project. Detects the local (or workspace-hoisted) Playwright package, CLI, config, browser builds matching the installed Playwright version, branded channels, optional Allure adapter/CLI, and report artifacts — without installing packages or downloading browsers.
| Name | Required | Description | Default |
|---|---|---|---|
| projectRoot | No | Optional path to the target project root. Auto-detected if omitted. |
Output Schema
| Name | Required | Description |
|---|---|---|
| allure | Yes | |
| warnings | Yes | |
| nextSteps | Yes | |
| playwright | Yes | |
| projectRoot | Yes | |
| workspaceRoot | No | |
| packageJsonFound | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the behavioral burden and does so well: it explicitly declares the operation is read-only and that it will NOT install packages or download browsers — the key safety concern for an agent deciding whether the call is side-effect-free. It omits permission/error behavior, but the critical non-mutation trait is disclosed.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The safety-relevant "Read-only preflight check" is front-loaded, followed by a tight enumeration of detected artifacts. It is a single dense sentence with no filler, though the long detected-item list reads slightly run-on.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
An output schema exists, so return values need not be described. The description adequately conveys what the check covers and that it is non-mutating. The remaining gap is the absence of any routing guidance relative to the sibling check_playwright_config.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
There is a single optional parameter whose schema description already covers it (100% coverage), auto-detected if omitted. The description references "a target project" but adds no meaning beyond the schema, so the baseline of 3 applies.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description opens with a precise verb+resource ("Read-only preflight check for a target project") and enumerates exactly what it detects (Playwright package, CLI, config, browser builds, channels, Allure, artifacts). This is far more specific than the bare title, though it never names the closely related sibling check_playwright_config to draw a boundary.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
"Preflight check" implies it runs before test execution, giving implied timing guidance. However, it never states when to prefer this over check_playwright_config or what condition should route an agent here versus elsewhere, so guidance remains implicit rather than explicit.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
generate_test_reportGenerate test reportA
Locate or generate a visual test report. 'quality' and 'html' locate existing reports (the quality dashboard at test-results/quality-report.html; the Playwright HTML report written by the project's html reporter). 'allure' generates allure-report/ from allure-results/ with the local Allure CLI (never downloaded). Returns status: located | generated | not_found | setup_required | generation_failed.
| Name | Required | Description | Default |
|---|---|---|---|
| reporter | No | The report to provide: 'quality' (locate test-results/quality-report.html), 'html' (locate the Playwright HTML report written by the project's html reporter), or 'allure' (generate allure-report/ from allure-results/ with the local Allure CLI). | quality |
| projectRoot | No | Optional path to target project root. Auto-detected if omitted. |
Output Schema
| Name | Required | Description |
|---|---|---|
| mode | Yes | |
| exists | Yes | |
| status | Yes | |
| message | Yes | |
| reporter | Yes | |
| generator | No | |
| reportPath | No | |
| commandToOpen | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden and does well: it discloses that 'allure' writes allure-report/ from allure-results/ using a local CLI that is 'never downloaded', and it enumerates the possible outcome statuses including setup_required, which implicitly warns about missing prerequisites. It does not say whether an existing allure-report is overwritten or what happens on partial generation.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Front-loaded with the core action, then compact per-value clauses and a status list, with no filler. It is dense but every sentence carries information; the status enumeration is slightly terse but earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
An output schema exists, so return values need not be explained, yet the description still summarizes status outcomes. For a 2-parameter, zero-required tool this is nearly complete; only edge behavior (overwriting existing reports, prerequisite failure handling) is unaddressed.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100% and the reporter enum is fully documented in the schema; the description's per-value explanation largely restates that enum text rather than adding new syntax or constraints. projectRoot is left entirely to the schema. Baseline 3 applies since the schema does the heavy lifting.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb+resource ('Locate or generate a visual test report') and then splits the behavior per reporter value, making the locate-vs-generate distinction explicit. This clearly separates it from siblings like score_test_quality (analysis) and run_playwright_test (execution).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It gives clear context for which reporter value to choose and what each one does ('quality'/'html' locate, 'allure' generates), which is real routing guidance. However, it never states when to prefer this tool over alternatives such as check_test_prerequisites or score_test_quality, and offers no exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_failure_detailsGet failure detailsA
Get the full diagnostic breakdown for one failing test from a previous run_playwright_test report: exact location, recent steps, call log, browser console errors, page errors, failed requests, and screenshot/trace/video/error-context paths. Pass testId when titles repeat (e.g. the same spec in several projects).
| Name | Required | Description | Default |
|---|---|---|---|
| testId | No | Stable test identity from the run output; required when titles are duplicated (e.g. one spec in several projects). | |
| testTitle | Yes | Exact title of the failing test, as returned by run_playwright_test. | |
| reportPath | Yes | The `reportPath` returned by a previous run_playwright_test call for this run. | |
| projectRoot | No | Optional project root used to authorize an in-project report path. |
Output Schema
| Name | Required | Description |
|---|---|---|
| testId | No | |
| location | No | |
| errorType | Yes | |
| fullTitle | No | |
| testTitle | Yes | |
| videoPath | No | |
| pageErrors | No | |
| projectName | No | |
| recentSteps | No | |
| errorMessage | Yes | |
| traceZipPath | No | |
| consoleErrors | No | |
| networkErrors | No | |
| callLogExcerpt | No | |
| screenshotPath | No | |
| errorContextPath | No | |
| diagnosticsOmitted | No | |
| diagnosticsSources | No | |
| healingGateDirective | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are supplied, so the description must carry the full behavioral burden. It does disclose that the tool reads from a previous run's report and enumerates what is surfaced, but it never states that the operation is read-only/side-effect free, nor what happens when testTitle/testId matches nothing. That leaves meaningful behavioral gaps for a no-annotation tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences, front-loaded with purpose before the conditional-parameter note. The long artifact enumeration is useful for selection but overlaps with the output schema, which slightly dilutes conciseness.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
An output schema exists, so the return values need not be explained in prose, and the description still covers the key precondition and the duplicate-title case. Only the absence of read-only/error behavior keeps it from being fully complete for a no-annotation tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so all four parameters including the testId conditional requirement are already documented in the schema. The description's 'Pass testId when titles repeat' restates the schema rather than adding new syntax, format, or defaulting detail, so the baseline 3 applies.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb and resource ('Get the full diagnostic breakdown for one failing test') and pins the source to a previous run_playwright_test report, which separates it from run_playwright_test and generate_test_report at a glance. The enumerated payload (location, steps, call log, console/page errors, failed requests, artifact paths) makes the scope unambiguous.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Gives a clear precondition (a report from a prior run_playwright_test) and a concrete disambiguation rule ('Pass testId when titles repeat, e.g. the same spec in several projects'). It stops short of naming alternative tools for adjacent needs (e.g. generate_test_report for an overview), so no explicit when-not guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
run_playwright_testRun Playwright testA
Run a Playwright spec file in the target project and return a bounded, structured result: explicit status, counts, runner/process metadata, up to 5 failures with location, error type, recent steps, browser console errors, page errors and failed requests (from trace.zip and/or the scaffolded diagnostics fixture), screenshot/trace/video/error-context paths, and a compact qualityScore. The project's own reporters (HTML, Allure) keep running. Use detail:'full' or get_failure_details for more. TOKEN ECONOMY INSTRUCTION: In your response, provide a clean, compact 2–3 line summary (status, duration, video link, and failure cause) rather than dumping large markdown tables into chat. If tests fail, analyze the error and formulate a concrete fix proposal in '.page.ts'. To confirm with the user before applying fixes: 1) If an interactive question/selection tool is available in your environment (e.g. ask_question, vscode_askQuestions), MUST use it to present options: ['Apply Fix & Re-run', 'Review Diff First', 'Cancel']. 2) Otherwise, present the options as a clean numbered list in your response so the user can easily reply with just the number.
| Name | Required | Description | Default |
|---|---|---|---|
| grep | No | Only run tests whose title matches this pattern (passed to --grep). | |
| detail | No | Response size. 'summary' (default) returns status, counts, up to 5 failures with bounded diagnostics and artifact paths. 'full' adds every test with retry attempts, runner stdout/stderr and the complete quality score. Prefer get_failure_details for one test. | |
| headed | No | Run in headed (visible browser) mode instead of headless. | |
| specPath | Yes | Path to the spec file, relative to project root or absolute, e.g. "e2e/payment.spec.ts". | |
| timeoutMs | No | Maximum runner duration in milliseconds (default 120000; allowed range 100–900000). | |
| projectRoot | No | Optional path to the target project root. If omitted, auto-detected by searching for playwright.config.*. | |
| generateHtmlReport | No | Set to true to generate the standalone visual quality report at test-results/quality-report.html. |
Output Schema
| Name | Required | Description |
|---|---|---|
| tests | Yes | |
| detail | Yes | |
| runner | No | |
| status | Yes | |
| summary | Yes | |
| failures | No | |
| videoPath | No | |
| durationMs | Yes | |
| reportPath | No | |
| projectRoot | Yes | |
| runnerError | No | |
| outputBudget | No | |
| qualityScore | No | |
| testsOmitted | No | |
| traceZipPath | No | |
| nativeReports | No | |
| prerequisites | No | |
| failuresOmitted | No | |
| healingGateDirective | No | |
| qualityReportHtmlPath | No | |
| reportPromptDirective | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden and does disclose real behavior: results are bounded, up to 5 failures are returned, artifact paths and diagnostics come from trace.zip/diagnostics fixture, and the project's own reporters keep running. It does not disclose side effects of executing a test run (process spawn, timeouts, server/runner requirements) or what happens on timeout, and a large share of the text describes the agent's chat response rather than the tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Purpose is front-loaded and clear, but roughly half the text is an off-topic 'TOKEN ECONOMY INSTRUCTION' plus a three-option fix-confirmation protocol that describes how the agent should format its reply rather than what the tool does. Those sentences do not earn their place in a tool definition and dilute the signal.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
An output schema exists, so return values need not be re-explained, and the description still covers run scope, filtering, timeout, reporting and artifact generation adequately for a 7-parameter tool. The remaining gap is environment/prerequisite context, though sibling tools (check_test_prerequisites, check_playwright_config, set_project_root) partially cover that.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100% with per-parameter descriptions for all 7 parameters, including the detail enum semantics, so the schema does the heavy lifting. The description only echoes the detail:'full' behavior, adding no new parameter meaning. Baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb and resource ('Run a Playwright spec file in the target project') and immediately characterizes the return shape. It differentiates itself from the sibling get_failure_details by naming it as the route for deeper per-test detail. An agent can identify the tool's role without opening the schema.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Routes the agent to two alternatives ('Use detail:'full' or get_failure_details for more'), which is genuine when-to-use guidance. However, it never states prerequisites (e.g., that check_test_prerequisites / project root setup may be needed) or when *not* to run this tool, and the guidance is embedded in a large block of unrelated workflow instructions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
scaffold_test_domainScaffold test domainA
Scaffold the Domain-Driven POM structure for a feature: pages, mock API handlers, real API helpers, custom fixture, dynamic data factory and a spec, plus a shared diagnostics fixture (tests/e2e/support) that records browser console/page/network events. The spec is an explicit skeleton: its tests are test.fixme (skipped) and marked @mcp-skeleton until the TODOs are implemented. Always use this before writing new tests to ensure a consistent structure.
| Name | Required | Description | Default |
|---|---|---|---|
| steps | No | Optional list of step/page names for this feature, e.g. ["email", "otp", "password"]. Defaults to [featureName]. | |
| overwrite | No | Whether to overwrite existing files if they already exist. Default: false. | |
| featureName | Yes | Name of the domain feature in kebab-case or camelCase, e.g. "auth", "checkout", or "user-profile" (max 64 characters). | |
| projectRoot | No | Optional path to target project root. Auto-detected if omitted. |
Output Schema
| Name | Required | Description |
|---|---|---|
| feature | Yes | |
| skeleton | Yes | |
| specFile | Yes | |
| domainDir | Yes | |
| nextSteps | Yes | |
| factoryFile | Yes | |
| createdFiles | Yes | |
| skippedFiles | Yes | |
| diagnosticsFixtureFile | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden and does well: it discloses exactly which files are generated and that the spec is a non-functional skeleton whose tests are test.fixme (skipped) and tagged @mcp-skeleton until TODOs are implemented. It stops short of stating that files are written to disk by default and how conflicts with existing files behave beyond the schema's overwrite flag.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Front-loaded with the verb and artifact list, then the skeleton caveat, then the usage rule; three sentences with almost no filler. The first sentence is a long comma-run list, which is dense but justified since it defines the tool's scope.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
An output schema exists, so return values need not be explained, and the description covers inputs' intent, generated artifacts, and the skipped-skeleton behavior. The remaining gap is prerequisites/ordering relative to sibling tools like check_test_prerequisites.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so featureName, steps, overwrite, and projectRoot are already fully documented in the schema (including kebab-case/camelCase examples and the steps default). The description adds no parameter-level meaning beyond what the schema provides, which is the baseline 3.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb (scaffold) and enumerates the exact artifacts produced: pages, mock API handlers, real API helpers, custom fixture, dynamic data factory, a spec, plus a shared diagnostics fixture under tests/e2e/support. No sibling tool creates project scaffolding, so the purpose is unmistakable against run_playwright_test, score_test_quality, or generate_test_report.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
"Always use this before writing new tests to ensure a consistent structure" gives explicit when-to-use guidance and a clear ordering constraint relative to test authoring. However, it names no alternatives and states no when-not-to-use condition (e.g., how it relates to check_test_prerequisites).
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
score_test_qualityScore test qualityA
Score a spec file and its imported Page Objects with the TypeScript AST (comments and strings are ignored): % semantic locators vs raw CSS/XPath, assertion density, anti-pattern warnings with line numbers, and scaffold skeleton status.
| Name | Required | Description | Default |
|---|---|---|---|
| specPath | Yes | Path to the spec file or page object to score, relative to project root or absolute. | |
| projectRoot | No | Optional path to the project root. If omitted, auto-detected by searching for playwright.config.*. | |
| generateHtmlReport | No | Set to true to generate the standalone visual quality report at test-results/quality-report.html. |
Output Schema
| Name | Required | Description |
|---|---|---|
| scaffold | Yes | |
| warnings | Yes | |
| antiPatterns | Yes | |
| fileBreakdown | No | |
| locatorQuality | Yes | |
| assertionDensity | Yes | |
| qualityReportHtmlPath | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It does disclose a genuine behavioral trait — TypeScript AST parsing that ignores comments and strings, plus line-numbered warnings — which is more than a bare restatement. However it never states that the operation is read-only (it is not, when generateHtmlReport writes a file) or what prerequisites/configuration it depends on.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single compact sentence that front-loads the verb, target, and mechanism before listing the outputs. Dense but every clause earns its place; only the long colon-separated metric list makes it slightly heavy to parse.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With full schema coverage and an output schema that carries the return shape, the description only needs to justify the tool's existence and it does so clearly. The one remaining gap is the absence of a stated precondition or relationship to prerequisite/config siblings, which slightly limits an agent's routing confidence.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so all three parameters (specPath, projectRoot, generateHtmlReport) are already documented in the schema, setting the baseline at 3. The description adds no syntax, format, or constraint detail beyond the schema, though its mention of 'imported Page Objects' loosely reinforces that specPath accepts a page object too.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb (score) and precise resource (a spec file plus its imported Page Objects), then enumerates the exact metrics produced: semantic-vs-raw locator ratio, assertion density, anti-pattern warnings, and scaffold status. This is unmistakably distinct from every sibling (run_playwright_test, generate_test_report, check_test_prerequisites), so no explicit sibling routing is needed.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description says what the tool computes but never states when to reach for it instead of alternatives such as run_playwright_test or generate_test_report, nor any precondition (e.g. a resolved project root, a sibling tool for prerequisites). Usage is only inferable from the purpose itself.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
set_project_rootSet project rootA
Explicitly set the target project root directory. Use this as a fallback if playwright.config.* cannot be automatically discovered by other tools.
| Name | Required | Description | Default |
|---|---|---|---|
| projectRoot | Yes | Absolute path to the target project root, e.g. "/home/user/my-app". |
Output Schema
| Name | Required | Description |
|---|---|---|
| message | Yes | |
| projectRoot | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It says 'explicitly set' but does not disclose whether the setting persists across calls/sessions, whether it overrides auto-discovery, what happens if the path is invalid, or any side effects.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two short sentences, front-loaded with the action and followed by the fallback condition. No filler.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a single-parameter setter with full schema coverage and an output schema, the description covers the essential purpose and trigger. The main remaining gap is behavioral detail (persistence, override semantics) that no structured field supplies.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100% and the sole parameter is documented with type, requirement, and an example path. The description adds no parameter meaning beyond the schema, so the baseline 3 applies.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb+resource: 'set the target project root directory'. It also scopes the tool as a fallback, which helps separate it from check_playwright_config, though it does not name that sibling explicitly.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Gives a clear condition for use: fall back to this when playwright.config.* cannot be auto-discovered. It does not spell out when not to use it (e.g., when discovery succeeds) or name the alternative tools, but the trigger context is explicit.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
8 tool updates
v0.2.0- First observed
check_playwright_config - First observed
check_test_prerequisites - First observed
generate_test_report - First observed
get_failure_details - First observed
run_playwright_test - First observed
scaffold_test_domain - First observed
score_test_quality - First observed
set_project_root
TDQS
Scored across 8 tools
Each tool targets a distinct phase: setup (set_project_root), preflight (check_test_prerequisites), config analysis (check_playwright_config), scaffolding, scoring, execution, failure drill-down, and reporting. The only mild overlap is between check_test_prerequisites, check_playwright_config, and set_project_root, all of which touch project setup/configuration, but their descriptions clearly delineate read-only checks versus an explicit override.
All eight tools follow a strict verb_noun snake_case pattern (set_project_root, check_test_prerequisites, run_playwright_test, get_failure_details, generate_test_report, etc.). No camelCase or mixed conventions; the scheme is fully predictable.
Eight tools is well-scoped for a Playwright test generation and quality workflow. Each tool occupies a distinct stage (setup, preflight, config, scaffold, score, run, diagnose, report) and none feel redundant or padding.
The surface covers a full lifecycle: project/config discovery, scaffolding, quality scoring, execution, failure diagnosis, and report generation. Minor gaps exist—no tool to edit/apply suggested fixes or to clean up generated artifacts—but an agent can work around these, and the run_playwright_test description even hints at fix proposals.
Maintenance
Related MCP Connectors
Approved test intent, reviewed Playwright automation and run evidence, inside your editor.
Write, run and check natural-language browser tests of your web app from your AI assistant.
Browser-based QA for AI-built software. Test pages with real browsers via agents.
Agentic AI quality engineering: run, debug and triage tests on real browsers and devices
Related MCP Servers
- AlicenseAqualityDmaintenanceGenerates intelligent Playwright locators with reliability rankings, creates Page Object Models, and runs test automation scripts directly from your IDE or AI assistant.59 npm1MIT
- AlicenseNot gradedqualityCmaintenanceEnables automated end-to-end testing powered by Playwright where test cases are defined in natural language and executed by AI. Uses lightweight snapshot analysis with vision mode fallback for sophisticated testing scenarios.3Apache 2.0
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to execute browser automation, perform QA tasks, and generate test code through natural language commands using Playwright.7MIT
- AlicenseNot gradedqualityDmaintenanceAutomates repository analysis, test planning, and generation of end-to-end tests with Playwright, acting as an intelligent quality assistant.2 npmMIT