playwright-pom-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@playwright-pom-mcp Generate a POM for https://app.example.com/checkout, name it checkout, output to ./poms"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
playwright-pom-mcp
An MCP server that generates functional Page Object Models from live Playwright accessibility snapshots. Navigate your browser to any page state — including behind a login — and get a ready-to-use .page.ts file back.
Installation
npm install -g @blastoiseomg/playwright-pom-mcp
npx playwright install chromiumChromium is required for browser capture. Run it once after installing.
Related MCP server: Fast Playwright MCP
MCP server
Claude Code
claude mcp add -e ANTHROPIC_API_KEY=sk-ant-... playwright-pom-mcp -- playwright-pom-mcpOr add manually to ~/.claude/settings.json:
{
"mcpServers": {
"playwright-pom-mcp": {
"command": "playwright-pom-mcp",
"env": {
"ANTHROPIC_API_KEY": "sk-ant-..."
}
}
}
}Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"playwright-pom-mcp": {
"command": "playwright-pom-mcp",
"env": {
"ANTHROPIC_API_KEY": "sk-ant-..."
}
}
}
}Without global install (npx)
{
"mcpServers": {
"playwright-pom-mcp": {
"command": "npx",
"args": ["-y", "@blastoiseomg/playwright-pom-mcp"],
"env": {
"ANTHROPIC_API_KEY": "sk-ant-..."
}
}
}
}Tools
Tool | Description |
| Snapshot a page and generate a new POM TypeScript file |
CLI
An interactive CLI is included alongside the MCP server. It opens a real (headed) browser, lets you navigate to any page state, and drives POM generation from your terminal.
pom-gen # fully interactive
pom-gen https://example.com -n home -o poms # with argumentsOptions
Flag | Description | Default |
| URL to open (paste in browser if omitted) |
|
| Page name | prompted |
| Output directory | prompted (default |
| Generate a class-based POM instead of factory function style | — |
Interactive menu actions
Action | Description |
Capture ARIA snapshot & generate POM | Snapshots the current page and generates (or overwrites) the |
Navigate to a different URL | Navigates the browser to a new URL and updates the page name |
Exit | Closes the browser and exits |
Environment variables
Variable | Required | Default | Description |
| Yes | — | Anthropic API key |
| No |
| Model to use for POM generation |
How it works
MCP tools:
generate_pom— launches Chromium (headless by default, headed whenwaitForUrlis set), navigates to the URL, capturespage.locator('body').ariaSnapshot(), sends the YAML to Claude with a system prompt enforcing functional POM conventions, and writes the result to disk.
CLI (pom-gen):
Runs a headed browser session you control. On startup, prompts for page name and output directory if not supplied as flags. The interactive menu lets you:
Capture — take an ARIA snapshot of the current browser state and generate a new POM
Navigate — send the browser to a new URL and optionally rename the current page
Generated POMs follow these conventions:
Factory function pattern:
createCheckoutPage(page: Page)(default)Class pattern:
CheckoutPagewithreadonlylocator properties (with--class)locatorsobject with semantic locators (getByRole,getByLabel, etc.)All action methods are
asyncand returnPromise<void>
Development
git clone https://github.com/vincenzo-gasparo/playwright-pom-mcp.git
cd playwright-pom-mcp
pnpm install
npx playwright install chromium
export ANTHROPIC_API_KEY="sk-ant-..."
pnpm buildCommand | Description |
| Compile TypeScript to |
| Run MCP server with |
| Run interactive CLI with |
| Run unit tests |
Testing with MCP Inspector
npx @modelcontextprotocol/inspector node dist/index.jsOpen http://localhost:5173, select generate_pom, and try:
{
"url": "https://playwright.dev",
"name": "home",
"outputDir": "./out"
}Available Tools
1 toolgenerate_pomGenerate POMA
Generate a functional Page Object Model TypeScript file from a live Playwright accessibility snapshot. Optionally launches a headed browser so you can log in or navigate to the desired state first.
Inputs: url (required), name (required), outputDir (required), style, +2 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 1 tool
There is only one tool, so there is no possibility of confusion or misselection. Its purpose (generate a POM TypeScript file from a live accessibility snapshot) is stated explicitly and unambiguously.
The single tool follows a clear verb_noun snake_case convention (generate_pom). With only one name there are no deviations or mixed conventions to worry about.
A one-tool server is thin even for a narrow purpose; generation is the core operation but the surface offers no supporting operations. The count is defensible for a focused generator, but it sits at the borderline of 'too few.'
The generate step is covered, but there is no way to list existing POMs, update/append methods to an existing page object, or validate regenerated files against a live snapshot. Agents can work around this by regenerating, but lifecycle coverage is partial.
Maintenance
Related MCP Connectors
Capture screenshots, detect visual regressions between page versions, and analyze with AI.
Captured web interfaces, screenshots, flows and structured evidence for AI coding agents.
Turn any webpage into a structured action manifest — clickable, fillable, submittable elements.
Hosted browser for AI agents: screenshots, post-JS DOM, console, WCAG. No install, no API key.
Related MCP Servers
- -licenseNot gradedqualityNot gradedmaintenanceEnables browser automation and web interaction through structured accessibility snapshots using Playwright. Provides fast, deterministic web page interaction without requiring screenshots or vision models.10,706,557 npm-
- AlicenseNot gradedqualityCmaintenanceEnables token-optimized browser automation with Playwright, featuring batch execution, diff detection, and advanced filtering to reduce token usage by 70-95% while providing LLM-friendly structured accessibility snapshots instead of screenshots.3,821 npm40Apache 2.0
- AlicenseAqualityNot gradedmaintenanceEnables browser automation through Playwright using accessibility tree snapshots instead of screenshots. Supports web scraping, form interactions, testing, and connecting to existing browser sessions with logged-in accounts.238,303 npm5-
- AlicenseAqualityBmaintenanceDrives a real Chromium browser to extract a page's DOM into compact Semantic JSON with Playwright-native locators, enabling AI agents to generate consistent, accurate Playwright tests.1325 npm3MIT