Skip to main content
Glama
firefox-bidi-mcp
by n0rthstar88

firefox-bidi-mcp

Let an AI agent drive your everyday Firefox, with your real profile, tabs and logins, instead of a separate automation browser. It's a small MCP server that talks to Firefox's built-in WebDriver BiDi remote control, so it works with any MCP client.

No browser extension is involved, so nothing needs signing by Mozilla.

Why not an extension?

Release Firefox only installs add-ons that Mozilla has signed, and many agent browser extensions are Chrome-only. Firefox already has a standard remote-control protocol, so this uses that: start Firefox with --remote-debugging-port, and the server connects to it on 127.0.0.1.

Related MCP server: Browser Control MCP

Install

Linux, Firefox 129 or newer, Node.js 18 or newer.

git clone https://github.com/n0rthstar88/firefox-bidi-mcp
cd firefox-bidi-mcp
./install.sh

The installer prints the server entry to add to your MCP client. Then quit Firefox completely (Ctrl+Q), start it again, and restart your MCP client. While remote control is on, Firefox shows a robot icon and a striped address bar.

install.sh sets up three things, and ./uninstall.sh removes them:

What

Where

Why

Wrapper

~/.local/share/firefox-bidi-mcp/bin/firefox

Starts the real Firefox with --remote-debugging-port=9222

Desktop entry

~/.local/share/applications/firefox.desktop

Your launcher, and links from other apps, start Firefox through the wrapper

Profile pref

user.js in your default profile

remote.prefs.recommended=false, see below

The wrapper is named firefox on purpose. Some launchers, such as Omarchy's, read only the first word of the desktop entry's Exec line and focus the window by that command's name.

The profile pref matters

When remote control is on, Firefox applies its automation defaults unless told not to. Those defaults turn off Safe Browsing (phishing and malware protection), the popup blocker and updates. That's fine for a test browser, but not for the one you use every day, so the installer sets remote.prefs.recommended to false.

Adding it to your MCP client

Run node /path/to/firefox-bidi-mcp/server.js as a stdio MCP server. For clients that read an mcpServers config:

"firefox": {
  "command": "node",
  "args": ["/path/to/firefox-bidi-mcp/server.js"],
  "env": { "FIREFOX_BIDI_PORT": "9222" }
}

To use a port other than 9222, set FIREFOX_BIDI_PORT for both install.sh and the server.

Tools

Tool

Does

tabs_list, tab_select, tab_new, tab_close

Manage tabs. Tools act on the "current" tab, which starts as the one you're looking at

navigate

Go to a URL, or back, forward, reload

read_page

List visible links, buttons and fields with short refs (e1, e2, ...) plus headings

get_text

Readable text of the page or one element

screenshot

PNG of the visible page; its pixels match click's x/y

click, type, press_key, select_option

Interact by ref, CSS selector or coordinates

scroll, wait_for

Scroll by a screen or to an element; wait for a selector or text

evaluate

Run JavaScript in the page

If a click, a typed search or a key press opens a new tab, the tool switches to that tab and says so, so the next step happens where the result is.

Things to know

  • One session at a time. Firefox allows a single remote session, so two agent sessions can't control it together. The server connects on first use and lets go when the session ends.

  • Local access. The port listens on 127.0.0.1 only, but any program running as you can use it while Firefox is open, as with any local browser automation bridge. Remove it with ./uninstall.sh if that's not acceptable.

  • Brand-new profiles. On a profile's very first launch, Firefox's "open tab" command can stall. Every tool gives up after 45 seconds, so the client never hangs; it works from the second launch on.

  • Firefox updates. The desktop entry is a copy, so it doesn't change when your Firefox package does. Re-run ./install.sh after a big update if the menu entry looks out of date.

Tests

npm test          # throwaway headless Firefox on port 9333; your browser isn't touched
node test/live.mjs  # against your running Firefox: opens and closes test tabs

License

MIT

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      B
      maintenance
      Enables AI agents to drive a user-launched Firefox instance via its native Marionette protocol, providing precise DOM actuation like clicking, typing, uploading files, taking screenshots, and evaluating JavaScript.
      18
      35 npm
      1
      GPL 2.0
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI assistants to operate a real, logged-in Firefox session through an extension, including tab and history management, page reading, screenshots, and clicking, typing, or scrolling on domains the user approves.
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Let AI agents use the Firefox, Zen, or LibreWolf browser you already have open, with your logins, cookies, and extensions intact. No Playwright, Chromium, or WebDriver. Agents work in background tabs while you keep browsing: read pages, click, fill forms, take screenshots, and capture network traffic. A WebExtension plus a local bridge lets several agents share one browser.
      6
      584 PyPI
      48
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents to read and control the user's real Firefox-based browser using existing logins, cookies, and open tabs, while restricting access to only the windows, tabs, rights, and time the user explicitly grants.
      MIT