# @mozilla/firefox-devtools-mcp [Health: Active]

**Category:** 📂 Browser Automation  
**Repository:** https://github.com/mozilla/firefox-mcp  
**GitHub Stars:** 598  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/mozilla-firefox-devtools-mcp

## Description
Model Context Protocol (MCP) server that lets AI agents browse the web and debug web pages with Firefox

## 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 or pick a select option 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.
- **list_extensions** — List installed Firefox extensions using the WebDriver BiDi webExtension.moz:listExtensions command.
- **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-mcp@latest"]
  }
}
```

## Documentation

## What @mozilla/firefox-devtools-mcp does

@mozilla/firefox-devtools-mcp exposes Firefox to AI agents through the Model Context Protocol. It covers two related workflows: browser automation for reading pages, filling forms, and completing multi-step website tasks; and agent-assisted web development for inspecting a page with browser development tools.

The server can manage pages and tabs, navigate to URLs, take page snapshots, interact with elements, capture screenshots, inspect network activity, retrieve console messages, and work with downloads. Developer-oriented presets add debugging and profiler capabilities. Firefox developer workflows can also use Mozilla-specific tools through the corresponding preset.

## How it works

Firefox is controlled through WebDriver BiDi using Selenium WebDriver. The server normally launches a local Firefox installation, but it can also connect to an existing Firefox process through Marionette. A starting URL, viewport, Firefox preferences, additional browser arguments, certificate handling, and headless mode can be configured through command-line options or their associated environment variables.

Tool exposure is configurable. The `slim` preset provides the minimum browsing and interaction set, `basic` is the default, and `developer`, `mozilla`, and `all` progressively expose more modules. An explicit `--tools` list overrides the selected preset. The default `basic` preset includes script evaluation; `slim` removes it.

## Setup and configuration

The runtime requirements are Node.js 20.19.0 or newer and Firefox 100 or newer. Install and run the published package with `npx @mozilla/firefox-mcp@latest`. MCP clients can register the command directly; documented configurations include Claude Code and Codex. MCP Inspector can also launch the server for interactive testing.

Useful options include:

- `--firefox-path` to select a Firefox binary
- `--headless` and `--viewport` to control display mode and window size
- `--start-url` to open a page at startup
- `--profile-path` to choose an isolated profile location
- `--connect-existing` to attach to a running Firefox instance
- `--tool-preset` or `--tools` to limit exposed capabilities
- `--android-device` to enable Firefox for Android mode

A Dockerfile is available, but the browser itself must be available locally; the server cannot run on cloud hosting services such as glama.ai.

## Tools and capabilities

Examples of exposed tools include:

- `list_pages`, `select_page`, and `navigate_page` for page and tab management
- `take_snapshot`, `click_by_uid`, and `fill_by_uid` for inspecting and interacting with pages
- `screenshot_page` for visual capture
- `list_network_requests` and `get_network_request` for network inspection
- `list_console_messages` for browser console output
- `list_downloads` and `set_download_behavior` for download handling
- `evaluate_script` for running page scripts when the selected tool set includes the script module

The developer preset adds network, console, debugging, and profiler tools. Output that is bulky can be saved to disk, with an option to allow unrestricted save paths.

## Limitations and notes

Use a dedicated Firefox profile rather than a personal profile. The agent may reach sites, cookies, and saved sessions available to the browser, and web content can attempt to manipulate the agent through prompt injection. Restrict enabled modules to the capabilities required for the task, particularly when script evaluation or privileged Firefox contexts are enabled.

Firefox accepts one client at a time in connect-existing mode. The idle timeout releases the browser after a period without tool calls, allowing another client to connect; the next call reconnects to the tab that is active at that time. Privileged context requires `MOZ_REMOTE_ALLOW_SYSTEM_ACCESS=1` and should be enabled only deliberately.

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

