Skip to main content
Glama
Johnnyzlee

Firefox Tab Management Agent MCP

by Johnnyzlee

Agent Bridge for Tab Management in Firefox

简体中文

A local-first toolkit that gives trusted AI agents precise access to tabs and native tab groups in the user's live Firefox session.

This repository distributes three cooperating components:

Component

Directory

Required

Purpose

Tab Management Agent Bridge for Firefox

extension/

Yes

Calls Firefox's native tabs and tabGroups APIs

Firefox Tab Management Agent MCP

mcp-server/

Yes

Exposes a small, authenticated MCP tool surface over stdio

Firefox Tab Manager Skill

skills/firefox-tab-manager/

Optional

Teaches compatible agents the exact-match and verification workflow

The MCP server provides the capability. The Agent Skill provides behavior guidance. The browser extension is the only component that talks to Firefox. They are complementary, not alternatives.

What it can do

  • List live tabs and native tab groups with stable IDs.

  • Open explicit http:// and https:// URLs without stealing focus by default.

  • Create an exactly named group from ungrouped tabs in one window.

  • Move a precisely selected tab into an existing group.

  • Ungroup a precisely selected tab.

  • Reject ambiguous matches, duplicate group names, cross-window grouping, and implicit unpinning.

  • Read Firefox state again after every write and report success only after verification.

It does not read page bodies, inject content scripts, execute arbitrary page JavaScript, inspect cookies, or send browser data to a project-operated remote service.

Related MCP server: mcp-browser

A practical workflow: collect now, read later

Suppose you come across useful articles, documentation, or research links while browsing a feed, chatting, or working on another device. You want to read them carefully later in desktop Firefox, but opening and organizing every page yourself would interrupt the current task and leave the browser full of loose tabs.

Send the URLs to a connected agent such as Hermes instead:

Open these URLs in Firefox in the background. Put every new tab in the exact
group "Reading Queue", creating that group only if it does not exist, and
verify the final tab and group IDs.

The agent opens the pages without taking focus and keeps them together in one dedicated group. You can continue what you are doing, then later sit down at the computer and work through the group as a focused reading queue. This turns Firefox tab groups into an inbox for the web: less clutter, less context switching, and less time spent manually organizing tabs.

Five-minute setup

Version 0.3.1 includes a Mozilla-reviewed and production-signed XPI in the GitHub Release. It upgrades v0.3.0 in place under the same signed Gecko ID, preserving the extension's local settings while adopting the current Tab Management Agent Bridge for Firefox name.

1. Install the signed extension

  1. Download tab_management_agent_bridge_for_firefox-0.3.1-mozilla-signed.xpi from the v0.3.1 Release.

  2. Open the XPI with Firefox and approve the installation prompt.

  3. The Mozilla-signed extension remains installed after Firefox restarts.

2. Clone and prepare the MCP server and Skill

git clone https://github.com/Johnnyzlee/agent-bridge-for-tab-management-in-firefox.git
cd agent-bridge-for-tab-management-in-firefox
npm run quickstart

quickstart installs the locked dependencies, builds the MCP server and a development copy of the extension, preserves an existing local token when rerun, and generates:

  • .local/bridge-token.txt

  • .local/mcp-config.json

  • dist/server/index.js

  • dist/firefox-extension/manifest.json

The .local/ directory is ignored by Git. Treat its token as a local secret.

3. Configure the extension

Open Tab Management Agent Bridge for Firefox preferences, keep port 8765, paste the token from .local/bridge-token.txt, and select Save and reconnect.

For source development only, you may instead open about:debugging#/runtime/this-firefox, select Load Temporary Add-on, and choose dist/firefox-extension/manifest.json. Firefox removes that temporary build after each restart; do not load it alongside the signed extension on the same port.

4. Connect an MCP client

For clients using the common mcpServers JSON format, merge the generated .local/mcp-config.json into the client's configuration and restart the client.

For Codex, run the generated helper and then restart Codex:

.local/add-to-codex.sh

PowerShell users can run .local/add-to-codex.ps1. These ignored local files contain the token, so do not share them. If an MCP entry named firefox-tabs already exists, remove or update that old entry before running the helper.

The equivalent generic configuration is:

{
  "mcpServers": {
    "firefox-tabs": {
      "command": "node",
      "args": ["/absolute/path/to/agent-bridge-for-tab-management-in-firefox/dist/server/index.js"],
      "env": {
        "FIREFOX_TABS_BRIDGE_PORT": "8765",
        "FIREFOX_TABS_BRIDGE_TOKEN": "<same-token-as-the-extension>"
      }
    }
  }
}

Version 0.3.1 uses one bridge port, so only one stdio MCP client can own the connection at a time. Stop Codex before handing the same port to another client such as Hermes.

5. Optionally install the Agent Skill

MCP is sufficient for calling the tools. Install the Skill when the agent host supports SKILL.md packages and you want consistent exact matching, guarded failures, and post-operation verification.

For Codex:

mkdir -p "${CODEX_HOME:-$HOME/.codex}/skills"
cp -R skills/firefox-tab-manager "${CODEX_HOME:-$HOME/.codex}/skills/"

Restart the agent after installation. For another agent host, copy skills/firefox-tab-manager/ into that product's documented skills directory. Skill formats are not standardized across all agents; hosts without SKILL.md support should use the MCP server alone.

6. Verify the connection

Ask the agent:

Check whether the Firefox bridge is connected, list the current tab groups,
open https://example.com, place the new tab into an exact group named Research,
creating it only if it does not exist, and verify the final group ID.

Architecture

flowchart LR
    A["AI agent + optional Skill"] -->|"stdio / MCP"| B["Firefox Tab Management Agent MCP"]
    B <-->|"127.0.0.1 WebSocket + shared token"| C["Tab Management Agent Bridge for Firefox"]
    C <-->|"tabs + tabGroups APIs"| D["Live Firefox session"]

The WebSocket listener binds only to loopback and accepts authenticated connections from a moz-extension:// origin. See architecture, security policy, and privacy policy.

MCP tools

Tool

Purpose

Writes browser state

get_firefox_bridge_status

Report bridge connectivity

No

list_firefox_tabs

List tab IDs, URLs, titles, windows, and group IDs

No

list_firefox_tab_groups

List current tab groups

No

open_firefox_tab

Open an explicit HTTP(S) URL and return its tab ID

Yes

create_firefox_tab_group

Create and verify a new group

Yes

move_firefox_tab_to_group

Move one exact tab to one exact existing group

Yes

ungroup_firefox_tab

Remove one exact tab from its group

Yes

Development

Requirements: Firefox 142 or newer, Node.js 20 or newer, and npm.

npm ci
npm run check

The tests cover URL restrictions, exact matching, ambiguous-tab rejection, duplicate groups, cross-window grouping, pinned-tab protection, no-op success, ungrouping, WebSocket origin checks, token authentication, and request timeouts.

Maintainers should follow the release checklist and AMO reviewer guide. Build archives are release artifacts and are intentionally excluded from Git.

Contributing and license

Read CONTRIBUTING.md before opening a pull request. Security reports should follow SECURITY.md, not public issues.

Licensed under the Mozilla Public License 2.0. “Firefox” is used to identify compatibility with Mozilla Firefox; this project is independent and is not endorsed by Mozilla.

Install Server
A
license - permissive license
-
quality - not tested
A
maintenance

Maintenance

Maintainers
Response time
0dRelease cycle
2Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • F
    license
    -
    quality
    C
    maintenance
    Exposes Playwright browser automation as MCP tools, enabling AI assistants to control a real browser tab-by-tab for form filling, navigation, and more, while preserving the user's active session.
  • A
    license
    -
    quality
    B
    maintenance
    Enables MCP-compatible AI agents to securely control Chrome tabs via a local bridge, with explicit per-tab sharing and human approval for consequential actions.
    MIT

View all related MCP servers

Related MCP Connectors

  • Live browser debugging for AI assistants — DOM, console, network via MCP.

  • A paid remote MCP for AI agent browser DevTools MCP, built to return verdicts, receipts, usage logs,

  • Browser MCP for logged-in tasks. Uses your Chrome — credentials stay local. Zero-token replay.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Johnnyzlee/agent-bridge-for-tab-management-in-firefox'

If you have feedback or need assistance with the MCP directory API, please join our Discord server