Skip to main content

fx-audit-mcp

MCP tools for Firefox security auditing. Provides async Python tools and a FastMCP server for running testcases in Firefox and SpiderMonkey, building Firefox and NSS with ASAN, and querying Bugzilla — all with structured Pydantic return types suitable for use with LLM agent frameworks.

Tools

Tool Description
browser_evaluator Run a multi-file testcase in ASAN Firefox via grizzly replay, detect crashes
package_testcase Bundle a testcase directory with prefs and env into a grizzly TestCase
js_shell_evaluator Run a JS testcase in the SpiderMonkey shell, detect crashes and sanitizer output
nss_gtest_evaluator Run an NSS GTest and report any ASan crash
build_firefox Build Firefox via mach build with a specified MOZCONFIG
build_nss Build NSS with ASAN via security/nss/build.sh
search_bugs Search Bugzilla using raw REST query parameters
get_bugs Fetch bugs by ID in bulk
get_bug_comments Fetch all comments for a single bug
get_bug_attachments Fetch attachments for a bug

Installation

pip install fx-audit-mcp

Requires Python 3.12+.

Usage

As Python functions

The execution tools (browser, JS shell, NSS gtest, Firefox/NSS build) are async functions with structured Pydantic return types. The Bugzilla tools are only available via the MCP server (see below).

import asyncio
from pathlib import Path
from fx_audit_mcp import browser_evaluator, js_shell_evaluator

async def main():
    result = await browser_evaluator(
        # Maps the name each file takes in the testcase to its path on disk,
        # so testcases may span several files and include binary assets.
        # Use forward slashes for subdirectories ("sub/frame.html").
        file_paths={
            "test.html": Path("/repro/test.html"),
            "boom.js": Path("/repro/boom.js"),
            "font.woff2": Path("/repro/font.woff2"),
        },
        entry_point="test.html",
        firefox_binary=Path("/path/to/obj-firefox-asan/dist/bin/firefox"),
        timeout=30,
    )
    print(result.crashed, result.message)
    if result.logs:
        print(result.logs.crashdata[:500])

asyncio.run(main())

As an MCP server

fx-audit-mcp exposes all execution tools (browser, JS shell, NSS gtest, Firefox/NSS build) as an MCP server over stdio:

fx-audit-mcp

fx-audit-bugzilla-mcp exposes the Bugzilla query tools separately:

BUGZILLA_API_KEY=your_key fx-audit-bugzilla-mcp

Set BUGZILLA_URL to override the default Mozilla Bugzilla instance.

Claude Desktop / Claude Code .mcp.json example:

{
  "mcpServers": {
    "fx-audit": {
      "command": "fx-audit-mcp",
      "env": {
        "FIREFOX_SOURCE_ROOT": "/path/to/firefox",
        "FIREFOX_BINARY": "/path/to/firefox/obj-firefox-asan/dist/bin/firefox"
      }
    },
    "fx-audit-bugzilla": {
      "command": "fx-audit-bugzilla-mcp",
      "env": {
        "BUGZILLA_API_KEY": "your_key_here"
      }
    }
  }
}

With pydantic-ai

Tools integrate directly with pydantic-ai agents:

from pydantic_ai import Agent
from fx_audit_mcp import browser_evaluator, js_shell_evaluator

agent = Agent(
    "anthropic:claude-opus-4-7",
    tools=[browser_evaluator, js_shell_evaluator],
)

Environment Variables

Variable Used by Description
BUGZILLA_API_KEY fx-audit-bugzilla-mcp Required; your Bugzilla API key
BUGZILLA_URL fx-audit-bugzilla-mcp Bugzilla REST base URL (default: Mozilla's)
FIREFOX_SOURCE_ROOT fx-audit-build-firefox Default --firefox-dir for the CLI entry point

Crash Detection

  • browser_evaluator: Crash signatures in ignored_signatures/ (FuzzManager format) are filtered out before returning, so common shutdown hangs don't pollute results.
  • js_shell_evaluator: Detects crashes via negative exit code (signal) or AddressSanitizer/UndefinedBehaviorSanitizer in stderr. JS errors (positive exit codes) are not treated as crashes.
  • nss_gtest_evaluator: Detects AddressSanitizer in stdout or stderr.

Development

# Install with dev dependencies
uv sync --group dev

# Run tests
uv run pytest

# Lint and format
uv run ruff check --fix .
uv run ruff format .

# Type check
uv run mypy src/

# Install pre-commit hooks
uv run pre-commit install

License

Mozilla Public License 2.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fx_audit_mcp-2.0.0.tar.gz (150.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fx_audit_mcp-2.0.0-py3-none-any.whl (24.3 kB view details)

Uploaded Python 3

File details

Details for the file fx_audit_mcp-2.0.0.tar.gz.

File metadata

  • Download URL: fx_audit_mcp-2.0.0.tar.gz
  • Upload date:
  • Size: 150.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for fx_audit_mcp-2.0.0.tar.gz
Algorithm Hash digest
SHA256 08cc3bf6401344ac0c960b8f311622581c1aa70a9fea2c7ca9a24e4fb7ac0828
MD5 44583469c6756fdb4323eb3108b2efcc
BLAKE2b-256 3e27311309666a94efdb9cf71b9f7fe25a909b46ff0254906186f3ea18e64d58

See more details on using hashes here.

Provenance

The following attestation bundles were made for fx_audit_mcp-2.0.0.tar.gz:

Publisher: ci.yml on MozillaSecurity/fx-audit-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fx_audit_mcp-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: fx_audit_mcp-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 24.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for fx_audit_mcp-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b3598392cb917cfb5ea099addbf6ac8eb866dd40f7b122430ee95a4e21951e7e
MD5 e371c0cba6ce6fcca6867f408fa9666a
BLAKE2b-256 e55dfa6aaeed93202b8e9561f22c27021f6388ebf445f91e64bca270c8a1acbc

See more details on using hashes here.

Provenance

The following attestation bundles were made for fx_audit_mcp-2.0.0-py3-none-any.whl:

Publisher: ci.yml on MozillaSecurity/fx-audit-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

4.0.0

2 files

3.0.0

2 files

2.1.0

2 files

This release

2.0.0 This release

2 files

1.4.2

2 files

1.4.1

2 files

1.4.0

2 files

1.3.0

2 files

1.2.4

2 files

1.2.3

2 files

1.2.2

2 files

1.2.1

2 files

1.2.0

2 files

1.1.2

2 files

1.1.1

2 files

1.1.0

2 files

1.0.2

2 files

1.0.1

2 files

1.0.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page