firefox-mcp
Allows controlling a running, signed-in Firefox browser via WebDriver BiDi: list, open, close and activate tabs, navigate, screenshot, read page content and refs, click, hover, drag, type, fill forms, evaluate JavaScript, read console and network logs, resize the viewport, and wait.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@firefox-mcp Summarize the text on my active Firefox tab"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
firefox-mcp
Claude in Chrome, but for Firefox. An MCP server that attaches to your running, signed-in Firefox over WebDriver BiDi and gives Claude Code the same kind of tools: list and open tabs, navigate, screenshot, read the page as refs, click, type with real key events, fill forms, evaluate JS, read the console and network log.
No Playwright, no Puppeteer, no bundled browser. Node 22 (global WebSocket), the MCP SDK and
zod. Everything else is the BiDi protocol Firefox ships with.
Setup
Install once:
git clone https://github.com/surpasses/firefox-mcp ~/firefox-mcp cd ~/firefox-mcp && npm install claude mcp add --scope user firefox -- node ~/firefox-mcp/server.mjsFirefox only reads the remote-debugging flag at startup, so relaunch it with the helper. Your normal profile, tabs and logins are kept (session restore):
~/firefox-mcp/bin/firefox-debug --restartWithout
--restartit just tells you to quit Firefox first. Firefox shows a small robot icon in the URL bar while the remote agent is on. It listens on127.0.0.1only.In Claude Code, the tools appear as
mcp__firefox__*. Start withtabs_context.
Port defaults to 9222; override with FIREFOX_MCP_PORT for both the launcher and the server.
Related MCP server: claude-in-firefox
Tools
Tool | What it does |
| List tabs: id, url, title, active marker. Ids are stable while the server runs. |
| Open (optionally with a URL), close, focus a tab. |
| URL, |
| Viewport PNG. |
| Elements with refs ( |
| Regex over name/label/placeholder/id/href, or a CSS |
| Visible text, all frames. |
| By ref (scrolled into view first) or by viewport coordinates. Modifiers, double and triple click. |
| Real key events into the focused element or a ref. |
|
|
| Set a value directly (fires input/change): text, select, checkbox, radio, contenteditable. |
| Wheel scroll at a point or ref; scroll a ref into the centre. |
| Run a JS expression, optionally inside a frame ( |
| Buffered since connect, regex-filterable, |
| Set the viewport size (phone widths etc.). |
| Sleep up to 10 s. |
Frames and Fission
Firefox runs cross-origin iframes out of process ("Fission"). Input actions sent to the top
frame's context reach the <iframe> element but are never routed into the child process, and
focusing a child field by script then typing on the top frame does not work either.
This server therefore treats frames as first class: read_page and find walk every frame and
prefix refs with the frame key; every click, hover, scroll and keystroke is dispatched on the
context of the frame that owns the target (by ref, by hit-testing the coordinates against the
frame rectangles, or by following the focused <iframe> chain for typing). Shopify's hosted
checkout card fields, Stripe Elements and similar embedded forms work through the normal
click and type tools.
Test
npm testBoots a throwaway headless Firefox on port 9333 with its own profile (your real Firefox is untouched), serves a two-origin fixture, and checks tabs, navigation, snapshot, refs, form input, real typing, cross-origin iframe input, screenshots, page text, console and network capture, history and tab close.
Not there yet
GIF recording of a sequence of actions.
Natural-language
find(the Chrome one calls a model);findhere is regex or CSS.Downloads and file uploads.
Multiple simultaneous BiDi clients: Firefox allows one session, so run one server at a time.
Available Tools
22 toolsclickA
Click an element by ref (scrolled into view first) or at viewport coordinates. count=2 double-clicks, count=3 triple-clicks (select paragraph). modifiers like 'shift' or 'cmd+shift'.
Inputs: tabId (required), x, y, ref, +3 more.
dragC
Drag with the left mouse button from one point to another.
Inputs: toX (required), toY (required), fromX (required), fromY (required), +1 more.
evaluateA
Evaluate a JavaScript expression in the page (top frame by default) and return its value. Use frame (e.g. f1) to target an iframe. Never trigger alert/confirm/prompt.
Inputs: tabId (required), expression (required), frame.
findA
Find elements by text, label, placeholder, id, name or href (case-insensitive regex), or by CSS selector. Returns up to 20 refs per frame.
Inputs: query (required), tabId (required), selector.
form_inputA
Set a form control's value directly (fires input/change): text/textarea, select (option text or value), checkbox/radio (true/false), contenteditable. Prefer type for fields that validate on keystrokes (card numbers).
Inputs: ref (required), tabId (required), value (required).
get_page_textA
Visible text of the page (innerText), including frames. Up to ~80k chars per frame.
Inputs: tabId (required).
hoverA
Move the mouse over an element (by ref) or a point, to reveal menus and tooltips.
Inputs: tabId (required), x, y, ref.
press_keyA
Press keys: 'Enter', 'Tab', 'Escape', 'ArrowDown', 'cmd+a', 'shift+Tab', or several space-separated ('Backspace Backspace Enter'). repeat repeats the whole sequence.
Inputs: keys (required), tabId (required), repeat.
read_consoleA
Console messages and uncaught errors buffered since the server connected. pattern is a regex filter; clear=true empties the buffer after reading.
Inputs: clear, limit, tabId, pattern.
read_networkB
Network requests buffered since the server connected: method, status, mime, url. pattern filters url/status/mime by regex.
Inputs: clear, limit, tabId, pattern.
read_pageA
List page elements with refs for click/type/form_input. filter=interactive (default) lists controls and links; filter=all adds headings and text. Crosses into iframes (refs prefixed fN:).
Inputs: tabId (required), filter, maxItems.
resize_viewportA
Set the tab's viewport size in CSS pixels (e.g. 390x844 for phone).
Inputs: tabId (required), width (required), height (required).
screenshotB
Screenshot the visible viewport as PNG. region [x0,y0,x1,y1] crops (zoom). savePath also writes the file.
Inputs: tabId (required), region, savePath.
scrollB
Scroll with the mouse wheel at a point (default viewport centre) or over a ref. amount = wheel ticks of 100px.
Inputs: tabId (required), direction (required), x, y, +2 more.
scroll_toA
Scroll an element (by ref) into the centre of the viewport.
Inputs: ref (required), tabId (required).
tabs_activateB
Bring a tab to the front.
Inputs: tabId (required).
tabs_closeC
Close a tab.
Inputs: tabId (required).
tabs_contextA
List Firefox tabs (id, url, title, active). Call this first; tab ids are stable while the server runs.
Inputs: no named parameters.
tabs_createA
Open a new tab, optionally navigating to a URL. Returns its tab id.
Inputs: url.
typeA
Type text with real key events into the focused element, or into ref (clicked first). clear=true selects all and deletes first. pressEnter=true submits.
Inputs: text (required), tabId (required), ref, clear, +1 more.
waitA
Wait N seconds (max 10) for the page to settle.
Inputs: seconds (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 22 tools
Each tool targets a distinct browser automation concern—tab management, navigation, element discovery, input, scrolling, and diagnostics—so an agent can reliably select the right one. Even similar tools like read_page and find have clear separation: one lists elements, the other searches by selector/text. No two tools appear to do the same job.
Naming is readable but mixes conventions: tabs_* forms a clear prefix group, read_* and get_* group read operations, while interaction tools use bare verbs like click, type, scroll, and hover. This category-based pattern is understandable but not a uniform verb_noun convention.
At 22 tools, the set is comprehensive but on the heavy side, falling into the borderline range for a single server. Most tools are individually justified for browser automation, yet some input-related tools (type, form_input, press_key) could potentially be consolidated.
The surface covers tab lifecycle, navigation, element interaction, scrolling, screenshots, scripting, and diagnostics, which is strong coverage for browser automation. Minor gaps like explicit cookie management, file upload, or waiting for a specific element exist, but agents can work around them with evaluate and wait.
Related MCP Connectors
Control a real browser from AI agents: navigate, click, type, screenshot, read the page.
Give AI agents a real cloud Chrome: open sessions, navigate, read pages, click, type and screenshot.
Live browser debugging for AI assistants — DOM, console, network via MCP.
Stealth web automation for AI agents. Login, signup, navigate, screenshot.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceEnables Claude Code to drive a local Firefox browser: opening and managing tabs, navigating, reading page structure and text, clicking, typing, filling forms, running JavaScript, taking screenshots, and inspecting console messages and network requests. Everything runs over a local Unix socket with no network traffic, and actions are restricted to tabs explicitly placed under Claude's control.GPL 3.0
- AlicenseNot gradedqualityBmaintenanceEnables Claude Code to control Firefox through tools for tabs, navigation, clicks, typing, scrolling, screenshots, page reading, forms, JavaScript, and console/network logs.MIT
- AlicenseNot gradedqualityCmaintenanceEnables Claude Code to control the user's real Firefox browser through a local MCP server, with tools for tabs, navigation, page reading, clicking, typing, forms, screenshots, and file uploads under per-site consent.MIT
- FlicenseBqualityBmaintenanceEnables Claude Code to control Firefox by listing and managing tabs, navigating, taking screenshots, reading pages, clicking and typing, and inspecting console and network activity through a local bridge.18-