Skip to main content
Glama
playwright-generate-mcp

playwright-generate-mcp

by baramubarok

playwright-generate-mcp

一个企业级的模型上下文协议(MCP)服务器,使 AI 编码助手(Cursor、Claude Desktop、Antigravity、Roo Code 等)能够生成、评分、运行并自动修复健壮、可维护且抗不稳定的 Playwright E2E 测试。

它强制实施领域驱动的页面对象模型(POM)架构,提供跨文件质量评分,提取丰富的单轮失败诊断,并遵循严格的Web 优先的反不稳定规则。


✨ 核心功能

  • 🏗️ 领域驱动 POM 架构:在声明式 Spec、页面对象、自定义 Fixtures 和动态数据工厂之间强制执行关注点分离。

  • 🔍 跨文件 POM 质量评分:score_test_quality 和 run_playwright_test 会自动遍历导入依赖关系(.spec.ts $\rightarrow$ .fixture.ts $\rightarrow$ *.page.ts / *.component.ts),对所有相关文件中的定位器和反模式进行评分。

  • ⚡ 单轮丰富诊断:当测试失败时,run_playwright_test 会在单轮内立即返回确切的文件及行号位置、错误类别、失败前最后 3–5 个操作步骤、浏览器控制台日志、失败的 HTTP 请求(4xx/5xx)以及截图路径。

  • 🛡️ 严格的反不稳定规则:检测并不鼓励随意的 sleep(waitForTimeout、setTimeout)、未 await 的操作、networkidle 依赖和手动文本提取,转而推荐 Web 优先的自动重试断言。

  • 🧭 无状态根目录自动发现:自动遍历父目录以发现 playwright.config.{ts,js,mjs,cjs,mts,cts},无需手动配置路径。

  • 💬 自适应交互式确认:在应用测试修复之前,支持交互式 UI 弹窗(ask_question、vscode_askQuestions)或格式化的编号列表。


Related MCP server: Limetest MCP Server

📁 架构标准

该 MCP 引导 AI 智能体按照清晰的领域驱动层级结构来组织测试:

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.ts

核心设计规则

  1. 严格分离:*.spec.ts 文件中不得出现原始定位器或直接 DOM 操作。所有 UI 交互都位于页面/组件对象中。

  2. 自定义 Fixtures:使用 test.extend<Fixtures>() 注入页面对象和测试数据,而不是在 spec 中手动实例化 new Page()。

  3. 动态数据工厂:每次运行生成唯一的测试数据,以防止测试重跑时发生数据库唯一约束冲突。

  4. 语义化定位器:优先使用 getByRole > getByLabel / getByPlaceholder > getByText > getByTestId。严格禁止深层嵌套的 CSS(div > div > span)。

  5. 标签约定:

    • @smoke:关键快乐路径。

    • @regression:全面的用户流程。

    • @ui:使用 page.route() 拦截并模拟 API 响应的纯 UI/前端测试。

    • @integration:针对真实后端 API 进行验证的测试。


🛠️ MCP 工具

工具

描述

run_playwright_test

在目标项目中运行 Playwright spec 文件。返回通过/失败状态、全面的多文件 qualityScore,以及即时内联失败诊断(确切位置、之前 3–5 个步骤、控制台错误、网络失败、截图)。

score_test_quality

根据可衡量的质量信号对 spec 文件及其导入的页面对象进行评分:% semantic locators、断言密度、反模式(waitForTimeout、缺失 await、索引定位器)以及特定于文件的警告。

get_failure_details

深度诊断检查器,用于从之前的运行报告中重新检查特定测试失败的详细信息。

check_playwright_config

审计 playwright.config.* 中与不稳定相关的设置(retries、trace、screenshot、forbidOnly、fullyParallel)。

set_project_root

运行时回退方案,用于在自动检测不适用时手动设置目标项目根目录。


📋 MCP 提示词

  • playwright_e2e_workflow:完整的端到端提示词,指导 AI 智能体掌握领域驱动 POM 架构、代码生成顺序(步骤 A 到步骤 E)、严格的反不稳定编写规则、单轮诊断以及安全的修复工作流。


🚀 安装与设置

1. 从源码构建

git clone https://github.com/your-username/playwright-generate-mcp.git
cd playwright-generate-mcp
npm install
npm run build

2. 配置 MCP 客户端

将服务器添加到你的 MCP 配置文件中(例如 claude_desktop_config.json、Cursor Settings 或 Antigravity MCP 设置):

{
  "mcpServers": {
    "playwright-generate": {
      "command": "node",
      "args": ["/absolute/path/to/playwright-generate-mcp/dist/index.js"]
    }
  }
}

或者当发布到 NPM 时:

{
  "mcpServers": {
    "playwright-generate": {
      "command": "npx",
      "args": ["-y", "playwright-generate-mcp"]
    }
  }
}

🧑💻 开发

npm run dev     # tsx watch mode
npm run build   # Compile TypeScript to dist/
npm start       # Run compiled MCP server

📄 许可证

MIT

Available Tools

8 tools
check_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.

NameRequiredDescriptionDefault
configPathNoPath to playwright.config.* relative to project root or absolute. If omitted, auto-detected at project root.
projectRootNoOptional path to the project root. If omitted, auto-detected.

Output Schema

NameRequiredDescription
noteYes
foundYes
analysisYes
settingsYes
warningsYes
reportersNo
configPathYes
limitationsNo
settingDetailsNo

TDQS

A4/5.0
Behavior4/5

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.

Conciseness5/5

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.

Completeness4/5

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.

Parameters3/5

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.

Purpose5/5

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.

Usage Guidelines3/5

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.

NameRequiredDescriptionDefault
projectRootNoOptional path to the target project root. Auto-detected if omitted.

Output Schema

NameRequiredDescription
allureYes
warningsYes
nextStepsYes
playwrightYes
projectRootYes
workspaceRootNo
packageJsonFoundYes

TDQS

A3.7/5.0
Behavior4/5

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.

Conciseness4/5

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.

Completeness4/5

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.

Parameters3/5

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.

Purpose4/5

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.

Usage Guidelines3/5

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.

NameRequiredDescriptionDefault
reporterNoThe 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
projectRootNoOptional path to target project root. Auto-detected if omitted.

Output Schema

NameRequiredDescription
modeYes
existsYes
statusYes
messageYes
reporterYes
generatorNo
reportPathNo
commandToOpenNo

TDQS

A4.1/5.0
Behavior4/5

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.

Conciseness4/5

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.

Completeness4/5

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.

Parameters3/5

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.

Purpose5/5

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.

Usage Guidelines4/5

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).

NameRequiredDescriptionDefault
testIdNoStable test identity from the run output; required when titles are duplicated (e.g. one spec in several projects).
testTitleYesExact title of the failing test, as returned by run_playwright_test.
reportPathYesThe `reportPath` returned by a previous run_playwright_test call for this run.
projectRootNoOptional project root used to authorize an in-project report path.

Output Schema

NameRequiredDescription
testIdNo
locationNo
errorTypeYes
fullTitleNo
testTitleYes
videoPathNo
pageErrorsNo
projectNameNo
recentStepsNo
errorMessageYes
traceZipPathNo
consoleErrorsNo
networkErrorsNo
callLogExcerptNo
screenshotPathNo
errorContextPathNo
diagnosticsOmittedNo
diagnosticsSourcesNo
healingGateDirectiveNo

TDQS

A3.9/5.0
Behavior3/5

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.

Conciseness4/5

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.

Completeness4/5

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.

Parameters3/5

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.

Purpose5/5

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.

Usage Guidelines4/5

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.

NameRequiredDescriptionDefault
grepNoOnly run tests whose title matches this pattern (passed to --grep).
detailNoResponse 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.
headedNoRun in headed (visible browser) mode instead of headless.
specPathYesPath to the spec file, relative to project root or absolute, e.g. "e2e/payment.spec.ts".
timeoutMsNoMaximum runner duration in milliseconds (default 120000; allowed range 100–900000).
projectRootNoOptional path to the target project root. If omitted, auto-detected by searching for playwright.config.*.
generateHtmlReportNoSet to true to generate the standalone visual quality report at test-results/quality-report.html.

Output Schema

NameRequiredDescription
testsYes
detailYes
runnerNo
statusYes
summaryYes
failuresNo
videoPathNo
durationMsYes
reportPathNo
projectRootYes
runnerErrorNo
outputBudgetNo
qualityScoreNo
testsOmittedNo
traceZipPathNo
nativeReportsNo
prerequisitesNo
failuresOmittedNo
healingGateDirectiveNo
qualityReportHtmlPathNo
reportPromptDirectiveNo

TDQS

A3.7/5.0
Behavior3/5

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.

Conciseness2/5

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.

Completeness4/5

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.

Parameters3/5

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.

Purpose5/5

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.

Usage Guidelines4/5

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.

NameRequiredDescriptionDefault
stepsNoOptional list of step/page names for this feature, e.g. ["email", "otp", "password"]. Defaults to [featureName].
overwriteNoWhether to overwrite existing files if they already exist. Default: false.
featureNameYesName of the domain feature in kebab-case or camelCase, e.g. "auth", "checkout", or "user-profile" (max 64 characters).
projectRootNoOptional path to target project root. Auto-detected if omitted.

Output Schema

NameRequiredDescription
featureYes
skeletonYes
specFileYes
domainDirYes
nextStepsYes
factoryFileYes
createdFilesYes
skippedFilesYes
diagnosticsFixtureFileYes

TDQS

A4.1/5.0
Behavior4/5

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.

Conciseness4/5

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.

Completeness4/5

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.

Parameters3/5

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.

Purpose5/5

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.

Usage Guidelines4/5

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.

NameRequiredDescriptionDefault
specPathYesPath to the spec file or page object to score, relative to project root or absolute.
projectRootNoOptional path to the project root. If omitted, auto-detected by searching for playwright.config.*.
generateHtmlReportNoSet to true to generate the standalone visual quality report at test-results/quality-report.html.

Output Schema

NameRequiredDescription
scaffoldYes
warningsYes
antiPatternsYes
fileBreakdownNo
locatorQualityYes
assertionDensityYes
qualityReportHtmlPathNo

TDQS

A3.5/5.0
Behavior3/5

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.

Conciseness4/5

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.

Completeness4/5

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.

Parameters3/5

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.

Purpose5/5

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.

Usage Guidelines2/5

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.

NameRequiredDescriptionDefault
projectRootYesAbsolute path to the target project root, e.g. "/home/user/my-app".

Output Schema

NameRequiredDescription
messageYes
projectRootYes

TDQS

A3.6/5.0
Behavior2/5

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.

Conciseness5/5

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.

Completeness4/5

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.

Parameters3/5

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.

Purpose4/5

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.

Usage Guidelines4/5

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.

  1. 8 tool updatesv0.2.0
    • First observedcheck_playwright_config
    • First observedcheck_test_prerequisites
    • First observedgenerate_test_report
    • First observedget_failure_details
    • First observedrun_playwright_test
    • First observedscaffold_test_domain
    • First observedscore_test_quality
    • First observedset_project_root

TDQS

A3.9/5.0

Scored across 8 tools

Disambiguation4/5

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.

Naming Consistency5/5

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.

Tool Count5/5

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.

Completeness4/5

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

ActivityMaintained
ResponsivenessSyncing

Related MCP Connectors

Related MCP Servers