Labsco
MCP SERVER

Firefox DevTools MCP

by mozilla

Drive a real Firefox by stable element UIDs, then read the browser's own stdout, MOZ_LOG lines and crash traces from the same server that did the clicking.

Browser Automation, Control & ScreenshotsVerified
Summary
The console output and the click that caused it come from one place.

get_firefox_output is the part a page-level automation tool cannot give you: MOZ_LOG lines, warnings, crashes and stack traces straight from the browser process, filtered by grep, line count or time. Interaction is UID-based rather than selector-based, so a snapshot has to be retaken after navigation and a stale UID fails loudly instead of clicking the wrong element. Two settings decide how much room the agent has: the preset that chooses its tools, and --connect-existing, which attaches to your real signed-in Firefox and needs Marionette turned on — worth turning off again afterwards, since it changes the browser's fingerprint enough to trip bot detection.

What it is

Mozilla's Firefox automation server, driving the browser over WebDriver BiDi: tabs, DOM snapshots, input, downloads, extensions, screencasts and the browser process itself.

What you get
  • Snapshot-then-act interaction: take_snapshot returns stable UIDs, and click, hover, fill, drag and file upload all address elements by UID, with resolve_uid_to_selector turning one back into a CSS selector and failing outright when it has gone stale
  • fill_form_by_uid sets several fields in a single call, and accept_dialog and dismiss_dialog handle the modal that follows
  • Tab control by index, URL or title, plus history navigation and viewport resizing in pixels
  • Capture in three forms: full-page and per-element screenshots as base64 PNG, and screencast_start / screencast_stop recording the viewport to a video file, with several recordings able to run at once
  • Download handling: set_download_behavior allows or cancels downloads without the native save dialog, and list_downloads reports status and the saved file path for everything since startup
  • The browser process itself: get_firefox_output filters stdout and stderr including MOZ_LOG output, warnings, crashes and stack traces; get_firefox_info reports binary path, environment variables and output file location; restart_firefox relaunches with different prefs, profile or environment
  • install_extension takes an .xpi or .zip archive, base64 data or an unpacked directory, and uninstall_extension removes it by ID
  • A saveTo parameter on the bulky tools writes the full result to a file and returns the path and byte size, with preview echoing back a few characters inline
  • Network, console, debugging and profiler tools available behind --tool-preset developer, and Firefox for Android over adb behind --android-device
Requirements

Node.js 20.19.0 or newer and Firefox 100+ installed locally — it is auto-detected, or named with --firefox-path. START_URL decides the page it opens at. Which tools appear is a launch decision: the default basic preset covers pages, snapshot, input, screenshot, downloads, script, screencast and extensions, --tool-preset developer adds network, console, debugging and profiler, and --tool-preset slim drops evaluate_script. Point it at a dedicated Firefox profile rather than your own, since the agent reaches whatever that profile can reach. MIT or Apache-2.0, at your option.

Setup effort

One command — npx @mozilla/firefox-devtools-mcp@latest