CDP MCP
Browser automation through Chrome DevTools Protocol. No Playwright. No Puppeteer. Just raw CDP over WebSocket.
Why
Playwright MCP runs headless — and many websites detect and block it. Chrome in Claude's computer use struggles with file uploads, making tasks like applying for jobs harder than they should be. Both are heavier and more brittle than they need to be.
CDP MCP talks directly to Chrome over DevTools Protocol, controls a real visible browser, reads the accessibility tree to discover every interactive element on the page, and verifies that interactions actually worked. More lightweight, more robust, and designed for AI agents that need to actually use the web.
Tools
How it works
The core loop is two tools: snapshot and interact.
cdp_snapshot returns the page's accessibility tree — a structured view of every interactive element, each tagged with a numbered ref:
[1] button "Sign In"
[2] textbox "Email" value=""
[3] textbox "Password" value=""
[4] checkbox "Remember me" checked=false
[5] link "Forgot password?"
cdp_interact accepts those [n] refs directly as selectors, along with CSS selectors and text= prefix matching:
cdp_interact(action="type", selector="[2]", value="[email protected]")
cdp_interact(action="click", selector="text=Sign In")
cdp_interact(action="click", selector="#submit-btn")
Interactions are verified — if a React controlled input silently rejects your value, you'll know:
{
"success": true,
"action": "type",
"expected": "[email protected]",
"actual": "[email protected]"
}
Framework handling
cdp_interact uses native property setters and dispatches the right events for React, Vue, and Angular inputs. It doesn't just set .value — it triggers the framework's internal change detection. If that fails, it falls back to CDP-level keystroke dispatch.
Installation
npm install
npm run build
Add to your MCP config:
{
"mcpServers": {
"cdp": {
"type": "stdio",
"command": "node",
"args": ["/path/to/cdp-mcp/dist/index.js"]
}
}
}
Test results
Tested against the-internet.herokuapp.com — 39 automation challenges covering forms, dynamic content, iframes, shadow DOM, drag and drop, and more. An AI agent (Claude) ran every test using only the tools above.
39/39.
Known code smells
cdp_tabsaccessesCDPClientprivate fields (port,host) viaas anycast. Works, needs proper getters.
Requirements
- Node.js 18+
- Chrome, Chromium, or Edge
Dependencies
ws— WebSocket client for CDP- That's it
License
Copyright (c) 2025 Cassius Oldenburg. All rights reserved.