# playwrightselectorguard-mcp

Evaluates Playwright selector risks, provides automated healing recommendations, and tracks approval receipts. Helpful for stabilizing flaky browser tests.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI
- Author: clauxel
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/clauxel/playwright-selector-guard-mcp
- Updated: 2026-05-19
- HTML: https://affpapa.org/en/nevibecode/mcp/playwrightselectorguard-mcp

## What it does

This MCP server links an assistant to an external service dedicated to Playwright selector inspection. It exposes tools including `check_selector_risk` to spot fragile locators and `suggest_selector_healing` to formulate safer replacements.

Workflow management includes `request_human_approval` for operator sign-offs, `record_action_receipt` to log execution confirmations, and `export_selector_failure` for debugging broken locators. The endpoint operates over HTTP using Streamable HTTP transport.

Access requires a paid account. Production calls fail with an authorization error unless sent with an API bearer token generated from the product website.

## Requirements
- Remote server: `https://playwrightselectorguard.clauxel.com/mcp`
- Works with: Playwright

## Install

### Claude Code (native platform)

**Platform CLI: remote server**
```bash
claude mcp add --transport http playwrightselectorguard-mcp https://playwrightselectorguard.clauxel.com/mcp
```

### Codex

**Platform CLI: remote server**
```bash
codex mcp add playwrightselectorguard-mcp --url https://playwrightselectorguard.clauxel.com/mcp
```

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "playwrightselectorguard-mcp": {
            "url": "https://playwrightselectorguard.clauxel.com/mcp"
        }
    }
}
```

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "playwrightselectorguard-mcp": {
            "type": "http",
            "url": "https://playwrightselectorguard.clauxel.com/mcp"
        }
    }
}
```

### Gemini CLI

**Platform CLI: remote server**
```bash
gemini mcp add -t http playwrightselectorguard-mcp https://playwrightselectorguard.clauxel.com/mcp
```

## When to use it
- detect fragile Playwright locators before test execution
- generate resilient replacement selectors for broken elements
- request human operator approval prior to browser actions
- export diagnostics for failed selector evaluations

## Example prompts
- Inspect selectors in `tests/checkout.spec.ts` using `check_selector_risk`
- Find a replacement for the broken locator `div > button.primary`
- Export details for the failed element using `export_selector_failure`

## Similar
- [selector-drift-recovery](https://affpapa.org/en/nevibecode/skills/selector-drift-recovery.md) — skill · 1000 installs
- [playwright-in-sandbox](https://affpapa.org/en/nevibecode/skills/playwright-in-sandbox.md) — skill · 508 installs
- [playwright-generate-test](https://affpapa.org/en/nevibecode/skills/playwright-generate-test.md) — skill · 18162 installs
- [playwright-explore-website](https://affpapa.org/en/nevibecode/skills/playwright-explore-website.md) — skill · 14792 installs
- [playwright-dev](https://affpapa.org/en/nevibecode/skills/playwright-dev.md) — skill · 3700 installs
- [om-prepare-test-env](https://affpapa.org/en/nevibecode/skills/om-prepare-test-env.md) — skill · 2900 installs

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
