Firefox security audit MCP tools
Project description
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 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(
content="<script>crashMe()</script>",
filename="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/UndefinedBehaviorSanitizerin stderr. JS errors (positive exit codes) are not treated as crashes. - nss_gtest_evaluator: Detects
AddressSanitizerin 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
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fx_audit_mcp-1.0.1.tar.gz.
File metadata
- Download URL: fx_audit_mcp-1.0.1.tar.gz
- Upload date:
- Size: 148.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f0395cf27e70903cd50357c09db552f387e0226a4d463df1e8f72c375a96d201
|
|
| MD5 |
858fb7136f7ab127fcc0b082a19c23e5
|
|
| BLAKE2b-256 |
fbb75786cd2255ced5e7cd431fc8b5e132397906fb3b57a556178a01bdc30c12
|
Provenance
The following attestation bundles were made for fx_audit_mcp-1.0.1.tar.gz:
Publisher:
ci.yml on MozillaSecurity/fx-audit-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fx_audit_mcp-1.0.1.tar.gz -
Subject digest:
f0395cf27e70903cd50357c09db552f387e0226a4d463df1e8f72c375a96d201 - Sigstore transparency entry: 1631109641
- Sigstore integration time:
-
Permalink:
MozillaSecurity/fx-audit-mcp@4718d5476a0e2e5fb80e8f4dcf144dec948115cc -
Branch / Tag:
refs/heads/main - Owner: https://github.com/MozillaSecurity
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@4718d5476a0e2e5fb80e8f4dcf144dec948115cc -
Trigger Event:
push
-
Statement type:
File details
Details for the file fx_audit_mcp-1.0.1-py3-none-any.whl.
File metadata
- Download URL: fx_audit_mcp-1.0.1-py3-none-any.whl
- Upload date:
- Size: 25.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ef7b283482f3d3197ae9b09fcc02488323457c53ef2aad75eb19bd2a8a7bf000
|
|
| MD5 |
1dce5e70c9c751e34f22d8efc6bbcf55
|
|
| BLAKE2b-256 |
593b4a5c95a8b0182400f746af6ed60617d44b9373b2437ca9aa9aa99e53ca4f
|
Provenance
The following attestation bundles were made for fx_audit_mcp-1.0.1-py3-none-any.whl:
Publisher:
ci.yml on MozillaSecurity/fx-audit-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fx_audit_mcp-1.0.1-py3-none-any.whl -
Subject digest:
ef7b283482f3d3197ae9b09fcc02488323457c53ef2aad75eb19bd2a8a7bf000 - Sigstore transparency entry: 1631109649
- Sigstore integration time:
-
Permalink:
MozillaSecurity/fx-audit-mcp@4718d5476a0e2e5fb80e8f4dcf144dec948115cc -
Branch / Tag:
refs/heads/main - Owner: https://github.com/MozillaSecurity
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@4718d5476a0e2e5fb80e8f4dcf144dec948115cc -
Trigger Event:
push
-
Statement type: