An MCP server for browser automation with persistent Playwright sessions. Originally based on SawyerHood/dev-browser.
Unlike standard Playwright MCP servers that create fresh browser instances, open-dev-browser maintains persistent browser state across tool calls. Pages stay alive, sessions persist, and you can iteratively explore and interact without starting over.
The package metadata is aligned to open-dev-browser, but until it is published on npm the safest setup is to run it from a local checkout.
- Clone the repository somewhere on your machine.
- Run
npm install && npm run buildin the repo root. - Point your MCP client at the built
dist/index.jsentrypoint.
Add to your opencode.json or ~/.config/opencode/config.json:
{
"mcp": {
"dev-browser": {
"type": "local",
"command": ["node", "/absolute/path/to/open-dev-browser/dist/index.js"],
"enabled": true
}
}
}Add to claude_desktop_config.json:
{
"mcpServers": {
"dev-browser": {
"command": "node",
"args": ["/absolute/path/to/open-dev-browser/dist/index.js"]
}
}
}DEV_BROWSER_PORT- HTTP API port (default: 9222)DEV_BROWSER_HEADLESS- Run headless (default: false)DEV_BROWSER_PROFILE_DIR- Base directory for the persistent browser profile; the server stores browser data in abrowser-data/subdirectory there (defaults to.browser-datain the current working directory)
| Tool | Description |
|---|---|
browser_navigate |
Navigate to a URL |
browser_snapshot |
Get AI-friendly DOM snapshot with element refs |
browser_click |
Click element by ref |
browser_type |
Type text into element |
browser_screenshot |
Take screenshot |
browser_scroll |
Scroll page |
browser_run_script |
Run arbitrary JavaScript against the current Playwright page |
browser_list_pages |
List open pages |
browser_close_page |
Close a page |
npm install
npm run verify
npm run auditAsk your AI to interact with your browser:
- "Navigate to localhost:3000 and test the login flow"
- "Take a snapshot of the page and click the submit button"
- "Fill out the contact form and submit it"
For lower-level automation, browser_run_script executes JavaScript with the current Playwright page object as its only argument.
Based on dev-browser by Sawyer Hood.
MIT