{"_id":"@blastoiseomg/playwright-pom-mcp","_rev":"2-7ce1db9a6eabfdba90f5383413f713af","name":"@blastoiseomg/playwright-pom-mcp","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@blastoiseomg/playwright-pom-mcp","version":"1.0.0","_id":"@blastoiseomg/playwright-pom-mcp@1.0.0","maintainers":[{"name":"blastoiseomg","email":"vincenzo.gasparo@gmail.com"}],"homepage":"https://github.com/vincenzo-gasparo/playwright-pom-mcp#readme","bugs":{"url":"https://github.com/vincenzo-gasparo/playwright-pom-mcp/issues"},"bin":{"pom-gen":"dist/cli.js","playwright-pom-mcp":"dist/index.js"},"dist":{"shasum":"2cb2e000b4ee590939f35d6f862d0ea83feefcc9","tarball":"https://registry.npmjs.org/@blastoiseomg/playwright-pom-mcp/-/playwright-pom-mcp-1.0.0.tgz","fileCount":26,"integrity":"sha512-eI0WDBh9/euYlsiKLiHAvvyrfKr6si23uaejDQZ9L3mqX7fMIgNc/0MJoW12QNWxlkuZjtVX6k6U4++/ZqVDRQ==","signatures":[{"sig":"MEUCIDJYTRXzniWRGvxm9SIUv9a6lQViwo7AlQEDFMNM4LBEAiEAngnjQL+o+V3syiOV/1gsO0aHMpEQnNhFdHMNmlLw19w=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":38484},"type":"module","engines":{"node":">=20"},"gitHead":"3d4d474c72cb846b7b490653abca8de16171a1b3","scripts":{"dev":"tsx src/index.ts","lint":"biome lint .","test":"vitest run","build":"tsc","check":"biome check .","start":"node dist/index.js","format":"biome format --write .","dev:cli":"tsx src/cli.ts","prepare":"husky","check:fix":"biome check --write .","start:cli":"node dist/cli.js","test:watch":"vitest"},"_npmUser":{"name":"blastoiseomg","email":"vincenzo.gasparo@gmail.com"},"repository":{"url":"git+https://github.com/vincenzo-gasparo/playwright-pom-mcp.git","type":"git"},"_npmVersion":"10.9.4","description":"MCP server and CLI that generates functional Page Object Models from live Playwright accessibility snapshots","directories":{},"_nodeVersion":"22.22.0","dependencies":{"zod":"^4.3.6","js-yaml":"^4.1.1","commander":"^14.0.3","playwright":"^1.58.2","@anthropic-ai/sdk":"^0.78.0","@inquirer/prompts":"^8.3.0","@modelcontextprotocol/sdk":"^1.27.1"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.21.0","husky":"^9.1.7","vitest":"^3.0.0","typescript":"^5.9.3","@types/node":"^22.0.0","@biomejs/biome":"^2.4.5","@types/js-yaml":"^4.0.9","@commitlint/cli":"^19.6.1","semantic-release":"^25.0.3","@semantic-release/git":"^10.0.1","@semantic-release/changelog":"^6.0.3","@commitlint/config-conventional":"^19.6.0"},"_npmOperationalInternal":{"tmp":"tmp/playwright-pom-mcp_1.0.0_1772712860427_0.25830072588777675","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@blastoiseomg/playwright-pom-mcp","version":"1.0.1","description":"MCP server and CLI that generates functional Page Object Models from live Playwright accessibility snapshots","license":"MIT","repository":{"type":"git","url":"git+https://github.com/vincenzo-gasparo/playwright-pom-mcp.git"},"type":"module","bin":{"playwright-pom-mcp":"dist/index.js","pom-gen":"dist/cli.js"},"engines":{"node":">=20"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"scripts":{"build":"tsc","dev":"tsx src/index.ts","dev:cli":"tsx src/cli.ts","start":"node dist/index.js","start:cli":"node dist/cli.js","test":"vitest run","test:watch":"vitest","lint":"biome lint .","format":"biome format --write .","check":"biome check .","check:fix":"biome check --write .","prepare":"husky"},"dependencies":{"@anthropic-ai/sdk":"^0.78.0","@inquirer/prompts":"^8.3.0","@modelcontextprotocol/sdk":"^1.27.1","commander":"^14.0.3","js-yaml":"^4.1.1","playwright":"^1.58.2","zod":"^4.3.6"},"devDependencies":{"@biomejs/biome":"^2.4.5","@commitlint/cli":"^19.6.1","@commitlint/config-conventional":"^19.6.0","@semantic-release/changelog":"^6.0.3","husky":"^9.1.7","@semantic-release/git":"^10.0.1","@types/js-yaml":"^4.0.9","@types/node":"^22.0.0","semantic-release":"^25.0.3","tsx":"^4.21.0","typescript":"^5.9.3","vitest":"^3.0.0"},"_id":"@blastoiseomg/playwright-pom-mcp@1.0.1","gitHead":"ca80e92b1c340073f23174af644058d80730561e","bugs":{"url":"https://github.com/vincenzo-gasparo/playwright-pom-mcp/issues"},"homepage":"https://github.com/vincenzo-gasparo/playwright-pom-mcp#readme","_nodeVersion":"22.22.0","_npmVersion":"10.9.4","dist":{"integrity":"sha512-Z378UaGnR3Wx5NotwI9JjfUJePVqoro+MiA47ahakR9apfaO1EbrT9ww2VC1wJWes9EQydEUEe9gtlAo8tlYOQ==","shasum":"3de3820446b138a20dfac53d9304537641d45bb9","tarball":"https://registry.npmjs.org/@blastoiseomg/playwright-pom-mcp/-/playwright-pom-mcp-1.0.1.tgz","fileCount":27,"unpackedSize":37565,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDc9JGAweB5fqtU5MxjiKyut5/vzwwO07IXAleL8uS2FwIhALyjtVz7Qkr19XyHN2bSU0px0NWf/DtnqtjhfcTB95BM"}]},"_npmUser":{"name":"blastoiseomg","email":"vincenzo.gasparo@gmail.com"},"directories":{},"maintainers":[{"name":"blastoiseomg","email":"vincenzo.gasparo@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/playwright-pom-mcp_1.0.1_1772786447305_0.9883053583409833"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-05T12:14:20.312Z","modified":"2026-03-06T08:40:47.577Z","1.0.0":"2026-03-05T12:14:20.570Z","1.0.1":"2026-03-06T08:40:47.464Z"},"bugs":{"url":"https://github.com/vincenzo-gasparo/playwright-pom-mcp/issues"},"homepage":"https://github.com/vincenzo-gasparo/playwright-pom-mcp#readme","repository":{"type":"git","url":"git+https://github.com/vincenzo-gasparo/playwright-pom-mcp.git"},"description":"MCP server and CLI that generates functional Page Object Models from live Playwright accessibility snapshots","maintainers":[{"name":"blastoiseomg","email":"vincenzo.gasparo@gmail.com"}],"readme":"# playwright-pom-mcp\n\nAn MCP server that generates functional [Page Object Models](https://playwright.dev/docs/pom) 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.\n\n## Installation\n\n```sh\nnpm install -g @blastoiseomg/playwright-pom-mcp\nnpx playwright install chromium\n```\n\n> Chromium is required for browser capture. Run it once after installing.\n\n## MCP server\n\n### Claude Code\n\n```sh\nclaude mcp add -e ANTHROPIC_API_KEY=sk-ant-... playwright-pom-mcp -- playwright-pom-mcp\n```\n\nOr add manually to `~/.claude/settings.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"playwright-pom-mcp\": {\n      \"command\": \"playwright-pom-mcp\",\n      \"env\": {\n        \"ANTHROPIC_API_KEY\": \"sk-ant-...\"\n      }\n    }\n  }\n}\n```\n\n### Claude Desktop\n\nAdd to `~/Library/Application Support/Claude/claude_desktop_config.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"playwright-pom-mcp\": {\n      \"command\": \"playwright-pom-mcp\",\n      \"env\": {\n        \"ANTHROPIC_API_KEY\": \"sk-ant-...\"\n      }\n    }\n  }\n}\n```\n\n### Without global install (npx)\n\n```json\n{\n  \"mcpServers\": {\n    \"playwright-pom-mcp\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@blastoiseomg/playwright-pom-mcp\"],\n      \"env\": {\n        \"ANTHROPIC_API_KEY\": \"sk-ant-...\"\n      }\n    }\n  }\n}\n```\n\n## Tools\n\n| Tool | Description |\n|---|---|\n| `generate_pom` | Snapshot a page and generate a new POM TypeScript file |\n\n## CLI\n\nAn 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.\n\n```sh\npom-gen                                      # fully interactive\npom-gen https://example.com -n home -o poms  # with arguments\n```\n\n**Options**\n\n| Flag | Description | Default |\n|---|---|---|\n| `[url]` | URL to open (paste in browser if omitted) | `about:blank` |\n| `-n, --name <name>` | Page name | prompted |\n| `-o, --output <dir>` | Output directory | prompted (default `poms`) |\n| `--class` | Generate a class-based POM instead of factory function style | — |\n\n**Interactive menu actions**\n\n| Action | Description |\n|---|---|\n| Capture ARIA snapshot & generate POM | Snapshots the current page and generates (or overwrites) the `.page.ts` file |\n| Navigate to a different URL | Navigates the browser to a new URL and updates the page name |\n| Exit | Closes the browser and exits |\n\n## Environment variables\n\n| Variable | Required | Default | Description |\n|---|---|---|---|\n| `ANTHROPIC_API_KEY` | Yes | — | Anthropic API key |\n| `ANTHROPIC_MODEL` | No | `claude-sonnet-4-6` | Model to use for POM generation |\n\n## How it works\n\n**MCP tools:**\n\n1. **`generate_pom`** — launches Chromium (headless by default, headed when `waitForUrl` is set), navigates to the URL, captures `page.locator('body').ariaSnapshot()`, sends the YAML to Claude with a system prompt enforcing functional POM conventions, and writes the result to disk.\n\n**CLI (`pom-gen`):**\n\nRuns 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:\n- **Capture** — take an ARIA snapshot of the current browser state and generate a new POM\n- **Navigate** — send the browser to a new URL and optionally rename the current page\n\nGenerated POMs follow these conventions:\n- Factory function pattern: `createCheckoutPage(page: Page)` (default)\n- Class pattern: `CheckoutPage` with `readonly` locator properties (with `--class`)\n- `locators` object with semantic locators (`getByRole`, `getByLabel`, etc.)\n- All action methods are `async` and return `Promise<void>`\n\n## Development\n\n```sh\ngit clone https://github.com/vincenzo-gasparo/playwright-pom-mcp.git\ncd playwright-pom-mcp\npnpm install\nnpx playwright install chromium\nexport ANTHROPIC_API_KEY=\"sk-ant-...\"\npnpm build\n```\n\n| Command | Description |\n|---|---|\n| `pnpm build` | Compile TypeScript to `dist/` |\n| `pnpm dev` | Run MCP server with `tsx` (no build needed) |\n| `pnpm dev:cli` | Run interactive CLI with `tsx` (no build needed) |\n| `pnpm test` | Run unit tests |\n\n### Testing with MCP Inspector\n\n```sh\nnpx @modelcontextprotocol/inspector node dist/index.js\n```\n\nOpen `http://localhost:5173`, select `generate_pom`, and try:\n\n```json\n{\n  \"url\": \"https://playwright.dev\",\n  \"name\": \"home\",\n  \"outputDir\": \"./out\"\n}\n```\n","readmeFilename":"README.md","license":"MIT"}