locator-mcp
Click on "Install 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., "@locator-mcpscan this page and save locators"
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.
locator-mcp
MCP server for scanning browser pages and collecting element locators (XPath, testId, CSS).
Setup
npm installRelated MCP server: paparazzi
Run
# Development (TypeScript directly)
npm run dev
# Production (compile first)
npm run build
npm startTest
npm testProject structure
src/
server.ts MCP tool handlers
scanner/ Scan pipeline
shared/ Registry I/O, constants, utils
registry/ Local scan output (gitignored *.json)
tests/ Unit tests
.cursor/rules/ Cursor AI rules for this repoRegistry
Scans write to registry/{scanName}.json. Registry JSON files are not committed — generate them locally with scan_page.
MCP tools
scan_page— scan a browser page and save locatorsget_registry_keys— list keys (token-efficient)get_locator— fetch one entry by keyget_registry— full registry (high token cost)search_registry— filter entrieslist_registries— list available registries
Cursor MCP configuration
Add to ~/.cursor/mcp.json under mcpServers.
Set cwd to your local clone path. From the repo root:
pwd
# e.g. /Users/you/projects/locator-mcpUse that output for <path-to-repo> in the snippets below.
Recommended (dev — no build step)
{
"mcpServers": {
"locator-mcp": {
"command": "npm",
"args": ["run", "dev"],
"cwd": "<path-to-repo>"
}
}
}Production (compiled)
Run npm run build in the repo first, then use:
{
"mcpServers": {
"locator-mcp": {
"command": "npm",
"args": ["run", "start"],
"cwd": "<path-to-repo>"
}
}
}With Playwright MCP (for scan_page)
scan_page connects to an already-open browser. Pair with Playwright MCP on the same Chrome CDP endpoint:
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": [
"@playwright/mcp@latest",
"--cdp-endpoint",
"http://localhost:9222"
]
},
"locator-mcp": {
"command": "npm",
"args": ["run", "dev"],
"cwd": "<path-to-repo>"
}
}
}Launch Chrome with remote debugging before scanning:
open -a "Google Chrome" --args --remote-debugging-port=9222 --user-data-dir=/tmp/pw-chromeThen call scan_page with cdpEndpoint: "http://localhost:9222".
Alternative (explicit entry file)
If you prefer not to use npm scripts, set cwd and a relative args path:
{
"mcpServers": {
"locator-mcp": {
"command": "npx",
"args": ["tsx", "src/server.ts"],
"cwd": "<path-to-repo>"
}
}
}Compiled:
{
"mcpServers": {
"locator-mcp": {
"command": "node",
"args": ["dist/server.js"],
"cwd": "<path-to-repo>"
}
}
}Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Eswarr11/locator-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server