Firefox DevTools MCP — Claude Code MCP server: setup guide
Connects Firefox to AI agents via MCP for web debugging, network request tracking, console logging, and automated form interaction.
claude mcp add --env FIREFOX_HEADLESS=<FIREFOX_HEADLESS> --env START_URL=<START_URL> --transport stdio firefox-devtools-mcp -- npx -y @mozilla/firefox-devtools-mcpWhat Firefox DevTools MCP does
The server drives Firefox via WebDriver BiDi through Selenium WebDriver. It allows the agent to navigate URLs, inspect network traffic, read browser console messages, and click interface elements via structured DOM snapshots. Available tool presets include slim, default basic, and developer for deep inspection.
Running this server requires a local Firefox 100+ installation and Node.js 20.19.0 or higher. Cloud hosting without a local browser instance will fail: the server requires access to a local Firefox binary or a configured Docker container. Always configure a dedicated profile using --profile-path because the agent accesses any session cookies present in the active profile.
What it helps with
- Inspect browser console errors and runtime warnings
- Track outgoing network requests and verify response payloads
- Interact with web forms through automated DOM snapshots
- Capture headless page screenshots at a specified viewport size
Example prompts for the agent
- Navigate to
https://example.comand inspect the network tab for failing requests - Take a screenshot of the current page with a 1280x720 viewport
- Inspect console messages on the active tab and report any errors
How to install Firefox DevTools MCP
Platform CLI
claude mcp add --env FIREFOX_HEADLESS=<FIREFOX_HEADLESS> --env START_URL=<START_URL> --transport stdio firefox-devtools-mcp -- npx -y @mozilla/firefox-devtools-mcpReplace <…> with your own values
Platform CLI
codex mcp add firefox-devtools-mcp --env FIREFOX_HEADLESS=<FIREFOX_HEADLESS> --env START_URL=<START_URL> -- npx -y @mozilla/firefox-devtools-mcpReplace <…> with your own values
Config file
{
"mcpServers": {
"firefox-devtools-mcp": {
"command": "npx",
"args": [
"-y",
"@mozilla/firefox-devtools-mcp"
],
"env": {
"FIREFOX_HEADLESS": "<FIREFOX_HEADLESS>",
"START_URL": "<START_URL>"
}
}
}
}Replace <…> with your own values
Config file
{
"servers": {
"firefox-devtools-mcp": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@mozilla/firefox-devtools-mcp"
],
"env": {
"FIREFOX_HEADLESS": "<FIREFOX_HEADLESS>",
"START_URL": "<START_URL>"
}
}
}
}Replace <…> with your own values
Platform CLI
gemini mcp add -e FIREFOX_HEADLESS=<FIREFOX_HEADLESS> -e START_URL=<START_URL> firefox-devtools-mcp npx -y @mozilla/firefox-devtools-mcpReplace <…> with your own values
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about Firefox DevTools MCP
How do I install Firefox DevTools MCP in Claude Code?
Run claude mcp add firefox-devtools-mcp -- npx -y @mozilla/firefox-devtools-mcp. For headless execution, add environment variables: `claude mcp add --env FIREFOX_HEADLESS=<FIREFOX_HEADLESS> --env START_URL=<START_URL> --transport stdio firefox-devtools-mcp -- npx -y @mozilla/firefox-devtools-mcp`.
What does Firefox DevTools MCP do?
It exposes Firefox browser controls to AI agents using WebDriver BiDi, enabling DOM inspection, form filling, console reading, and network monitoring.
What are the prerequisites to run this MCP server?
It requires Node.js 20.19.0 or higher and Firefox 100 or newer installed locally. You can specify a custom binary location via the --firefox-path flag.