npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@blastoiseomg/playwright-pom-mcp

v1.0.1

Published

MCP server and CLI that generates functional Page Object Models from live Playwright accessibility snapshots

Readme

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 chromium

Chromium is required for browser capture. Run it once after installing.

MCP server

Claude Code

claude mcp add -e ANTHROPIC_API_KEY=sk-ant-... playwright-pom-mcp -- playwright-pom-mcp

Or 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 | |---|---| | generate_pom | 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 arguments

Options

| Flag | Description | Default | |---|---|---| | [url] | URL to open (paste in browser if omitted) | about:blank | | -n, --name <name> | Page name | prompted | | -o, --output <dir> | Output directory | prompted (default poms) | | --class | 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 .page.ts file | | 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 | |---|---|---|---| | ANTHROPIC_API_KEY | Yes | — | Anthropic API key | | ANTHROPIC_MODEL | No | claude-sonnet-4-6 | Model to use for POM generation |

How it works

MCP tools:

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

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: CheckoutPage with readonly locator properties (with --class)
  • locators object with semantic locators (getByRole, getByLabel, etc.)
  • All action methods are async and return Promise<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 build

| Command | Description | |---|---| | pnpm build | Compile TypeScript to dist/ | | pnpm dev | Run MCP server with tsx (no build needed) | | pnpm dev:cli | Run interactive CLI with tsx (no build needed) | | pnpm test | Run unit tests |

Testing with MCP Inspector

npx @modelcontextprotocol/inspector node dist/index.js

Open http://localhost:5173, select generate_pom, and try:

{
  "url": "https://playwright.dev",
  "name": "home",
  "outputDir": "./out"
}