Playwright Report MCP
Playwright Report MCP
Playwright の JSON テストレポートを LLM エージェント向けのツールとして公開する MCP サーバーです。
必要条件
Python >= 3.10
uv (
brew install uvまたはcurl -LsSf https://astral.sh/uv/install.sh | sh)Node.js + npx — MCP Inspector を起動する
mcp devでのみ必要
Related MCP server: QA Copilot MCP Server
1. 依存関係のインストール
リポジトリのルートから:
uv syncこれにより .venv/ が作成され、プロジェクトが編集可能モードでインストールされます。以下のすべてのコマンドは uv run 経由で実行されるため、venv を手動でアクティベートする必要はありません。
2. Playwright の JSON レポートを生成する
サーバーは json レポーターによって生成された Playwright レポートを読み取ります。Playwright プロジェクトでは:
npx playwright test --reporter=json > results.jsonまたは playwright.config.ts に恒久的に設定してください:
export default defineConfig({
reporter: [['json', { outputFile: 'results.json' }]],
});ファイルには標準のトップレベルキー config、suites、errors、stats が含まれている必要があります。
サーバーを試してみたいだけの場合は、サンプルレポートが results.json に同梱されています。
3. レポートのパスを設定する
リポジトリのルートに、そのレポートを指す .env ファイルを作成してください (絶対パスを推奨):
REPORT_PATH=/absolute/path/to/results.json代わりに同梱のサンプルを使用する場合:
REPORT_PATH=/absolute/path/to/playwright-test-analysis-mcp/src/playwright_report_mcp/results.jsonREPORT_PATH はツール呼び出しのたびに読み取られるため、サーバーを再起動せずにレポートを再生成できます。未設定の場合、ツール呼び出しは REPORT_PATH environment variable is not set. というエラーで失敗します。
4. サーバーを実行する
インタラクティブ開発 (MCP Inspector)
uv run mcp dev src/playwright_report_mcp/server.pyブラウザで MCP Inspector を開き、ツールを手動で一覧表示して呼び出すことができます。npx が必要です。
通常の stdio サーバー
uv run playwright-report-mcpまたは、同等に:
uv run mcp run src/playwright_report_mcp/server.pystdin/stdout を介して MCP プロトコルで通信します。MCP クライアントへの接続や、簡単なスモークテストに便利です:
printf '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"t","version":"1"}}}\n' \
| uv run playwright-report-mcp"serverInfo":{"name":"Playwright Report",...} を含む JSON-RPC の結果が返ってくるはずです。
クライアントに接続する
Claude Desktop にサーバーを登録してください:
uv run mcp install src/playwright_report_mcp/server.pyまたは、MCP クライアント設定 (例: claude_desktop_config.json) に手動で追加してください:
{
"mcpServers": {
"playwright-report": {
"command": "uv",
"args": [
"--directory",
"/absolute/path/to/playwright-test-analysis-mcp",
"run",
"playwright-report-mcp"
]
}
}
}--directory が重要です: これにより uv がこのプロジェクトの venv を解決し、load_dotenv() が .env ファイルを見つけられるようになります。
ツール
ツール | 説明 |
| 最新の実行の概要: |
| 失敗したテストのリスト。各テストには |
テストの実行
pytest と pytest-asyncio はインストールされていますが、リポジトリにはまだテストファイルがないため、現在は 0 個のテストが収集されます:
uv run pytestトラブルシューティング
症状 | 修正方法 |
| リポジトリのルートに |
ツール呼び出し時の |
|
| JSON が Playwright の |
|
|
Available Tools
2 toolsget_failuresA
Return failed tests of the latest Playwright test run.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
| result | 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 conveys read-only behavior via 'Return' and adds the useful 'latest run' scope, but it does not disclose behavior such as how empty results are handled or whether failures are ordered or grouped. These gaps are minor for a simple parameterless read and are partly covered by the output schema.
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 sentence that front-loads the action and object and contains no filler. Every word contributes to selection and invocation.
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?
Given the zero-parameter complexity and the presence of an output schema, the description is nearly complete for correct tool selection and invocation. The only material gap is the lack of any interaction with the sibling get_test_summary, but that is a usage-guidance concern rather than a completeness failure for this simple read.
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?
The tool has zero parameters, so there is no parameter semantics burden for the description to carry. The baseline of 4 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 states a clear action ('Return'), a precise resource ('failed tests'), and a scoping qualifier ('latest Playwright test run'). It effectively distinguishes itself from get_test_summary by focusing on failures rather than a summary.
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 gives no explicit guidance about when to use this tool versus get_test_summary. It implies only that results are scoped to the latest run, but does not state when to prefer failures over a summary or whether get_test_summary is the alternative for successful tests.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_test_summaryA
Return summary of the latest Playwright test run.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
| flaky | Yes | |
| failed | Yes | |
| passed | Yes | |
| skipped | Yes | |
| start_time | Yes | |
| duration_ms | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the behavioral disclosure burden. The word 'Return' suggests a read-only operation, but the description does not mention what happens when no test run exists, whether the summary is limited by filters, or any side effects. This is minimally adequate but lacks richer behavioral context.
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 action ('Return') and the object ('summary') with no filler or unnecessary detail.
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 zero-parameter retrieval tool, the description is sufficiently complete: the resource is identified, the action is clear, and the presence of an output schema covers return-value details. The main gap is lack of usage guidance relative to the sibling, but that is a separate dimension.
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?
The tool has zero parameters, so the input schema is trivially complete. The description does not need to explain parameter semantics, and the baseline of 4 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 clearly states the action ('Return') and the resource ('summary of the latest Playwright test run'). It distinguishes from the sibling 'get_failures' by focusing on the overall summary rather than failures, but it does not explicitly name or contrast the sibling.
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?
There is no guidance on when to use this tool versus 'get_failures' or any other alternative. The description implies it is for retrieving a summary, but it does not state exclusion criteria, prerequisites, or when another tool would be preferable.
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.
2 tool updates
v0.1.0- First observed
get_failures - First observed
get_test_summary
TDQS
Scored across 2 tools
get_failures and get_test_summary have clearly distinct purposes: one retrieves only failed tests, the other an aggregate summary. There is no overlap or ambiguity between them.
Both tools follow a consistent get_[noun] pattern, making the naming predictable and easy to infer. The convention is uniform across the entire set.
With only two tools, the set is on the thin side and falls into the borderline range. The tools are focused and justified, but the count is minimal for a server that could reasonably include more report-oriented operations.
For a server scoped to the latest Playwright test run, get_failures and get_test_summary cover the primary reporting needs. Minor gaps exist—such as retrieving test details or run history—but they do not create dead ends for the core use case.
Maintenance
Related MCP Connectors
Direct access to Cypress tests results and accessibility reports in your AI workflow.
Approved test intent, reviewed Playwright automation and run evidence, inside your editor.
Discover Playwright workflows, start runs, and inspect results in Playrunner Cloud.
Ingest and search LogsLoom logs from coding agents.
Related MCP Servers
- AlicenseBqualityDmaintenanceSupercharges AI-assisted debugging of Playwright tests by parsing trace files to extract failures, action history, network logs, screenshots, and suggesting fixes.63 npmMIT
- AlicenseAqualityBmaintenanceEnables AI assistants to summarize Playwright test runs, identify flaky tests, heuristically triage failures, generate Playwright test stubs, and retrieve recent GitHub CI status through MCP tool calls.5MIT

failure-reportofficial
AlicenseNot gradedqualityBmaintenanceEnables querying Playwright test failure reports and execution results directly from AI assistants, allowing retrieval of test outcomes, failures, and report details.MIT- AlicenseNot gradedqualityAmaintenanceEnables coding agents to validate web pages and run repeatable JSON browser scenarios, returning pass/fail results with local Playwright evidence such as screenshots, traces, and JUnit XML.6 npm1Apache 2.0