home / mcp / firefox mcp server
A fully vibe-coded, experimental, MCP server to control firefox
Configuration
View docs{
"mcpServers": {
"jediluke-firefox-mcp-server": {
"command": "npx",
"args": [
"firefox-mcp-server"
]
}
}
}You can automate Firefox inside MCP-enabled applications with this server, using Playwright to control Firefox across single or multi-tab sessions while collecting rich debugging data. It lets you launch browsers, navigate pages, interact with UI, capture artifacts, and monitor console output, network activity, WebSocket traffic, and performance in real time.
Start by launching the multi-tab capable Firefox controller, then create isolated tabs for your scenarios. Switch between tabs to drive multiple users or players, navigate to pages, interact with elements, and capture debugging feeds for each tab independently. Use the combined debug feed to monitor everything in one place and enable targeted monitoring for specific types of events like console logs, network activity, or WebSocket messages.
Prerequisites you need before running the server:
Install dependencies and set up Firefox for Playwright:
npm install
npx playwright install firefoxConfigure the MCP server to run locally using the standard or debug-enhanced setup. The standard setup runs a simple Node process, while the debug-enhanced setup runs a multi-debug variant with extra monitoring. You can start either configuration and restart the client to activate the new tools.
{
"mcpServers": {
"firefox-control": {
"command": "node",
"args": ["index.js"],
"cwd": "/home/luke/workbench/drabardi/firefox-mcp-server"
}
}
}Launch the browser with debugging, create a tab, and perform interactions in a single flow.
// Launch browser with debugging
mcp__firefox-control__launch_firefox_multi({headless: false, enableDebugLogging: true})
// Create tab and navigate
mcp__firefox-control__create_tab({tabId: "main", url: "https://example.com", enableMonitoring: true})
// Interact with page
mcp__firefox-control__click({selector: "button#submit", tabId: "main"})
mcp__firefox-control__type_text({selector: "input[name='search']", text: "hello world", tabId: "main"})
// Take screenshot
mcp__firefox-control__screenshot({path: "page.png", fullPage: true, tabId: "main"})
// Close
mcp__firefox-control__close_browser()This server provides browser automation with extensive debugging access. Use it only in trusted environments. It can execute arbitrary JavaScript in browser contexts and monitor all network and WebSocket activity, so treat it as a powerful tool and safeguard access accordingly.
The server collects a rich set of debugging data automatically, including console logs, JavaScript errors, WebSocket traffic, network activity, and performance metrics. You can filter and query these streams per tab to build a precise picture of client-side behavior.
The server exposes a wide range of actions for browser control and debugging, including launching the browser, creating tabs, navigating, interacting with elements, taking screenshots, and retrieving debug data such as console logs, errors, network activity, WebSocket messages, and performance metrics. Each action targets a specific tab context to keep sessions isolated.
The debug-enhanced server runs on Playwright for Firefox automation with per-tab isolation. It captures events in real time and timestamps them for precise debugging, maintaining separate browser contexts for each tab so cookies, local storage, and session data do not cross between sessions.
Node.js 18+ is required. Firefox is installed automatically by Playwright. You need a MCP-compatible client and a display server for non-headless mode.
If you modify configuration, restart the MCP client to activate the new debugging tools. Ensure the DISPLAY environment variable is set when running in non-headless mode and that the correct path to the debug script is used in the debug-enhanced configuration.
Launch Firefox with debugging capabilities to start an automation session.
Close the active Firefox browser instance and release resources.
Create an isolated browser session with independent state for multi-user testing.
List all active sessions along with their URLs and status.
Close a specific session and free its resources.
Set the default session for subsequent operations.
Navigate to a specified URL within a session.
Refresh the current page in a session.
Navigate back in the browser history for a session.
Navigate forward in the browser history for a session.
Retrieve the current page URL of a session.
Click elements by selector or coordinates within a session.
Drag and drop interactions with smooth animations.
Type text into input fields and text areas.
Send keyboard events with optional modifiers.
Wait for elements to appear or become visible.
Extract HTML content from the page or specific elements.
Extract visible text content from the page.
Capture screenshots with configurable options.
Run custom JavaScript in the browser context.
Monitor and retrieve browser console output.
Track JavaScript errors and exceptions with stack traces.
Monitor HTTP requests, responses, and timings.
Capture WebSocket traffic for real-time debugging.
Collect timing, rendering, and memory usage metrics.
Provide a combined feed of all debugging information.
Start comprehensive monitoring across browser sessions.
Clear accumulated debugging data and reset buffers.
Inject custom debugging utilities into the browser context.