firefox-mcp-moz
v0.11.1Model Context Protocol (MCP) server that lets AI agents browse the web and debug web pages with Firefox (moz build with privileged context support)
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
list_pages
List open tabs (index, title, URL). Selected tab is marked.
new_page
Open new tab at URL. Returns tab index.
| Parameter | Type | Description |
|---|---|---|
url * | string | Target URL |
wait | string | When to return: 'none' (navigation started), 'interactive' (DOMContentLoaded), 'complete' (load event fired, including subresources). Omit for the default: 'interactive' for http/https/data/blob/file,… |
select_page
Select active tab by index, URL, or title. Index takes precedence.
| Parameter | Type | Description |
|---|---|---|
pageIdx | number | Tab index (0-based, most reliable) |
title | string | Title substring (case-insensitive) |
url | string | URL substring (case-insensitive) |
close_page
Close tab by index.
| Parameter | Type | Description |
|---|---|---|
pageIdx * | number | Tab index to close |
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.
| Parameter | Type | Description |
|---|---|---|
maxLength | number | Max characters to return inline (default: 20000). Ignored when saveTo is used. |
preview | number | Number of characters of the saved text to return inline as a preview when saveTo is used. Omit for no preview. |
saveTo | boolean | string | Save the full untruncated text to a file instead of returning it inline. Pass a file path, an existing directory (generated file inside), or true (generated file under ~/.firefox-mcp/output/). Relativ… |
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.
| Parameter | Type | Description |
|---|---|---|
includeAll | boolean | Include all visible elements without relevance filtering. Useful for Vue/Livewire apps (default: false) |
includeAttributes | boolean | Include ARIA attributes (default: false) |
includeText | boolean | Include text (default: true) |
maxDepth | number | Max tree depth |
maxLines | number | Max lines (default: 100) |
preview | number | Number of characters of the saved output to return inline as a preview when saveTo is used. Omit for no preview. |
saveTo | boolean | string | Save the complete snapshot text to a file (ignores maxLines) instead of returning it inline. Pass a file path, an existing directory (generated file inside), or true (generated file under ~/.firefox-m… |
selector | string | CSS selector to scope snapshot to specific element (e.g., "#app") |
resolve_uid_to_selector
Resolve UID to CSS selector. Fails if the element is gone.
| Parameter | Type | Description |
|---|---|---|
uid * | string | UID from snapshot |
wait_for
Wait until text or an element matching a CSS selector is visible, or with gone until it disappears. Also searches open shadow roots and same-origin iframes.
| Parameter | Type | Description |
|---|---|---|
gone | boolean | Wait until it disappears (default: false) |
selector | string | CSS selector to wait for |
text | string | Visible text to wait for |
timeout | number | Timeout in ms (default: 5000, max: 30000) |
clear_snapshot
Clear snapshot UIDs. Usually not needed.
click_by_uid
Click element by UID. Set dblClick for double-click.
| Parameter | Type | Description |
|---|---|---|
uid * | string | Element UID from snapshot |
dblClick | boolean | Double-click (default: false) |
hover_by_uid
Hover over element by UID.
| Parameter | Type | Description |
|---|---|---|
uid * | string | Element UID from snapshot |
fill_by_uid
Fill text input/textarea or pick a select option by UID.
| Parameter | Type | Description |
|---|---|---|
uid * | string | Input element UID from snapshot |
value * | string | Text to fill, or the value or visible text of the option to select |
drag_by_uid_to_uid
Drag element to another (HTML5 drag events).
| Parameter | Type | Description |
|---|---|---|
fromUid * | string | Source element UID |
toUid * | string | Target element UID |
fill_form_by_uid
Fill multiple form fields at once.
| Parameter | Type | Description |
|---|---|---|
elements * | array | Array of {uid, value} pairs |
upload_file_by_uid
Upload file to file input by UID.
| Parameter | Type | Description |
|---|---|---|
filePath * | string | Local file path |
uid * | string | File input UID from snapshot |
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.
| Parameter | Type | Description |
|---|---|---|
key * | string | One key, optionally preceded by "+"-separated modifiers, such as "Escape", "Enter" or "ctrl+shift+t". Modifiers: ctrl, alt, shift, meta. Named keys: Enter, Return, NumpadEnter, Tab, Backspace, Delete,… |
uid | string | Focusable element UID from snapshot to focus before pressing (default: the already focused element) |
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.
| Parameter | Type | Description |
|---|---|---|
text * | string | Text to type |
submitKey | string | Key to press after the text, such as "Enter" or "Tab". Same syntax as press_key. |
uid | string | Focusable element UID from snapshot to focus before typing (default: the already focused element) |
screenshot_page
Capture viewport screenshot as base64 PNG. Set fullPage for the whole scrollable document.
| Parameter | Type | Description |
|---|---|---|
fullPage | boolean | Capture the whole scrollable document (default: false) |
saveTo | boolean | string | Save the screenshot to a file instead of returning it as image data in the response. Pass a file path, an existing directory (generated file inside), or true (generated file under ~/.firefox-mcp/outpu… |
screenshot_by_uid
Capture element screenshot by UID as base64 PNG.
| Parameter | Type | Description |
|---|---|---|
uid * | string | Element UID from snapshot |
saveTo | boolean | string | Save the screenshot to a file instead of returning it as image data in the response. Pass a file path, an existing directory (generated file inside), or true (generated file under ~/.firefox-mcp/outpu… |
print_page
Print the current page to a PDF file using print CSS. Returns the saved file path.
| Parameter | Type | Description |
|---|---|---|
background | boolean | Print background colors and images (default: false) |
landscape | boolean | Use landscape orientation (default: false) |
saveTo | boolean | string | Where to save the PDF. Pass a file path, an existing directory (generated file inside), or true or omit it (generated file under ~/.firefox-mcp/output/). Relative paths resolve against the current wor… |
list_downloads
List downloads tracked since startup, including status and saved file path.
| Parameter | Type | Description |
|---|---|---|
format | string | Output format (default: text) |
limit | number | Max downloads (default: 50) |
status | string | Filter by status |
urlContains | string | URL filter (case-insensitive) |
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.
| Parameter | Type | Description |
|---|---|---|
behavior * | string | 'allowed' saves downloads to `downloadFolder`, 'denied' cancels them, 'default' resets to the browser default |
downloadFolder | string | Path to the folder where downloads should be stored, created if missing. Only used for behavior='allowed', where it defaults to ~/.firefox-mcp/output/downloads. Relative paths resolve against the curr… |
accept_dialog
Accept browser dialog. Provide promptText for prompts.
| Parameter | Type | Description |
|---|---|---|
promptText | string | Text for prompt dialogs |
dismiss_dialog
Dismiss browser dialog.
set_viewport_size
Set viewport dimensions in pixels. Applies to the selected tab only.
| Parameter | Type | Description |
|---|---|---|
height * | number | Height in pixels |
width * | number | Width in pixels |
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.
| Parameter | Type | Description |
|---|---|---|
grep | string | Filter log lines containing this string (case-insensitive) |
lines | number | Number of recent log lines to return (default: 100, max: 10000) |
since | number | Only show logs written in the last N seconds |
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.
| Parameter | Type | Description |
|---|---|---|
type * | string | Extension data type: "archivePath" for .xpi/.zip, "base64" for encoded data, "path" for unpacked directory |
path | string | File path (for archivePath or path types) |
permanent | boolean | Firefox-specific: Install permanently (requires signed extension). Default: false (temporary install) |
value | string | Base64-encoded extension data (for base64 type) |
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.
| Parameter | Type | Description |
|---|---|---|
id * | string | Extension ID (e.g., "addon@example.com") |
list_extensions
List installed Firefox extensions using the WebDriver BiDi webExtension.moz:listExtensions command.
| Parameter | Type | Description |
|---|---|---|
ids | array | Optional: Filter by exact extension IDs (e.g., ["addon@example.com"]) |
isActive | boolean | Optional: Filter by enabled (true) or disabled (false) status |
name | string | Optional: Filter by partial name match (case-insensitive, e.g., "shopify") |
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.
| Parameter | Type | Description |
|---|---|---|
context | string | Id of the top-level browsing context to record. Defaults to the currently selected page. |
frameRate | integer | Target frame rate of the recording, in frames per second. |
height | integer | Height of the recorded video in pixels. Defaults to the viewport height. |
mimeType | string | MIME type of the output file. Defaults to "video/webm". |
width | integer | Width of the recorded video in pixels. Defaults to the viewport width. |
screencast_stop
Stop an in-progress screencast recording started with screencast_start and finalize the video file. Returns the path to the saved file.
| Parameter | Type | Description |
|---|---|---|
screencast | string | Id of the screencast to stop, as returned by screencast_start. Optional when exactly one recording is active. |
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.
| Parameter | Type | Description |
|---|---|---|
function * | string | JS function string, e.g. () => document.title |
args | array | UIDs to pass as function arguments, all from the same frame. With UIDs from an iframe, the function runs in that iframe. |
preview | number | Number of characters of the saved result to return inline as a preview when saveTo is used. Omit for no preview. |
sandbox | string | Evaluate in an isolated sandbox realm with this name instead of the page realm. The sandbox shares the page DOM and keeps the native built-ins even where the page overrode them. Page-defined globals a… |
saveTo | boolean | string | Save the result to a file as JSON instead of returning it inline. Pass a file path, an existing directory (generated file inside), or true (generated file under ~/.firefox-mcp/output/). Relative paths… |
timeout | number | Timeout in ms (default: 5000) |