Firefox MCP

v0.11.1
io.github.mozilla/firefox-mcp Checked 1 hour ago Published 3 days ago

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

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.

ParameterTypeDescription
url *stringTarget URL
waitstringWhen to return: 'none' (navigation started), 'interactive' (DOMContentLoaded), 'complete' (load event fired, including subresources). Omit for the default: 'interactive' for http/https/data/blob/file,…

navigate_page

Navigate selected tab to URL.

ParameterTypeDescription
url *stringTarget URL
waitstringWhen 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.

ParameterTypeDescription
pageIdxnumberTab index (0-based, most reliable)
titlestringTitle substring (case-insensitive)
urlstringURL substring (case-insensitive)

close_page

Close tab by index.

ParameterTypeDescription
pageIdx *numberTab 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.

ParameterTypeDescription
maxLengthnumberMax characters to return inline (default: 20000). Ignored when saveTo is used.
previewnumberNumber of characters of the saved text to return inline as a preview when saveTo is used. Omit for no preview.
saveToboolean | stringSave 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.

ParameterTypeDescription
includeAllbooleanInclude all visible elements without relevance filtering. Useful for Vue/Livewire apps (default: false)
includeAttributesbooleanInclude ARIA attributes (default: false)
includeTextbooleanInclude text (default: true)
maxDepthnumberMax tree depth
maxLinesnumberMax lines (default: 100)
previewnumberNumber of characters of the saved output to return inline as a preview when saveTo is used. Omit for no preview.
saveToboolean | stringSave 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…
selectorstringCSS 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.

ParameterTypeDescription
uid *stringUID 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.

ParameterTypeDescription
gonebooleanWait until it disappears (default: false)
selectorstringCSS selector to wait for
textstringVisible text to wait for
timeoutnumberTimeout 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.

ParameterTypeDescription
uid *stringElement UID from snapshot
dblClickbooleanDouble-click (default: false)

hover_by_uid

Hover over element by UID.

ParameterTypeDescription
uid *stringElement UID from snapshot

fill_by_uid

Fill text input/textarea or pick a select option by UID.

ParameterTypeDescription
uid *stringInput element UID from snapshot
value *stringText 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).

ParameterTypeDescription
fromUid *stringSource element UID
toUid *stringTarget element UID

fill_form_by_uid

Fill multiple form fields at once.

ParameterTypeDescription
elements *arrayArray of {uid, value} pairs

upload_file_by_uid

Upload file to file input by UID.

ParameterTypeDescription
filePath *stringLocal file path
uid *stringFile 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.

ParameterTypeDescription
key *stringOne 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,…
uidstringFocusable 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.

ParameterTypeDescription
text *stringText to type
submitKeystringKey to press after the text, such as "Enter" or "Tab". Same syntax as press_key.
uidstringFocusable element UID from snapshot to focus before typing (default: the already focused element)

list_network_requests

List network requests, returning IDs for get_network_request. Filter by url/method/status; caps at limit (default 50); saveTo saves all matches to a file.

ParameterTypeDescription
detailstringDetail level (default: summary)
formatstringOutput format (default: text)
isXHRbooleanXHR/fetch only
limitnumberMax requests (default: 50)
methodstringHTTP method filter
previewnumberNumber of characters of the saved output to return inline as a preview when saveTo is used. Omit for no preview.
resourceTypestringResource type filter
saveToboolean | stringSave matching requests to a file as JSON instead of returning them inline. Saves full untruncated headers by default; pass detail=summary or min for a lean form, or an explicit limit to cap how many a…
sinceMsnumberOnly last N ms
sortBystringSort field (default: timestamp)
statusnumberExact status code
statusMaxnumberMax status code
statusMinnumberMin status code
urlContainsstringURL filter (case-insensitive)

get_network_request

Get request details by ID, including the response body (and request body when present). Large text bodies are truncated inline; binary bodies are summarized. URL lookup as fallback.

ParameterTypeDescription
formatstringOutput format (default: text)
idstringRequest ID from list_network_requests
previewnumberNumber of characters of the saved output to return inline as a preview when saveTo is used. Omit for no preview.
saveToboolean | stringSave the request details with full untruncated headers and bodies to a file as JSON instead of returning them inline (binary bodies are stored base64-encoded). Pass a file path, an existing directory…
urlstringURL fallback (may match multiple)

set_network_cache

Control the HTTP cache. Use behavior='bypass' so every request goes to the network — useful for performance measurement and for verifying a change that a cached asset would otherwise hide. Applies to the currently selected tab unless scope='global'. Persists until set back to 'default' or Firefox shuts down.

ParameterTypeDescription
behavior *string'bypass' to skip the cache, 'default' to restore normal caching
scopestring'tab' (default) applies to the selected tab; 'global' applies browser-wide

list_console_messages

List console messages, filterable by level, time, text, source. Caps at limit (default 50); saveTo saves all matches to a file.

ParameterTypeDescription
formatstringOutput format (default: text)
levelstringFilter by level
limitnumberMax messages (default: 50)
previewnumberNumber of characters of the saved output to return inline as a preview when saveTo is used. Omit for no preview.
saveToboolean | stringSave matching messages to a file in full (untruncated) instead of returning them inline. Saves all matching messages by default; pass an explicit limit to cap how many are saved. Pass a file path, an…
sinceMsnumberOnly last N ms
sourcestringFilter by source
textContainsstringText filter (case-insensitive)

clear_console_messages

Clear collected console messages.

screenshot_page

Capture viewport screenshot as base64 PNG. Set fullPage for the whole scrollable document.

ParameterTypeDescription
fullPagebooleanCapture the whole scrollable document (default: false)
saveToboolean | stringSave 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.

ParameterTypeDescription
uid *stringElement UID from snapshot
saveToboolean | stringSave 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.

ParameterTypeDescription
backgroundbooleanPrint background colors and images (default: false)
landscapebooleanUse landscape orientation (default: false)
saveToboolean | stringWhere 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.

ParameterTypeDescription
formatstringOutput format (default: text)
limitnumberMax downloads (default: 50)
statusstringFilter by status
urlContainsstringURL 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.

ParameterTypeDescription
behavior *string'allowed' saves downloads to `downloadFolder`, 'denied' cancels them, 'default' resets to the browser default
downloadFolderstringPath 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.

ParameterTypeDescription
promptTextstringText for prompt dialogs

dismiss_dialog

Dismiss browser dialog.

navigate_history

Navigate history back/forward. UIDs become stale.

ParameterTypeDescription
direction *stringback or forward

set_viewport_size

Set viewport dimensions in pixels. Applies to the selected tab only.

ParameterTypeDescription
height *numberHeight in pixels
width *numberWidth 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.

ParameterTypeDescription
grepstringFilter log lines containing this string (case-insensitive)
linesnumberNumber of recent log lines to return (default: 100, max: 10000)
sincenumberOnly 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.

ParameterTypeDescription
type *stringExtension data type: "archivePath" for .xpi/.zip, "base64" for encoded data, "path" for unpacked directory
pathstringFile path (for archivePath or path types)
permanentbooleanFirefox-specific: Install permanently (requires signed extension). Default: false (temporary install)
valuestringBase64-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.

ParameterTypeDescription
id *stringExtension ID (e.g., "addon@example.com")

list_extensions

List installed Firefox extensions using the WebDriver BiDi webExtension.moz:listExtensions command.

ParameterTypeDescription
idsarrayOptional: Filter by exact extension IDs (e.g., ["addon@example.com"])
isActivebooleanOptional: Filter by enabled (true) or disabled (false) status
namestringOptional: Filter by partial name match (case-insensitive, e.g., "shopify")

profiler_is_active

Check whether the Firefox profiler is currently recording.

profiler_start

Start the Firefox profiler. Provide either a preset name or explicit recording options (entries, interval, features, threads). Cannot combine both. Valid presets: web-developer, firefox-platform, graphics, media, ml, networking, power, debug.

ParameterTypeDescription
activeContextstringId of the top-level navigable to mark as the active tab in the profile. Does not restrict profiling to that tab.
entriesintegerNumber of entries to keep in the sampling buffer. Required when no preset is given.
featuresarrayProfiler features to enable. Required when no preset is given.
intervalnumberSampling interval in milliseconds. Required when no preset is given.
presetstringProfiler preset name. Cannot be combined with entries, interval, features, or threads.
threadsarrayThread names to profile. Required when no preset is given.

profiler_stop

Stop the Firefox profiler and save the recorded profile to a file in the downloads directory. Returns the path to the saved file, or null when nothing was saved.

ParameterTypeDescription
discardbooleanIf true, stop the profiler and discard the recording instead of saving it to disk. Defaults to false.

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.

ParameterTypeDescription
contextstringId of the top-level browsing context to record. Defaults to the currently selected page.
frameRateintegerTarget frame rate of the recording, in frames per second.
heightintegerHeight of the recorded video in pixels. Defaults to the viewport height.
mimeTypestringMIME type of the output file. Defaults to "video/webm".
widthintegerWidth 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.

ParameterTypeDescription
screencaststringId 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.

ParameterTypeDescription
function *stringJS function string, e.g. () => document.title
argsarrayUIDs to pass as function arguments, all from the same frame. With UIDs from an iframe, the function runs in that iframe.
previewnumberNumber of characters of the saved result to return inline as a preview when saveTo is used. Omit for no preview.
sandboxstringEvaluate 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…
saveToboolean | stringSave 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…
timeoutnumberTimeout in ms (default: 5000)

enable_debugger

Enable the JS debugger for the current page. Required before set_logpoint works. Requires Firefox 153+.

list_scripts

List all JavaScript files currently loaded in the page. Requires enable_debugger to have been called.

get_script_source

Get the source code of a JavaScript file loaded in the page. Requires enable_debugger to have been called.

ParameterTypeDescription
scriptUrl *stringURL of the script to retrieve.

set_logpoint

Set a logpoint at a specific location. When execution reaches that line, the expression is evaluated and the result is stored without pausing. Use get_logpoint_results to retrieve collected values. Requires enable_debugger to have been called.

ParameterTypeDescription
expression *stringJavaScript expression to evaluate each time the logpoint is hit.
line *numberLine number (1-based).
url *stringURL of the script.

remove_logpoint

Remove a previously set logpoint.

ParameterTypeDescription
logpoint *stringLogpoint id returned by set_logpoint.

get_logpoint_results

Get the results collected by a logpoint since it was set.

ParameterTypeDescription
logpoint *stringLogpoint id returned by set_logpoint.