freshcrate
Skin:/
Home > MCP Servers > firefox-devtools-mcp

firefox-devtools-mcp

Model Context Protocol server for Firefox DevTools - enables AI assistants to inspect and control Firefox browser through the Remote Debugging Protocol

Why this rank:Strong adoptionRecent releaseHealthy release cadence

Description

Model Context Protocol server for Firefox DevTools - enables AI assistants to inspect and control Firefox browser through the Remote Debugging Protocol

README

Firefox DevTools MCP

npm version CI codecov License: MIT

Glama

Model Context Protocol server for automating Firefox via WebDriver BiDi (through Selenium WebDriver). Works with Claude Code, Claude Desktop, Cursor, Cline and other MCP clients.

Repository: https://github.com/mozilla/firefox-devtools-mcp

Note: This MCP server requires a local Firefox browser installation and cannot run on cloud hosting services like glama.ai. Use npx firefox-devtools-mcp@latest to run locally, or use Docker with the provided Dockerfile.

Requirements

  • Node.js ≥ 20.19.0
  • Firefox 100+ installed (auto‑detected, or pass --firefox-path)

Install and use with Claude Code (npx)

Recommended: use npx so you always run the latest published version from npm.

Option A — Claude Code CLI

claude mcp add firefox-devtools npx firefox-devtools-mcp@latest

Pass options either as args or env vars. Examples:

# Headless + viewport via args
claude mcp add firefox-devtools npx firefox-devtools-mcp@latest -- --headless --viewport 1280x720

# Or via environment variables
claude mcp add firefox-devtools npx firefox-devtools-mcp@latest \
  --env START_URL=https://example.com \
  --env FIREFOX_HEADLESS=true

Option B — Edit Claude Code settings JSON

Add to your Claude Code config file:

  • macOS: ~/Library/Application Support/Claude/Code/mcp_settings.json
  • Linux: ~/.config/claude/code/mcp_settings.json
  • Windows: %APPDATA%\Claude\Code\mcp_settings.json
{
  "mcpServers": {
    "firefox-devtools": {
      "command": "npx",
      "args": ["-y", "firefox-devtools-mcp@latest", "--headless", "--viewport", "1280x720"],
      "env": {
        "START_URL": "about:home"
      }
    }
  }
}

Option C — Helper script (local dev build)

npm run setup
# Choose Claude Code; the script saves JSON to the right path

Try it with MCP Inspector

npx @modelcontextprotocol/inspector npx firefox-devtools-mcp@latest --start-url https://example.com --headless

Then call tools like:

  • list_pages, select_page, navigate_page
  • take_snapshot then click_by_uid / fill_by_uid
  • list_network_requests (always‑on capture), get_network_request
  • screenshot_page, list_console_messages

CLI options

You can pass flags or environment variables (names on the right):

  • --firefox-path — absolute path to Firefox binary
  • --headless — run without UI (FIREFOX_HEADLESS=true)
  • --viewport 1280x720 — initial window size
  • --profile-path — use a specific Firefox profile
  • --firefox-arg — extra Firefox arguments (repeatable)
  • --start-url — open this URL on start (START_URL)
  • --accept-insecure-certs — ignore TLS errors (ACCEPT_INSECURE_CERTS=true)
  • --connect-existing — attach to an already-running Firefox instead of launching a new one (CONNECT_EXISTING=true)
  • --marionette-port — Marionette port for connect-existing mode, default 2828 (MARIONETTE_PORT)
  • --pref name=value — set Firefox preference at startup via moz:firefoxOptions (repeatable)
  • --enable-script — enable the evaluate_script tool, which executes arbitrary JavaScript in the page context (ENABLE_SCRIPT=true)
  • --enable-privileged-context — enable privileged context tools: list/select privileged contexts, evaluate privileged scripts, get/set Firefox prefs, and list extensions. Requires MOZ_REMOTE_ALLOW_SYSTEM_ACCESS=1 (ENABLE_PRIVILEGED_CONTEXT=true)

Note on --pref: When Firefox runs in automation, it applies RecommendedPreferences that modify browser behavior for testing. The --pref option allows overriding these defaults when needed.

Connect to existing Firefox

Use --connect-existing to automate your real browsing session — with cookies, logins, and open tabs intact:

# Start Firefox with Marionette enabled
firefox --marionette

# Run the MCP server
npx firefox-devtools-mcp --connect-existing --marionette-port 2828

Or set marionette.enabled to true in about:config (or user.js) to enable Marionette on every launch.

BiDi-dependent features (console events, network events) are not available in connect-existing mode; all other features work normally.

Warning: Do not leave Marionette enabled during normal browsing. It sets navigator.webdriver = true and changes other browser fingerprint signals, which can trigger bot detection on sites protected by Cloudflare, Akamai, etc. Only enable Marionette when you need MCP automation, then restart Firefox normally afterward.

Tool overview

  • Pages: list/new/navigate/select/close
  • Snapshot/UID: take/resolve/clear
  • Input: click/hover/fill/drag/upload/form fill
  • Network: list/get (ID‑first, filters, always‑on capture)
  • Console: list/clear
  • Screenshot: page/by uid (with optional saveTo for CLI environments)
  • Script: evaluate_script
  • Privileged Context: list/select privileged ("chrome") contexts, evaluate_privileged_script (requires MOZ_REMOTE_ALLOW_SYSTEM_ACCESS=1)
  • WebExtension: install_extension, uninstall_extension, list_extensions (list requires MOZ_REMOTE_ALLOW_SYSTEM_ACCESS=1)
  • Firefox Management: get_firefox_info, get_firefox_output, restart_firefox, set_firefox_prefs, get_firefox_prefs
  • Utilities: accept/dismiss dialog, history back/forward, set viewport

Screenshot optimization for Claude Code

When using screenshots in Claude Code CLI, the base64 image data can consume significant context. Use the saveTo parameter to save screenshots to disk instead:

screenshot_page({ saveTo: "/tmp/page.png" })
screenshot_by_uid({ uid: "abc123", saveTo: "/tmp/element.png" })

The file can then be viewed with Claude Code's Read tool without impacting context size.

Local development

npm install
npm run build

# Run with Inspector against local build
npx @modelcontextprotocol/inspector node dist/index.js --headless --viewport 1280x720

# Or run in dev with hot reload
npm run inspector:dev

Testing

npm run test:run          # all tests once (unit + integration)
npm test                  # watch mode

See docs/testing.md for full details on running specific test suites, the e2e scenario coverage, and known issues.

Troubleshooting

  • Firefox not found: pass --firefox-path "/Applications/Firefox.app/Contents/MacOS/firefox" (macOS) or the correct path on your OS.
  • First run is slow: Selenium sets up the BiDi session; subsequent runs are faster.
  • Stale UIDs after navigation: take a fresh snapshot (take_snapshot) before using UID tools.
  • Windows 10: Error during discovery for MCP server 'firefox-devtools': MCP error -32000: Connection closed
    • Solution 1 Wrap with cmd /c (details):

      "mcpServers": {
        "firefox-devtools": {
          "command": "cmd",
          "args": ["/c", "npx", "-y", "firefox-devtools-mcp@latest"]
        }
      }
    • Solution 2 Use the absolute path to npx (adjust extension — .cmd, .bat, .exe, or .ps1 — to match your setup):

      "mcpServers": {
        "firefox-devtools": {
          "command": "C:\\nvm4w\\nodejs\\npx.ps1",
          "args": ["-y", "firefox-devtools-mcp@latest"]
        }
      }

Versioning

  • Pre‑1.0 API: versions start at 0.x. Use @latest with npx for the newest release.

CI and Release

  • GitHub Actions for CI, Release, and npm publish are included. See docs/ci-and-release.md for details and required secrets.

Issues and Contributing

Issues are tracked on Bugzilla under product: Developer Infrastructure, component: AI for Development.

For questions and discussion, join the #firefox-devtools-mcp Matrix room.

Author

Maintained by Mozilla.

Release History

VersionChangesUrgencyDate
v0.9.4 ### Added - Support for connecting to Firefox for Android via `--android` flag ### Fixed - Navigation to `moz-extension://` URLs no longer hangs; now uses BiDi navigate - Geckodriver binary detection on WindowsHigh6/4/2026
0.9.3### Added - New `@mozilla/firefox-devtools-mcp-moz` npm package with privileged context support enabled by default - `--profile-path` now uses a dedicated subfolder to avoid corrupting existing profiles, and warns when reusing a profile that already exists ### Fixed - Profile reuse warnings are now surfaced as MCP errors so AI assistants can see them - Network debug command now uses `statusMin=400` instead of `status="failed"` to correctly match 4xx/5xx responses - Docker image now creatHigh5/18/2026
0.9.2### Added - `evaluate_privileged_script` now detects `const`/`let`/`var` statements and rejects them with a helpful error message suggesting IIFE workaround - BiDi console and network events now degrade gracefully when Firefox Remote Agent is not running, instead of crashing - Comprehensive e2e scenario integration tests covering the full `FirefoxClient` API - Unit tests for privileged context state consistency and statement detection - Testing documentation (`docs/testing.md`) ### Fixed - PrivHigh4/19/2026
0.9.1## What's Changed ### Bug Fixes - Fixed `SERVER_VERSION` reporting `0.7.1` instead of actual package version — now reads from `package.json` dynamically - Fixed connect-existing mode: session cleanup, BiDi support, `--marionette-host` parameter (#50) - Fixed lint/type errors from PR #50 merge - Resolved 11 security vulnerabilities in dependencies (#47) ### Improvements - Removed fragile `process.on` handlers in test setup that masked real errors and caused `MaxListenersExceededWarning` - AddedMedium3/29/2026
0.9.0## What's Changed ### New Features - **Content script evaluation** — evaluate JS against web pages (`--enable-script` flag) - **Privileged context support** — chrome-privileged context for Firefox internal development (`--enable-privileged-context` flag) - **WebExtension tools** — install, uninstall, and list Firefox extensions - **Firefox restart tool** — restart Firefox with new config at runtime (preserves profile path) - **Preferences configuration** — read/write Firefox prefs via CLI (`--pMedium3/28/2026
0.8.1## What's Changed ### Fixes - Fixed flaky snapshot integration test on Node 22 CI runners (increased Firefox startup timeout from 30s to 60s) - Upgraded all GitHub Actions from v4 to v5 (checkout, setup-node) and upload-artifact to v7 to resolve Node.js 20 deprecation warnings - Publish workflow now uses Node.js 22 **Full Changelog**: https://github.com/freema/firefox-devtools-mcp/compare/0.8.0...0.8.1Low3/17/2026
0.8.0## What's Changed ### New Feature: Connect to existing Firefox (`--connect-existing`) You can now attach to an already-running Firefox instance instead of launching a new one. This enables automating your **existing browsing session** — with cookies, logins, and open tabs intact. #### Usage ```bash # Start Firefox with Marionette enabled firefox --marionette # Run the MCP server npx firefox-devtools-mcp --connect-existing --marionette-port 2828 ``` Also supports environment variables: `CONLow3/17/2026
0.7.4## What's Changed * test: Add unit tests for injected browser scripts by @freema in https://github.com/freema/firefox-devtools-mcp/pull/43 **Full Changelog**: https://github.com/freema/firefox-devtools-mcp/compare/0.7.3...0.7.4Low2/27/2026
0.7.3## What's Changed * docs: Document solutions for Windows MCP server errors by @EzioMercer in https://github.com/freema/firefox-devtools-mcp/pull/41 ## New Contributors * @EzioMercer made their first contribution in https://github.com/freema/firefox-devtools-mcp/pull/41 **Full Changelog**: https://github.com/freema/firefox-devtools-mcp/compare/0.7.1...0.7.3Low2/24/2026
0.7.1## What's Changed * fix: Update version to 0.7.1 and simplify saveTo parameter descriptio… by @freema in https://github.com/freema/firefox-devtools-mcp/pull/39 **Full Changelog**: https://github.com/freema/firefox-devtools-mcp/compare/0.7.0...0.7.1Low2/13/2026
0.7.0## What's Changed * feat: Enhance screenshot functionality with saveTo option and update … by @freema in https://github.com/freema/firefox-devtools-mcp/pull/38 **Full Changelog**: https://github.com/freema/firefox-devtools-mcp/compare/0.6.1...0.7.0Low2/13/2026
0.6.1## What's Changed * fix: Improve snapshot visibility checking and error handling by @freema in https://github.com/freema/firefox-devtools-mcp/pull/37 **Full Changelog**: https://github.com/freema/firefox-devtools-mcp/compare/0.6.0...0.6.1Low2/6/2026
0.6.0### New Features - **Claude Code Plugin** with full structure: - Commands: `/firefox:navigate`, `/firefox:screenshot`, `/firefox:debug` - Agents: `e2e-tester`, `web-scraper` - Skills: Auto-triggering `browser-automation` skill ### Installation ```bash claude plugin install firefox-devtools ```Low2/3/2026
0.5.3## What's Changed * chore: update version to 0.5.3 and document Windows integration test … by @freema in https://github.com/freema/firefox-devtools-mcp/pull/34 **Full Changelog**: https://github.com/freema/firefox-devtools-mcp/compare/0.5.2...0.5.3Low1/30/2026
0.5.2## What's Changed * feat: enhance CI workflows, add unit tests, and improve test stabilit… by @freema in https://github.com/freema/firefox-devtools-mcp/pull/31 **Full Changelog**: https://github.com/freema/firefox-devtools-mcp/compare/0.5.1...0.5.2Low1/22/2026
0.5.1## What's Changed * fix: enhance BiDi header parsing to handle various value types and ed… by @freema in https://github.com/freema/firefox-devtools-mcp/pull/30 **Full Changelog**: https://github.com/freema/firefox-devtools-mcp/compare/0.4.2...0.5.1Low1/21/2026
0.4.2## What's Changed * Optimize MCP tool definitions for efficiency by @freema in https://github.com/freema/firefox-devtools-mcp/pull/25 * refactor: optimize MCP response sizes for reduced token consumption by @freema in https://github.com/freema/firefox-devtools-mcp/pull/26 * Update README with personal website link by @freema in https://github.com/freema/firefox-devtools-mcp/pull/27 * Fix Node 22 test coverage failure by @freema in https://github.com/freema/firefox-devtools-mcp/pull/28 *Low12/10/2025
0.4.1## What's Changed * fix: remove tests from publish workflow by @freema in https://github.com/freema/firefox-devtools-mcp/pull/24 **Full Changelog**: https://github.com/freema/firefox-devtools-mcp/compare/0.4.0...0.4.1Low11/26/2025
0.4.0## What's Changed * Navigate to localhost development server by @freema in https://github.com/freema/firefox-devtools-mcp/pull/17 * Implement token limit safeguards by @freema in https://github.com/freema/firefox-devtools-mcp/pull/18 * Fix Firefox DevTools connection error by @freema in https://github.com/freema/firefox-devtools-mcp/pull/19 * Bump version to 0.4 and fix failing tests by @freema in https://github.com/freema/firefox-devtools-mcp/pull/20 * Debug pipeline test failure on main bLow11/26/2025
0.3.1## What's Changed * Add integration tests for console, form, network, and snapshot workflows by @freema in https://github.com/freema/firefox-devtools-mcp/pull/15 **Full Changelog**: https://github.com/freema/firefox-devtools-mcp/compare/0.3.0...0.3.1Low11/14/2025
0.3.0## What's Changed * Fix MCP connection timeout and closure errors by @freema in https://github.com/freema/firefox-devtools-mcp/pull/13 * Incomplete Request - Clarification Needed by @freema in https://github.com/freema/firefox-devtools-mcp/pull/14 **Full Changelog**: https://github.com/freema/firefox-devtools-mcp/compare/0.2.5...0.3.0Low11/6/2025
0.2.5## What's Changed * fix: move geckodriver to dependencies to fix connection timeout by @freema in https://github.com/freema/firefox-devtools-mcp/pull/11 * 0.2.5 by @freema in https://github.com/freema/firefox-devtools-mcp/pull/12 **Full Changelog**: https://github.com/freema/firefox-devtools-mcp/compare/0.2.4...0.2.5Low10/29/2025
0.2.4## What's Changed * Fix MCP connection timeout and closing issue by @freema in https://github.com/freema/firefox-devtools-mcp/pull/10 **Full Changelog**: https://github.com/freema/firefox-devtools-mcp/compare/0.2.3...0.2.4Low10/29/2025
0.2.3## What's Changed * fix: add blank line for improved readability in README by @freema in https://github.com/freema/firefox-devtools-mcp/pull/8 * claude/session-011CUZAR8cgKFG1T2jAw79nQ by @freema in https://github.com/freema/firefox-devtools-mcp/pull/9 **Full Changelog**: https://github.com/freema/firefox-devtools-mcp/compare/0.2.2...0.2.3Low10/28/2025
0.2.2## What's Changed * Add Missing Selenium WebDriver Dependency by @freema in https://github.com/freema/firefox-devtools-mcp/pull/7 **Full Changelog**: https://github.com/freema/firefox-devtools-mcp/compare/0.2.1...0.2.2Low10/27/2025
0.2.1## What's Changed * feat: add Glama badge to README for server status visibility by @freema in https://github.com/freema/firefox-devtools-mcp/pull/3 * feat: update CI workflow to run tests with coverage and improve Codec… by @freema in https://github.com/freema/firefox-devtools-mcp/pull/4 * feat: update coverage configuration to include 'old/**' and adjust th… by @freema in https://github.com/freema/firefox-devtools-mcp/pull/5 * Initial by @freema in https://github.com/freema/firefox-devtoolLow10/19/2025
0.2.0## What's Changed * Initial by @freema in https://github.com/freema/firefox-devtools-mcp/pull/1 * feat: remove version check workflow, breaking changes documentation, … by @freema in https://github.com/freema/firefox-devtools-mcp/pull/2 ## New Contributors * @freema made their first contribution in https://github.com/freema/firefox-devtools-mcp/pull/1 **Full Changelog**: https://github.com/freema/firefox-devtools-mcp/commits/0.2.0Low10/19/2025

Dependencies & License Audit

Loading dependencies...

Similar Packages

opentabsBrowser automation clicks buttons. OpenTabs calls APIs.main@2026-06-06
MeiGen-AI-Design-MCPMeiGen-AI-Design-MCP — Turn Claude Code / OpenClaw into your local Lovart. Local ComfyUI, 1,400+ prompt library, multi-direction parallel generation.v1.3.2
mcp-tidy🧹 Simplify your MCP servers with mcp-tidy, clearing server bloat to enhance performance and improve tool selection in Claude Code.main@2026-06-07
sqltools_mcp🔌 Access multiple databases seamlessly with SQLTools MCP, a versatile service supporting MySQL, PostgreSQL, SQL Server, DM8, and SQLite without multiple servers.main@2026-06-07
claude-code-safety-net🛡️ Enhance code safety with Claude Code Safety Net, a tool designed to identify and mitigate risks in your codebase effectively.main@2026-06-07

More in MCP Servers

claude-plugins-officialOfficial, Anthropic-managed directory of high quality Claude Code Plugins.
langchain4jLangChain4j is an open-source Java library that simplifies the integration of LLMs into Java applications through a unified API, providing access to popular LLMs and vector databases. It makes impleme
hyperframesWrite HTML. Render video. Built for agents.
claude-code-guideClaude Code Guide - Setup, Commands, workflows, agents, skills & tips-n-tricks go from beginner to power user!