Skip to main content
Glama

foxpilot-mcp

An MCP server that lets Claude (Claude Code, Claude Desktop) and other MCP clients control your real Firefox — your open tabs, your logins — over WebDriver BiDi. Works with Firefox forks such as Zen. No browser extension, no API keys, no tokens copied anywhere.

Official browser integrations for AI assistants are Chrome-only. Firefox already ships a standard remote-control protocol (WebDriver BiDi); foxpilot exposes it to the agent as a small set of tools.

Tools

Tool

What it does

firefox_tabs

List open tabs (id, title, URL, which one is visible)

firefox_open

Open a URL in a new tab, or navigate a given tab

firefox_search

Web search (Google, DuckDuckGo, Bing) in a new tab, returns result text

firefox_read

Page as text, or a numbered list of links/buttons/fields (mode=interactive)

firefox_find

Find text on the page with surrounding lines

firefox_click

Click by ref, CSS selector or visible text

firefox_type

Type into a field (replace or append), optionally press Enter

firefox_key

Press a key or combo (Enter, Escape, Meta+a, …)

firefox_scroll

Scroll up/down/top/bottom

firefox_wait

Wait for a selector or text

firefox_screenshot

PNG of the tab

firefox_eval

Run JavaScript in the page (fallback)

firefox_close

Close a tab

Related MCP server: zenpilot

Requirements

  • macOS (the launcher is macOS-only; the server itself is plain Node)

  • Firefox or a Firefox-based browser with WebDriver BiDi. Tested on Zen 1.24.3b; stock Firefox uses the same remote agent but was not tested yet.

  • Node.js 22.12+

Install

git clone https://github.com/SDH4114/foxpilot-mcp.git
cd foxpilot-mcp
npm install

1. Start the browser with remote debugging

The browser must be started with --remote-debugging-port 9222. It listens on 127.0.0.1 only, and Firefox rejects connections from web pages (Host/Origin checks).

open -a Firefox --args --remote-debugging-port 9222   # or: open -a Zen ...

open -a … --args is ignored if the browser is already running. Easier: build a launcher app and use it instead of the normal icon. If the browser is running without the flag, it offers to restart it (tabs are restored):

npm run launcher            # creates ~/Applications/Firefox (AI).app
npm run launcher -- Zen     # creates ~/Applications/Zen (AI).app

2. Connect to Claude

Claude Code (all projects):

claude mcp add -s user foxpilot -- "$(which node)" "$PWD/src/server.js"

Claude Desktop: add to ~/Library/Application Support/Claude/claude_desktop_config.json, use absolute paths, then restart Desktop:

{
  "mcpServers": {
    "foxpilot": {
      "command": "/absolute/path/to/node",
      "args": ["/absolute/path/to/foxpilot-mcp/src/server.js"]
    }
  }
}

Any other MCP client: run node src/server.js over stdio.

Then ask, for example: "Open GitHub in my browser and list my repositories."

Configuration

Env var

Default

Meaning

FOXPILOT_PORT

9222

Remote debugging port

FOXPILOT_IDLE_MS

8000

End the browser session after this much idle time

Things to know

  • One controller at a time. Firefox allows a single WebDriver BiDi session. foxpilot connects only while it works and lets go after FOXPILOT_IDLE_MS, so Claude Code and Claude Desktop can take turns. If a client is killed hard (kill -9), Firefox keeps the stale session until the browser restarts.

  • While the port is open, any program on your Mac can control the browser. Web pages cannot.

  • The agent acts with your logins. Keep an eye on what it does on sensitive sites.

Tests

End-to-end smoke test through a real MCP client (opens and closes a few tabs). Run it against a throwaway headless instance, not your main browser:

/Applications/Firefox.app/Contents/MacOS/firefox --profile /tmp/foxpilot-test --no-remote --headless --remote-debugging-port 9333 &
FOXPILOT_PORT=9333 npm run smoke

(For Zen: /Applications/Zen.app/Contents/MacOS/zen with the same flags.)

Project structure

src/server.js            MCP server and tool definitions
src/firefox.js           BiDi connection lifecycle, tab ids
src/page.js              code that runs inside the page (text, interactive refs, find)
scripts/smoke.mjs        end-to-end test
scripts/make-launcher.sh builds the "<Browser> (AI)" app
launcher/                AppleScript source of the launcher

License

MIT

Available Tools

13 tools
firefox_clickA

Click an element by ref (from firefox_read interactive), CSS selector, or visible text.

Inputs: ref, text, tabId, selector.

firefox_closeA

Close a tab. Only close tabs you opened, unless the user asked.

Inputs: tabId (required).

firefox_evalA

Run a JavaScript expression in the page and return the JSON result. Fallback when other tools are not enough.

Inputs: js (required), tabId.

firefox_findA
Read-only

Find text on the current page; returns matching lines with context.

Inputs: query (required), tabId.

firefox_keyB

Press a key or combo in the page, e.g. "Enter", "Escape", "Tab", "ArrowDown", "Meta+a".

Inputs: key (required), tabId.

firefox_openA

Open a URL in the user's Firefox browser. Opens a new tab unless tabId is given (then navigates that tab).

Inputs: url (required), tabId.

firefox_readA
Read-only

Read the page. mode=text: visible text (paged by offset). mode=interactive: numbered list of links, buttons and fields; use the numbers as ref in firefox_click/firefox_type.

Inputs: mode, tabId, offset.

firefox_screenshotA
Read-only

Screenshot of the tab (PNG). Use only when the visual layout matters; prefer firefox_read.

Inputs: tabId, fullPage.

firefox_scrollC

Scroll the page.

Inputs: direction (required), tabId.

firefox_tabsA
Read-only

List open tabs in the user's Firefox browser (id, title, url; * = visible, > = current target).

Inputs: no named parameters.

firefox_typeA

Type into a field (by ref or selector). Replaces existing value unless append=true. submit=true presses Enter after.

Inputs: value (required), ref, tabId, append, +2 more.

firefox_waitB
Read-only

Wait until a selector or text appears on the page.

Inputs: text, tabId, selector, timeoutMs.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 13 tools

    Disambiguation4/5

    Each tool maps to a clear browser action (open, close, click, type, scroll, etc.), and descriptions distinguish related tools like firefox_read vs firefox_find. Minor overlap exists: firefox_read in text mode and firefox_find both extract page text, and firefox_eval is a catch-all that could duplicate almost anything, though it's framed as a fallback.

    Naming Consistency4/5

    All tools share the firefox_ prefix, giving a predictable, scannable namespace. The suffix is mostly a verb (open, close, search, read, click), but firefox_tabs is a noun rather than an action verb, a minor deviation from the otherwise consistent pattern.

    Tool Count5/5

    Thirteen tools is well within a healthy range and each one covers a distinct browser primitive (tabs, navigation, reading, interaction, waiting, screenshot, eval). No obvious redundancy or padding.

    Completeness4/5

    The surface covers the full browser-control lifecycle: open/close tabs, search, read, find, click, type, key, scroll, wait, screenshot, and JS eval. Minor gaps remain, such as explicit back/forward history navigation, hover, and dropdown selection, though these can be worked around via firefox_key or firefox_eval.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      B
      maintenance
      Enables browser automation and control through ZenLink, allowing Claude Desktop and other MCP clients to drive a Zen Browser with 75+ tools for navigation, content extraction, interaction, parallel multi-tab operations, and session management.
      100
      30 PyPI
      1
      MIT
    • A
      license
      A
      quality
      A
      maintenance
      An MCP server that enables Claude Desktop and Claude Code to drive a running Zen Browser over WebDriver BiDi, letting Claude list, open, switch, and close tabs, navigate pages, read page content, click, type, scroll, take screenshots, and extract text from a live browser session.
      26
      186 PyPI
      11
      MIT
    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables Claude Code to control a real browser for navigation, interaction, screenshots, accessibility snapshots, network and console monitoring, and automated end-to-end testing through MCP tools.
      106 npm
      MIT
    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables Claude Code to drive a real Firefox browser through a local MCP server using synthetic DOM events for clicks and typing. Supports tab management, navigation, page reading, form interaction, screenshots, and per-site consent with no network port opened.
      4 npm
      1
      MIT