
Firefox DevTools MCP
OfficialAutomate and inspect Firefox via WebDriver BiDi (Selenium) from any MCP client.
Add to your client
Copy the config for your MCP client and paste it into its config file.
claude mcp add firefox-devtools npx @mozilla/firefox-devtools-mcp@latestPaste 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_pagesList the open pages (tabs) in the browser.
new_pageOpen a new page (tab).
navigate_pageNavigate the selected page to a URL.
select_pageSelect the active page to operate on.
close_pageClose a page (tab).
take_snapshotTake an accessibility-tree snapshot of the page, producing UIDs for elements.
click_by_uidClick an element identified by its snapshot UID.
hover_by_uidHover over an element identified by its snapshot UID.
fill_by_uidFill text into an element identified by its snapshot UID.
drag_by_uidDrag an element identified by its snapshot UID.
upload_by_uidUpload a file to an element identified by its snapshot UID.
fill_formFill multiple form fields in one operation.
list_network_requestsList captured network requests (always-on capture; ID-first with filters).
get_network_requestGet details of a specific network request by ID.
list_console_messagesList console messages from the page.
clear_console_messagesClear captured console messages.
screenshot_pageTake a screenshot of the page (optional saveTo path for CLI environments).
screenshot_by_uidTake a screenshot of an element by UID (optional saveTo path).
evaluate_scriptExecute arbitrary JavaScript in the page context. Requires --enable-script (ENABLE_SCRIPT=true).
evaluate_privileged_scriptEvaluate a privileged script in a chrome context. Requires --enable-privileged-context and MOZ_REMOTE_ALLOW_SYSTEM_ACCESS=1.
install_extensionInstall a WebExtension.
uninstall_extensionUninstall a WebExtension.
list_extensionsList installed WebExtensions. Requires MOZ_REMOTE_ALLOW_SYSTEM_ACCESS=1.
get_firefox_infoGet information about the running Firefox instance.
get_firefox_outputGet Firefox process output.
restart_firefoxRestart the Firefox instance.
set_firefox_prefsSet Firefox preferences.
get_firefox_prefsGet 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.
Popular community Playwright + API testing MCP server with codegen, screenshots, and device emulation.
Official Browserbase cloud-browser MCP built on Stagehand — natural-language act/extract/observe.
Compare Firefox DevTools MCP with: