self-healing-browser-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., "@self-healing-browser-mcpGo to https://example.com and click the 'Get Started' button."
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.
self-healing-browser-mcp
An MCP server that hands an AI agent — Claude Desktop, Claude Code, Cursor, or anything that speaks MCP — a real browser to drive, with self-healing locators.
Why
The moment you let an agent automate a browser, brittle selectors bite: a data-testid gets renamed, the DOM is restructured, a button's markup changes — and the run dies on a locator not found. Agents burn tokens retrying, or just give up.
This server takes a different contract. You describe an element by whatever you know — a test id, a role + accessible name, a label, some text, a CSS selector — and it resolves the element using the most stable strategy that still works. If your preferred locator has drifted, it heals to a fallback and tells you so, instead of failing.
Related MCP server: AgentBrowser
How the self-healing works
Each element tool accepts the same optional strategies. The resolver tries them in priority order and uses the first that matches exactly one visible element:
testid → role + name → label → placeholder → text → css → fuzzy (accessible-name match)If your first-choice strategy resolves the element, great — no heal.
If it doesn't (renamed test id, changed structure) but a later strategy does, the result is flagged
healedso you know the locator drifted and should be updated.If only a name is known and its casing/wording shifted, a final fuzzy pass matches the accessible name across interactive roles.
The agent "sees" the page semantically via browser_snapshot (roles + accessible names from the accessibility tree), not raw HTML or screenshots.
Demo
See it heal live — the same locator hint keeps working after a refactor deletes the element's data-testid (examples/self_healing_demo.py):
$ python examples/self_healing_demo.py
1) Original app — the preferred data-testid resolves the button:
-> resolved via 'testid' healed=False
2) After a refactor removed the data-testid — SAME hint, no code change:
-> resolved via 'role' healed=True
-> clicked the recovered element successfullyThe data-testid the agent learned is gone, but because the hint also carried the button's role and accessible name, the engine recovered the element, flagged the heal, and the element stayed clickable — no test edit, no agent retry loop.
Tools
Tool | What it does |
| Open a URL in the shared page |
| List interactive elements as |
| Click an element (self-healing) |
| Type into a field (self-healing) |
| Read an element's text |
| Assert an element is visible — |
| Close the browser |
The ... on element tools is the locator strategy set: testid, role, name, label, placeholder, text, css — all optional; pass as many as you know.
Install
# install straight from the repo (PyPI release coming)
pip install "git+https://github.com/RAJUSHANIGARAPU/self-healing-browser-mcp"
python -m playwright install chromiumUse it from an MCP client
Claude Code:
claude mcp add self-healing-browser -- self-healing-browser-mcpClaude Desktop / Cursor — add to the MCP servers config:
{
"mcpServers": {
"self-healing-browser": {
"command": "self-healing-browser-mcp"
}
}
}Then ask your agent to, e.g., "open example.com, snapshot the page, and click the Sign in button." When a selector has drifted, the tool result will say it healed.
Configuration
Env var | Default | Purpose |
|
| The attribute |
| (unset) | Set to |
Develop
pip install -e ".[dev]"
python -m playwright install chromium
pytestThe self-healing engine (src/self_healing_browser_mcp/engine.py) is decoupled from the MCP layer and tested deterministically against in-memory HTML — no external site, no flakiness.
Releasing
Publishing to PyPI is automated with GitHub Actions via
PyPI Trusted Publishing (OIDC) — no API
token is stored in the repo. Every push builds and twine checks the distribution in
CI, so main is always release-ready.
To cut a release:
One-time: on PyPI, create the
self-healing-browser-mcpproject's Trusted Publisher pointing at this repo, workflowpublish.yml, and environmentpypi.Bump
versioninpyproject.toml, commit, and tag (git tag v0.1.1 && git push --tags).Publish a GitHub Release for that tag — the
Publish to PyPIworkflow builds and uploads automatically. After that,pip install self-healing-browser-mcpworks.
License
MIT — see LICENSE.
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
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/RAJUSHANIGARAPU/self-healing-browser-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server