# Firefox DevTools MCP [Health: Active]

**Category:** 📂 Browser Automation  
**Repository:** https://github.com/mozilla/firefox-devtools-mcp  
**GitHub Stars:** 560  
**npm Downloads (last month):** 20913  
**Views:** 10  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/firefox-devtools-mcp

## Description
Control and debug Firefox: navigate, fill forms, inspect network and console, profile.

## Tools
Capabilities this server exposes over MCP:

- **list_pages** — List open tabs (index, title, URL). Selected tab is marked.
- **new_page** — Open new tab at URL. Returns tab index.
- **navigate_page** — Navigate selected tab to URL.
- **select_page** — Select active tab by index, URL, or title. Index takes precedence.
- **close_page** — Close tab by index.
- **get_page_text** — Get the visible text of the page (document.body.innerText). Caps at maxLength (default 20000 chars); saveTo saves the full text to a file.
- **take_snapshot** — Capture DOM snapshot with stable UIDs. A UID stays valid across snapshots until its element is removed or the page navigates. Output caps at maxLines (default 100); scope with selector or dump the full tree with saveTo.
- **resolve_uid_to_selector** — Resolve UID to CSS selector. Fails if the element is gone.
- **clear_snapshot** — Clear snapshot UIDs. Usually not needed.
- **click_by_uid** — Click element by UID. Set dblClick for double-click.
- **hover_by_uid** — Hover over element by UID.
- **fill_by_uid** — Fill text input/textarea by UID.
- **drag_by_uid_to_uid** — Drag element to another (HTML5 drag events).
- **fill_form_by_uid** — Fill multiple form fields at once.
- **upload_file_by_uid** — Upload file to file input by UID.
- **press_key** — Press a single key, optionally with modifiers, to submit, dismiss, navigate or trigger a shortcut. Not for entering text: use fill_by_uid instead.
- **type_text** — Type text key by key into the focused element, optionally followed by a key such as Enter. Use fill_by_uid to set the value of a known input; use this for elements that only react to real typing, such as autocomplete fields and rich text editors.
- **screenshot_page** — Capture viewport screenshot as base64 PNG. Set fullPage for the whole scrollable document.
- **screenshot_by_uid** — Capture element screenshot by UID as base64 PNG.
- **print_page** — Print the current page to a PDF file using print CSS. Returns the saved file path.
- **list_downloads** — List downloads tracked since startup, including status and saved file path.
- **clear_downloads** — Clear the tracked downloads buffer.
- **set_download_behavior** — Control how downloads are handled: allow (save to a destination folder), deny (cancel), or reset to default. Avoids the native save-file dialog. Requires a recent Firefox.
- **accept_dialog** — Accept browser dialog. Provide promptText for prompts.
- **dismiss_dialog** — Dismiss browser dialog.
- **navigate_history** — Navigate history back/forward. UIDs become stale.
- **set_viewport_size** — Set viewport dimensions in pixels. Applies to the selected tab only.
- **get_firefox_output** — Retrieve Firefox output (stdout/stderr including MOZ_LOG, warnings, crashes, stack traces). Returns recent output from the capture file. Use filters to focus on specific content.
- **get_firefox_info** — Get information about the current Firefox instance configuration, including binary path, environment variables, and output file location.
- **close_firefox_session** — Ends the browser session. If the server connected to your existing Firefox, this releases the connection and leaves Firefox running. If the server started Firefox itself, this closes it. Call this when the browser task is complete and no further browser interaction is expected.
- **install_extension** — Install a Firefox extension using WebDriver BiDi webExtension.install command. Supports installing from archive (.xpi/.zip), base64-encoded data, or unpacked directory.
- **uninstall_extension** — Uninstall a Firefox extension using WebDriver BiDi webExtension.uninstall command. Requires the extension ID returned by install_extension or obtained from list_extensions.
- **screencast_start** — Start recording a screencast (video) of the current page viewport, saving the output to a file in the downloads directory. Returns a screencast id to pass to screencast_stop. Multiple recordings can run at once.
- **screencast_stop** — Stop an in-progress screencast recording started with screencast_start and finalize the video file. Returns the path to the saved file.
- **evaluate_script** — Run a JS function in the page and return its result. Prefer this for targeted reads (a value, text, computed style, whether an element exists) instead of a full take_snapshot. Use the UID interaction tools for clicking, typing, and filling.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "firefox-devtools-mcp": {
    "command": "npx",
    "args": ["-y","@mozilla/firefox-devtools-mcp@latest"]
  }
}
```

## Documentation

## What Firefox DevTools MCP does

Firefox DevTools MCP MCP server gives an AI agent control of a local Firefox browser. It covers routine browser automation such as opening pages, switching tabs, reading visible text, completing forms, uploading files, handling dialogs, and downloading files. It also supports browser inspection workflows through DOM snapshots, screenshots, page output, and Firefox diagnostic information.

The server is suited to two related workflows: having an agent complete multi-step tasks on websites, and having an agent inspect a page during web development. Browser access includes the cookies, saved sessions, and reachable sites of the selected Firefox profile, so it should be treated as a local automation process with meaningful access to browser data.

## How it works

Firefox DevTools MCP communicates with Firefox using WebDriver BiDi through Selenium WebDriver. It can launch a Firefox session or connect to an existing one. A session may run with a visible window or in headless mode, and its initial URL and viewport can be configured at startup.

Page interaction commonly starts with `take_snapshot`, which returns a DOM tree containing stable UIDs. Those UIDs can then be passed to actions such as `click_by_uid`, `hover_by_uid`, `fill_by_uid`, `upload_file_by_uid`, or `drag_by_uid_to_uid`. UIDs become invalid when their element is removed or the page navigates. `type_text` is intended for controls that require key-by-key input, including autocomplete fields and rich text editors.

## Setup and configuration

The runtime requires Node.js 20.19.0 or newer and Firefox 100 or newer. Install Firefox locally, then run the published package with `npx @mozilla/firefox-devtools-mcp@latest`. The server can be registered with Claude Code or Codex, configured in a client configuration file, or tested through MCP Inspector.

Useful startup options include `--firefox-path`, `--headless`, `--viewport`, `--start-url`, `--profile-path`, `--firefox-arg`, and `--accept-insecure-certs`. Set `--connect-existing` to attach to an already-running Firefox session. The default Marionette port for that mode is 2828. A dedicated profile is recommended rather than a normal personal profile.

Tool exposure can be narrowed with `--tool-preset` or an explicit `--tools` list. Available presets include `slim`, `basic`, `developer`, `mozilla`, and `all`; `basic` is the default. Equivalent environment variables include `FIREFOX_HEADLESS`, `START_URL`, `CONNECT_EXISTING`, `MARIONETTE_PORT`, and `TOOL_PRESET`.

## Tools and capabilities

- List, create, select, navigate, and close tabs with `list_pages`, `new_page`, `select_page`, `navigate_page`, and `close_page`.
- Read visible page text or save it to a file with `get_page_text`.
- Capture DOM snapshots, resolve element UIDs, and interact with page elements.
- Fill forms, upload files, drag elements, press keys, and type into focused controls.
- Capture viewport or full-page screenshots, capture element screenshots, and print pages to PDF.
- Manage downloads, including listing tracked files, clearing the download buffer, and setting allow or deny behavior.
- Accept or dismiss browser dialogs, change viewport dimensions, navigate history, and retrieve Firefox output and instance information.

## Limitations and notes

The browser must be installed locally; the server is not intended for cloud-only hosting services. Firefox accepts one client at a time in connect-existing mode, and an idle timeout can release that connection. Navigating or moving through browser history invalidates existing snapshot UIDs.

Browser automation carries prompt-injection and data-access risks. Use a dedicated Firefox profile, visit only trusted or controlled sites, and expose only the tool modules needed for the task. Privileged Firefox contexts require additional configuration and should be enabled deliberately. `close_firefox_session` ends the session; when the server connected to an existing browser, it releases the connection without closing that browser.

_Full upstream README: https://allmcps.com/mcp/firefox-devtools-mcp/readme_

