DevTools Lens MCP
Click on "Deploy 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., "@DevTools Lens MCP why did the login request return a 401 error?"
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.
DevTools Lens MCP
Give your AI agent Chrome DevTools.
DevTools Lens MCP is a production-oriented Model Context Protocol server that lets Claude, Codex, and other MCP clients inspect and control a live Chromium browser. It is built for frontend debugging—not just browser automation.
Ask an agent why a login request failed, which exception broke a click handler, what changed in the DOM after submit, or whether the current page has accessibility problems. The server combines Playwright's reliable lifecycle and interaction layer with direct Chrome DevTools Protocol diagnostics.
Why this exists
Browser automation tools can click and type, but debugging needs evidence: buffered console history, request/response details, stack traces, DOM state, computed styles, accessibility metadata, and before/after changes. DevTools Lens MCP exposes that evidence as focused, schema-validated tools that an AI agent can reason over.
Related MCP server: Chrome DevTools MCP
Highlights
19 purpose-built debugging tools over MCP stdio
Multiple isolated browser sessions with optional single-session shorthand
CDP-native console, exception, and network event collection
Grouped console errors with likely categories
Failed-request detection for HTTP, DNS, timeout, refused, CORS, and aborted requests
Bounded textual response-body inspection and default credential redaction
Compact DOM snapshots, element styles/layout, and structural DOM diffing
Click impact capture: DOM, console, network, and URL before/after evidence
Page and element screenshots written to a controlled output directory
axe-core accessibility analysis
Strict TypeScript, Zod inputs, Vitest coverage, Docker, and CI
Architecture
flowchart LR
Client[Claude / Codex / MCP client] -->|MCP stdio| Server[MCP tool registry]
Server --> Schemas[Zod validation + structured errors]
Server --> Manager[BrowserManager]
Manager --> S1[BrowserSession A]
Manager --> S2[BrowserSession B]
S1 --> PW[Playwright lifecycle + interactions]
S1 --> CDP[Chrome DevTools Protocol]
CDP --> Console[Console ring buffer]
CDP --> Network[Network ring buffer]
Server --> Services[DOM / console / network / a11y / screenshot services]
Services --> S1Each session owns one Chromium page, one CDP session, independent console/network buffers, active requests, and lifecycle timestamps. The transport is isolated in the server entry point so HTTP transports can be added later without rewriting browser services.
Five-minute setup
Requirements: Node.js 20.19+ and npm.
npm install -g devtools-lens-mcp
npx playwright install chromium
devtools-lens-mcpFor one-command client usage, configure the client to run:
npx -y devtools-lens-mcpWhen developing from source:
git clone https://github.com/aakcay5656/devtools-lens-mcp.git
cd devtools-lens-mcp
npm install
npx playwright install chromium
npm run build
npm startMCP client configuration
Claude Desktop
Add this server to the mcpServers object in Claude Desktop's configuration:
{
"mcpServers": {
"devtools-lens": {
"command": "npx",
"args": ["-y", "devtools-lens-mcp"]
}
}
}Restart Claude Desktop after saving the file.
Codex CLI or IDE extension
The CLI and IDE extension share MCP configuration. Add the server with:
codex mcp add devtools-lens -- npx -y devtools-lens-mcpOr add it manually to ~/.codex/config.toml:
[mcp_servers.devtools-lens]
command = "npx"
args = ["-y", "devtools-lens-mcp"]
startup_timeout_sec = 30
tool_timeout_sec = 120Tools
Tool | Purpose |
| Launch Chromium with URL, viewport, and headless options |
| Connect to an existing CDP remote-debugging endpoint |
| Navigate and wait for a lifecycle state |
| Get URL, title, viewport, UA, loading state, and DOM/resource counts |
| Filter buffered console history |
| Group errors/exceptions and classify likely causes |
| Filter complete session request history |
| Explain HTTP and transport failures |
| Get headers, payload, initiator, timing, and bounded text body |
| Get layout, visibility, styles, accessible identity, and selector |
| Capture a compact, depth-limited DOM model |
| Click and optionally capture diagnostic changes |
| Fill editable elements with password-safe results |
| Select an option by value, label, or index |
| Press keys or chords on a target or page |
| Save page or element screenshots |
| Run axe-core and return actionable findings |
| Compare snapshots by additions/removals/text/attributes/visibility |
| Safely close a session |
All browser-facing tools accept sessionId. It may be omitted when exactly one session exists. Ambiguous and invalid sessions return structured errors with available session IDs.
Example workflow
Ask the client to call
browser_launchwith{ "headless": true, "url": "https://example.com" }.Call
browser_get_console_errorsandbrowser_get_failed_requeststo establish a baseline.Call
browser_clickwith{ "selector": "button[type=submit]", "captureChanges": true }.Inspect new requests with
browser_get_request_detailsand the DOM diff from the click result.Call
browser_closewhen finished.
Prompts to try
“Find all console errors on this page and explain their likely causes.”
“Click the login button and analyze what fails.”
“Inspect failed API requests and suggest a fix.”
“Compare the page before and after submitting this form.”
“Find accessibility issues in the current page.”
“Inspect the styling and accessibility properties of the submit button.”
Configuration
Environment variable | Default | Meaning |
|
| Only directory used for screenshots |
|
| Console buffer capacity per session |
|
| Network buffer capacity per session |
|
| Maximum returned response-body bytes |
Security
Treat the browser and every page it opens as untrusted.
authorization,cookie,set-cookie,x-api-key, andproxy-authorizationheaders are masked by default.Password inputs are never returned by fill results or DOM snapshot value attributes.
Binary response bodies are not returned; textual bodies are byte-limited.
Screenshots can only be written under the configured output directory.
The server exposes no arbitrary shell command or general-purpose JavaScript evaluation tool.
Localhost and private-network navigation are not blocked. This is intentional for local frontend debugging, but it makes SSRF-style access possible when an agent follows untrusted instructions. Run the server with only the network access it needs.
Never attach this server to a trusted personal browser profile. Use a fresh, disposable debugging profile with no saved credentials, cookies, extensions, or open authenticated tabs.
Response bodies and page text may themselves contain secrets. Review outputs before sharing them.
Connecting by remote debugging endpoint grants powerful control over that browser. Bind debugging ports to loopback and do not expose them publicly.
For untrusted targets, prefer the Docker image with a restricted network policy and disposable filesystem. Report vulnerabilities privately according to SECURITY.md.
Development
npm run dev
npm run typecheck
npm run lint
npm run test:unit
npm run test:integration
npm run test
npm run build
npm run formatIntegration tests start a local fixture and a real headless Chromium instance. Install the browser once with npx playwright install chromium.
Docker
docker build -t devtools-lens-mcp .
docker run --rm -i -v "$PWD/output:/app/output" devtools-lens-mcpThe image is designed for MCP stdio (-i is required). See docker-compose.yml for a minimal example.
Roadmap
React component tree, props, and state inspection
Redux and Zustand state inspection
Vue component inspection
Performance trace analysis and Lighthouse integration
CSS and JavaScript coverage
Source-map-aware source navigation
Breakpoints, step debugging, and WebSocket inspection
IndexedDB, localStorage, sessionStorage, and cookie editing
Mobile device emulation and multi-tab support
Browser recording and replay
AI-driven automatic root-cause analysis
Contributing
Issues and pull requests are welcome. Read CONTRIBUTING.md, keep tools narrowly focused on frontend diagnosis, add Zod validation for inputs, and include unit or Chromium integration coverage for behavior changes.
License
MIT © DevTools Lens MCP contributors.
Available Tools
19 toolsbrowser_clickB
Click an element and optionally capture resulting DOM, console, network, and URL changes.
Inputs: selector (required), timeout, sessionId, captureChanges, +1 more.
browser_closeB
Safely close a browser session.
Inputs: sessionId.
browser_compare_domC
Compare two compact DOM snapshots.
Inputs: after (required), before (required).
browser_connectB
Connect to an existing Chromium remote-debugging endpoint.
Inputs: endpointUrl, debuggingPort.
browser_fillB
Fill an input, textarea, or contenteditable element without exposing passwords.
Inputs: value (required), selector (required), sessionId, clearExisting, +1 more.
browser_get_accessibility_issuesB
Run axe-core accessibility checks and return actionable issues.
Inputs: sessionId.
browser_get_console_errorsB
Return grouped console errors and uncaught exceptions with likely categories.
Inputs: limit, sessionId.
browser_get_console_logsB
Query buffered console messages from the entire browser session.
Inputs: level, limit, search, sessionId, +1 more.
browser_get_dom_snapshotC
Capture a compact agent-friendly DOM snapshot.
Inputs: maxDepth, selector, sessionId, includeText, +1 more.
browser_get_failed_requestsB
Return failed HTTP and transport requests with likely causes.
Inputs: limit, sessionId.
browser_get_network_requestsC
Query buffered network request history with diagnostic filters.
Inputs: limit, method, search, status, +3 more.
browser_get_page_infoB
Return page URL, viewport, loading state, and resource counts.
Inputs: sessionId.
browser_get_request_detailsC
Inspect one request, including a bounded textual response body when available.
Inputs: requestId (required), sessionId, includeResponseBody.
browser_inspect_elementB
Inspect an element, its layout, computed styles, and accessible identity.
Inputs: selector (required), sessionId, includeStyles, includeAncestors, +1 more.
browser_launchC
Launch a new Chromium instance and start collecting DevTools events.
Inputs: url, headless, viewportWidth, viewportHeight.
browser_press_keyB
Press a keyboard key or chord on the page or a selected element.
Inputs: key (required), selector, sessionId.
browser_screenshotA
Capture a page or element screenshot in the controlled output directory.
Inputs: format, quality, fullPage, selector, +1 more.
browser_selectC
Select an option by value, label, or index.
Inputs: selector (required), index, label, value, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 19 tools
Most tools have clearly distinct purposes, though some overlap exists between related inspection tools (e.g., get_dom_snapshot vs inspect_element, get_network_requests vs get_failed_requests vs get_request_details). Descriptions adequately distinguish them, but an agent might occasionally hesitate when choosing between similar-sounding network or DOM tools.
All tools follow a consistent snake_case pattern with the 'browser_' prefix, and the verb-noun structure is uniform (get_*, click, fill, select, press_key, launch, connect, navigate, screenshot, compare_dom, close). This makes the tool set highly predictable and easy to navigate.
With 19 tools, the server is on the heavier side, bordering on the 16-25 range that feels dense. However, each tool addresses a specific DevTools need, so the count is justifiable, but it still feels a bit large for a focused lens. Streamlining could help.
The tool set covers a broad range of browser automation and DevTools activities including navigation, interaction, DOM inspection, network and console diagnostics, screenshots, accessibility, and session management. Minor gaps exist such as no explicit browser history navigation or JavaScript evaluation, but the core workflows are well supported.
Maintenance
Related MCP Connectors
Live browser debugging for AI assistants — DOM, console, network via MCP.
Control a real browser from AI agents: navigate, click, type, screenshot, read the page.
Give AI agents a real cloud Chrome: open sessions, navigate, read pages, click, type and screenshot.
Hosted browser for AI agents: screenshots, post-JS DOM, console, WCAG. No install, no API key.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceEnables AI coding assistants to control and inspect a live Chrome browser through Chrome DevTools. Provides browser automation, performance analysis, debugging capabilities, and network request monitoring.2,036,574 npm59,001Apache 2.0
- -licenseNot gradedqualityNot gradedmaintenanceEnables AI coding assistants to control and inspect a live Chrome browser for automated debugging, performance analysis, and web interaction. It leverages Puppeteer and Chrome DevTools to provide capabilities like network monitoring, console logging, and automated browser actions.-
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to control and inspect a live Chrome browser for automated web debugging, performance analysis, and Lighthouse audits. It allows agents to capture screenshots, monitor network requests, and measure Core Web Vitals using plain-English prompts.Apache 2.0
- AlicenseNot gradedqualityDmaintenanceLets AI coding assistants control and inspect a live Chrome browser using full Chrome DevTools capabilities for browser automation, debugging, and performance analysis.Apache 2.0