Browser DevTools MCP
raw JSON →A Model Context Protocol (MCP) server that gives AI coding assistants comprehensive browser automation and debugging capabilities, including execution-level inspection (logs, network, console messages) and visual feedback (screenshots, ARIA snapshots, PDFs). Version 0.6.9 is the current stable release; the package is actively developed on GitHub. Supports both Browser (Playwright) and Node.js (Inspector Protocol) platforms with session management, design comparison (Figma), OpenTelemetry integration, and multiple transport modes (stdio, HTTP). Differentiates from generic browser automation tools by focusing on AI agent integration via MCP, providing structured debugging tools (tracepoints, logpoints) and visual snapshots for LLM-based workflows.
Common errors
error Error: Cannot find module 'browser-devtools-mcp' ↓
error TypeError: platform.getTools is not a function ↓
error Error: Connection refused to Chrome DevTools Protocol endpoint ↓
Warnings
gotcha Closed browser tab invalidates element references: after a tab is closed, previous element handles (from screenshots/snapshots) become stale. New tool calls will open a fresh tab, but all prior references must be re-fetched. ↓
gotcha Session network-idle state resets on new tab: in-flight request tracking and network idle detection are reset when a tab is reopened. Long-running network operations may cause unexpected timeouts. ↓
deprecated Node platform connection via process name (e.g., '--name myapp') is deprecated. Use PID, port, or WebSocket URL instead. ↓
breaking v0.6.0 changed the signature of runServer() – first argument is now a options object ({ platform, transport, sessionTimeout }) instead of separate parameters. ↓
Install
npm install browser-devtools-mcp yarn add browser-devtools-mcp pnpm add browser-devtools-mcp Imports
- runServer wrong
const runServer = require('browser-devtools-mcp')correctimport { runServer } from 'browser-devtools-mcp' - createBrowserSession wrong
import { createBrowserSession } from 'browser-devtools-mcp'correctimport { createBrowserSession } from 'browser-devtools-mcp/session' - BrowserTool wrong
import { BrowserTool } from 'browser-devtools-mcp'correctimport { BrowserTool } from 'browser-devtools-mcp/tools'
Quickstart
// Quickstart: run MCP server for Browser platform with stdio transport
import { runServer } from 'browser-devtools-mcp';
import { BrowserPlatform } from 'browser-devtools-mcp/platforms/browser';
const platform = new BrowserPlatform({
headless: true,
defaultViewport: { width: 1280, height: 720 },
});
runServer({
platform,
transport: 'stdio',
sessionTimeout: 300000,
}).catch(console.error);