IntroducingSelectorsHub MCP Server
Give Claude, Cursor, VS Code Copilot or any AI agent the SelectorsHub engine. Ask in plain English and get Playwright locators, XPath and CSS selectors that are verified against the real page before they reach your test.
AI agents guess locators. SelectorsHub verifies them.
Most agents read the page and invent a selector that looks right. SelectorsHub MCP runs the same engine trusted by millions of testers, then checks every locator against the live page.
Verified, not guessed
Every locator is checked to resolve to the exact element you asked for. Playwright locators are verified with real Playwright.
Stable by default
Skips generated ids and hashed classes like :r3: or css-19bb58m that break on the next build.
Smart in lists & tables
For repeated cards and rows, locators are anchored to nearby unique text instead of fragile positions like [3].
Shadow DOM & iFrames
Handles the hard cases the SelectorsHub extension is known for: shadow roots, nested iframes and SVG elements.
page.locator('#mui-4821 > div:nth-child(3) button')
Depends on a generated id and position. Breaks on the next deploy.
page.locator('div.card').filter({ hasText: 'Backpack' })
.getByRole('button', { name: 'Add to cart' })
Anchored to visible text and role. Verified: matches exactly 1 element.
Up and running in 3 steps
No account, no license key, no global install. If you have Node.js, you're ready.
Check Node.js
Node.js 18 or newer. Run node -v to check.
Add it to your AI client
Copy the command or config for your tool below, then restart it.
Ask for locators
Describe what you need in plain English. The agent does the rest.
Run this in your terminal:
claude mcp add selectorshub -- npx -y selectorshub-mcpSettings → Developer → Edit Config, add this to claude_desktop_config.json, then restart Claude Desktop:
{
"mcpServers": {
"selectorshub": {
"command": "npx",
"args": ["-y", "selectorshub-mcp"]
}
}
}Add to ~/.cursor/mcp.json (or Settings → MCP → Add new server):
{
"mcpServers": {
"selectorshub": {
"command": "npx",
"args": ["-y", "selectorshub-mcp"]
}
}
}Add to .vscode/mcp.json in your project, then use it from Copilot Chat in Agent mode:
{
"servers": {
"selectorshub": {
"command": "npx",
"args": ["-y", "selectorshub-mcp"]
}
}
}Any MCP client that supports local (stdio) servers works. Use this command:
npx -y selectorshub-mcpWorks on Windows, macOS and Linux.
Just talk to your agent
No new syntax to learn. Here are a few things testers ask every day.
Open https://selectorshub.com and give me Playwright locators for the main navigation links.generate_locators
This locator broke after the last release. Find me a stable one for the same button.fix_locator
Does //button[text()='Save'] match only one element on this page?validate_locator
Create a Playwright page object for the checkout page with locators for every field.generate_page_object
List all the inputs and buttons on the signup form.list_elements
Give me XPath and CSS selectors for the "Edit" button in Ravi's row of the users table.generate_locators
SelectorsHub MCP is free for everyone at launch: every feature, no usage limits, no license key. Individual testers will always be free.
- All tools, no daily limits
- Use it at work and in CI
- No sign-up, no account
Your pages stay on your machine
SelectorsHub MCP runs locally next to your AI client. The pages it opens, the elements it inspects and the locators it generates are never sent to SelectorsHub.
The only thing we count is installs: one anonymous request when the package is installed, so we know how many people use it. Install with --ignore-scripts to skip it.
Questions testers ask
What is an MCP server?
Do I need the SelectorsHub browser extension?
Which AI tools does it work with?
Which locator types does it generate?
How is this different from asking the AI directly?
Is it really free? Can I use it at work?
Does it work with Shadow DOM and iFrames?
Where do I report a bug or request a feature?
Stop fixing flaky locators.
Let your agent get them right.
Add SelectorsHub MCP to your AI client in under a minute.