firefox-devtools-mcp-moz

v0.10.7
@mozilla/firefox-devtools-mcp-moz Checked 5 hours ago Published 1 month ago

Model 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.

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-devtools-mcp/output/)…

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-d…
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

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 by UID.

ParameterTypeDescription
uid *stringInput element UID from snapshot
value *stringText to fill

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)

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-devtools-…

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-devtools-…

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-devtools-mcp/output/). Relative paths resolve against the cu…

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-devtools-mcp/output/downloads. Relative paths resolve against…

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")

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
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-devtools-mcp/output/). Relat…
timeoutnumberTimeout in ms (default: 5000)