MCP Directory

Firefox DevTools MCP

Official

Automate and inspect Firefox via WebDriver BiDi (Selenium) from any MCP client.

Unverified
stdio (local)
No auth
TypeScript

Add to your client

Copy the config for your MCP client and paste it into its config file.

Install / run
claude mcp add firefox-devtools npx @mozilla/firefox-devtools-mcp@latest

Paste into ~/Library/Application Support/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "firefox-devtools-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@mozilla/firefox-devtools-mcp@latest",
        "--headless",
        "--viewport",
        "1280x720"
      ],
      "env": {
        "START_URL": "about:blank"
      }
    }
  }
}

Step-by-step guides: Add to Claude Desktop · Add to Cursor · Add to Windsurf

Before you start

  • Node.js >= 20.19.0
  • Firefox 100+ installed locally (auto-detected, or pass --firefox-path)
  • For Firefox for Android: adb on your PATH (geckodriver is managed automatically)

About Firefox DevTools MCP

Model Context Protocol server, maintained by Mozilla, for automating Firefox via WebDriver BiDi (through Selenium WebDriver). It enables AI assistants to inspect and control a local Firefox browser: navigating pages, taking accessibility-tree snapshots and interacting with elements by UID, capturing network requests and console messages, taking screenshots, and evaluating scripts. Optional opt-in features add privileged context access, WebExtension management, and Firefox preference/management tooling. Works with Claude Code, Claude Desktop, Cursor, Cline and other MCP clients, and supports Firefox for Android plus connecting to an existing Firefox session.

Tools & capabilities (28)

list_pages

List the open pages (tabs) in the browser.

new_page

Open a new page (tab).

navigate_page

Navigate the selected page to a URL.

select_page

Select the active page to operate on.

close_page

Close a page (tab).

take_snapshot

Take an accessibility-tree snapshot of the page, producing UIDs for elements.

click_by_uid

Click an element identified by its snapshot UID.

hover_by_uid

Hover over an element identified by its snapshot UID.

fill_by_uid

Fill text into an element identified by its snapshot UID.

drag_by_uid

Drag an element identified by its snapshot UID.

upload_by_uid

Upload a file to an element identified by its snapshot UID.

fill_form

Fill multiple form fields in one operation.

list_network_requests

List captured network requests (always-on capture; ID-first with filters).

get_network_request

Get details of a specific network request by ID.

list_console_messages

List console messages from the page.

clear_console_messages

Clear captured console messages.

screenshot_page

Take a screenshot of the page (optional saveTo path for CLI environments).

screenshot_by_uid

Take a screenshot of an element by UID (optional saveTo path).

evaluate_script

Execute arbitrary JavaScript in the page context. Requires --enable-script (ENABLE_SCRIPT=true).

evaluate_privileged_script

Evaluate a privileged script in a chrome context. Requires --enable-privileged-context and MOZ_REMOTE_ALLOW_SYSTEM_ACCESS=1.

install_extension

Install a WebExtension.

uninstall_extension

Uninstall a WebExtension.

list_extensions

List installed WebExtensions. Requires MOZ_REMOTE_ALLOW_SYSTEM_ACCESS=1.

get_firefox_info

Get information about the running Firefox instance.

get_firefox_output

Get Firefox process output.

restart_firefox

Restart the Firefox instance.

set_firefox_prefs

Set Firefox preferences.

get_firefox_prefs

Get Firefox preferences.

What this server can do

Firefox DevTools MCP provides tools for these capabilities — tap one to see every MCP server that does the same:

When to use it

  • Drive end-to-end browser automation and testing in Firefox from an AI assistant
  • Inspect network requests and console messages while debugging a web page
  • Take accessibility-tree snapshots and interact with page elements by UID (click, fill, hover, drag, upload)
  • Capture page or element screenshots and save them to disk to keep AI context small
  • Automate Firefox for Android via ADB, or attach to an existing logged-in Firefox session

Security notes

Browser MCP servers carry inherent risks. Use a dedicated Firefox profile (never your regular one) since the agent can access whatever the browser can reach, including cookies and saved sessions. Be cautious about which sites you visit, as pages can return content designed to manipulate the agent (prompt injection). Avoid enabling extra flags unless needed: `--enable-script` and `--enable-privileged-context` significantly expand what the agent can do. Do not leave Marionette enabled during normal browsing in connect-existing mode, as it changes browser fingerprint signals and can trigger bot detection. See SECURITY.md for a full breakdown.

Firefox DevTools MCP FAQ

Can this run on a cloud MCP host like glama.ai?

No. The server requires a local Firefox browser installation and cannot run on cloud hosting services. Run it locally with `npx @mozilla/firefox-devtools-mcp@latest`, or use Docker with the provided Dockerfile.

How do I run arbitrary JavaScript in the page?

The evaluate_script tool is disabled by default. Enable it with the --enable-script flag (or ENABLE_SCRIPT=true). Privileged scripts and other privileged-context tools additionally require --enable-privileged-context and MOZ_REMOTE_ALLOW_SYSTEM_ACCESS=1.

Can I automate my real, logged-in Firefox session?

Yes, via connect-existing mode: start Firefox with `firefox --marionette`, then run the server with `--connect-existing --marionette-port 2828`. BiDi-dependent features (console and network events) are unavailable in this mode, but all other features work. Do not leave Marionette enabled during normal browsing, as it changes fingerprint signals and can trigger bot detection.

Firefox isn't found on startup. How do I fix it?

Pass the binary path with --firefox-path, e.g. on macOS `--firefox-path "/Applications/Firefox.app/Contents/MacOS/firefox"`, or the correct path for your OS.

Alternatives to Firefox DevTools MCP

Compare all alternatives →

All-in-one web access MCP — Web Unlocker, SERP, Scraper API, and a cloud Scraping Browser.

Verified
stdio (local)
API key
JavaScript
12 tools
Updated 18 days agoRepo

Popular community Playwright + API testing MCP server with codegen, screenshots, and device emulation.

Verified
stdio (local)
No auth
TypeScript
12 tools
Updated 1 month agoRepo

Official Browserbase cloud-browser MCP built on Stagehand — natural-language act/extract/observe.

Verified
stdio (local)
API key
TypeScript
8 tools
Updated 18 days agoRepo