Registry / llm-agents / browser-devtools-mcp

browser-devtools-mcp

JSON →
library0.6.9jsnpmunverified

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.

npm install browser-devtools-mcp
INSTALL
IMPORT
SIG · BROWSER-DEVTOOLS-M
B
browser-devtools-mcp
llm-agentsjavascriptv0.6.9
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

runServer
import { runServer } from 'browser-devtools-mcp'
const runServer = require('browser-devtools-mcp')
Package is ESM-only (type: module). runServer is the main entry point for programmatic usage.
createBrowserSession
import { createBrowserSession } from 'browser-devtools-mcp/session'
import { createBrowserSession } from 'browser-devtools-mcp'
Session functions are exported from a subpath: 'browser-devtools-mcp/session'.
BrowserTool
import { BrowserTool } from 'browser-devtools-mcp/tools'
import { BrowserTool } from 'browser-devtools-mcp'
Tool classes are exported from subpaths like 'browser-devtools-mcp/tools' or 'browser-devtools-mcp/node-tools'.

Shows programmatic instantiation of the Browser Platform and running the MCP server via runServer().

// 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);
browser-devtools-mcp --version
Debug
Known issues
gotchaClosed 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.
fix
After tab closure, take a new snapshot (e.g., takeScreenshot) before using any element references.
affects: >=0.0.1
gotchaSession 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.
fix
Re-evaluate network state after tab recovery; avoid assumptions about pending requests.
affects: >=0.0.1
deprecatedNode platform connection via process name (e.g., '--name myapp') is deprecated. Use PID, port, or WebSocket URL instead.
fix
Use --pid <PID> or --port <PORT> flags instead of --name.
affects: >=0.4.0
breakingv0.6.0 changed the signature of runServer() – first argument is now a options object ({ platform, transport, sessionTimeout }) instead of separate parameters.
fix
Update calls to runServer({ platform, transport: 'stdio', sessionTimeout: 300000 }).
affects: >=0.6.0 <0.7.0
Errors
Common errors & fixes
Error: Cannot find module 'browser-devtools-mcp'
Package not installed or not resolved due to ESM/CJS mismatch
fix
npm install browser-devtools-mcp --save. Ensure project uses ESM (type: module in package.json) or use dynamic import if using CJS.
TypeError: platform.getTools is not a function
Platform instance not properly instantiated or wrong class imported
fix
Ensure you import the platform class from the correct subpath, e.g., import { BrowserPlatform } from 'browser-devtools-mcp/platforms/browser'.
Error: Connection refused to Chrome DevTools Protocol endpoint
Chrome/Chromium is not running or the debug port is not accessible
fix
For Node platform, start Node with --inspect flag. For browser platform, ensure Playwright browsers are installed: npx playwright install.
Upgrade
Version history
0.6.9latest on npm
Audit
Dependencies
@modelcontextprotocol/sdkrequiredCore MCP protocol implementation for server/client communication
playwrightrequiredBrowser automation engine for the browser platform
chrome-launcheroptionalLaunches Chrome/Chromium for Node.js Inspector Protocol debugging
dockerodeoptionalInteracts with Docker containers for Node.js process debugging
Agent activity
25 hits · last 30 days
node
24
OpenAI (training)
1
Resources
browser-devtools-mcp — npm install browser-devtools-mcp · libregistry