Skip to main content
Glama

Firefox MCP Server

Advanced Firefox browser automation with comprehensive debugging capabilities

A powerful Model Context Protocol (MCP) server that provides sophisticated Firefox browser automation through 28 specialized tools. Designed for AI assistants and automation workflows requiring multi-session management, real-time debugging, and comprehensive web interaction capabilities.

🌟 Key Features

Multi-Session Architecture

  • Isolated Browser Sessions: Each session runs in a completely separate context with independent cookies, storage, and debugging

  • Perfect for Multiplayer Testing: Test multiplayer games and multi-user applications seamlessly

  • Concurrent Operations: Manage multiple browser sessions simultaneously from a single interface

Comprehensive Debugging Suite

  • Real-time Console Monitoring: Capture all console output (log, error, warn, info, debug)

  • JavaScript Error Tracking: Monitor unhandled errors with full stack traces

  • Network Activity Monitoring: Track HTTP requests, responses, and timing data

  • WebSocket Traffic Capture: Perfect for Phoenix LiveView and real-time application debugging

  • Performance Metrics: Monitor DOM timing, paint events, and memory usage

Advanced Interaction Capabilities

  • Precise Element Interaction: Click, type, and interact with any web element

  • Keyboard Event Simulation: Send complex key combinations and shortcuts

  • Drag & Drop Operations: Smooth drag operations with customizable timing and steps

  • JavaScript Execution: Run custom JavaScript in browser contexts

Related MCP server: InSite

šŸš€ Quick Start

Installation

npm install firefox-mcp-server
npx playwright install firefox

Basic Usage

Add to your MCP client configuration:

{
  "mcpServers": {
    "firefox": {
      "command": "npx",
      "args": ["firefox-mcp-server"],
      "env": {}
    }
  }
}

Example: Multi-User Testing

// Launch browser and create isolated sessions
await browser_launch({headless: false})
await session_create({sessionId: "user1", url: "https://app.example.com"})
await session_create({sessionId: "user2", url: "https://app.example.com"})

// User 1 creates a game
await element_click({sessionId: "user1", selector: "button.create-game"})

// User 2 joins the game
await element_click({sessionId: "user2", selector: "button.join-game"})
await input_type({sessionId: "user2", selector: "input.game-code", text: "ABC123"})

// Monitor both sessions for real-time updates
await debug_websocket_messages({sessionId: "user1", limit: 10})
await debug_websocket_messages({sessionId: "user2", limit: 10})

šŸ› ļø Complete Tool Reference

Browser Management

  • browser_launch - Launch Firefox with debugging capabilities

  • browser_close - Close browser and clean up all resources

Session Management

  • session_create - Create isolated browser session with independent state

  • session_list - List all active sessions with URLs and status

  • session_close - Close specific session and free resources

  • session_set_active - Set default session for subsequent operations

Page Navigation

  • page_navigate - Navigate to any URL

  • page_reload - Refresh current page

  • history_back / history_forward - Browser history navigation

  • url_get_current - Get current page URL

Element Interaction

  • element_click - Click elements by selector or coordinates

  • element_drag - Drag and drop with smooth animations

  • input_type - Type text into input fields and text areas

  • keyboard_press - Send keyboard events with modifier support

  • element_wait - Wait for elements to appear or become visible

Content Extraction

  • html_extract - Extract HTML content from page or elements

  • text_extract - Get visible text content

  • page_screenshot - Capture screenshots with flexible options

Advanced Capabilities

  • javascript_execute - Run custom JavaScript in browser context

Comprehensive Debugging Tools

  • debug_console_logs - Monitor browser console output

  • debug_javascript_errors - Track JavaScript errors and exceptions

  • debug_network_activity - Monitor HTTP requests and responses

  • debug_websocket_messages - Capture WebSocket traffic (LiveView-friendly)

  • debug_performance_metrics - Get timing and memory usage data

  • debug_activity_all - Combined feed of all debugging information

  • debug_monitoring_start - Start comprehensive monitoring

  • debug_buffers_clear - Clear accumulated debug data

  • debug_helpers_inject - Inject custom debugging utilities

šŸŽÆ Use Cases

Web Application Testing

  • Automated UI testing with visual verification

  • Form submission and validation testing

  • Cross-browser compatibility verification

  • Performance monitoring and optimization

Multiplayer Game Development

  • Multi-player session simulation

  • Real-time state synchronization testing

  • WebSocket message flow debugging

  • Client-side prediction validation

Phoenix LiveView Development

  • LiveView event flow monitoring

  • Real-time update verification

  • WebSocket connection debugging

  • Multi-user interaction testing

E-commerce and SaaS Testing

  • Multi-user checkout flows

  • Session isolation for different user roles

  • Real-time inventory updates

  • Payment flow testing

šŸ“Š Debugging Capabilities

Console Monitoring

// Get recent console activity
await debug_console_logs({
  sessionId: "user1",
  types: ["error", "warn"],
  limit: 20,
  since: Date.now() - 60000  // Last minute
})

Network Analysis

// Monitor API calls and responses
await debug_network_activity({
  sessionId: "user1",
  filter: "xhr",
  limit: 10
})

WebSocket Debugging

// Perfect for Phoenix LiveView
await debug_websocket_messages({
  sessionId: "user1",
  limit: 5
})

Performance Monitoring

// Get comprehensive performance data
await debug_performance_metrics({
  sessionId: "user1"
})

āš™ļø Troubleshooting

Playwright Browser Not Found Error

If you encounter an error like:

browserType.launch: Executable doesn't exist at /home/luke/.cache/ms-playwright/firefox-1482/firefox/firefox

Solution: The Playwright browsers need to be installed. Run:

# From the firefox-mcp-server directory
./node_modules/.bin/playwright install firefox

This downloads the Firefox browser binary that Playwright uses for automation. This issue was resolved on 2025-08-03 when the MCP server failed to launch due to missing browser binaries.

šŸ”§ Claude Code Configuration

Local Configuration

Claude Code uses a project-specific configuration located at:

/home/luke/workbench/drabardi/.claude/settings.local.json

This configuration includes:

  1. Enabled MCP Servers: The firefox-control server is enabled in enabledMcpjsonServers

  2. Permissions: Various tool permissions are whitelisted including all Firefox MCP tools

MCP Server Configuration

The Firefox MCP server is configured in Claude Code using:

# Check configured MCP servers
claude mcp list

# Output shows:
firefox-control: node /home/luke/workbench/firefox-mcp-server/index.js
tidewave: http://localhost:4000/tidewave/mcp (SSE)

The server runs from /home/luke/workbench/firefox-mcp-server/ using the main index.js file (which internally uses the index-multi-debug.js implementation).

šŸ”§ Configuration Options

Session Creation

await session_create({
  sessionId: "unique-id",
  url: "https://example.com",
  contextId: "optional-context",
  enableMonitoring: true  // Enable real-time debugging
})

Screenshot Options

await page_screenshot({
  sessionId: "user1",
  path: "screenshot.png",
  fullPage: true  // Capture entire page
})

Drag Operations

await element_drag({
  sessionId: "user1",
  selector: ".slider",
  offsetX: 100,
  duration: 1000,  // Smooth 1-second animation
  steps: 20        // 20 intermediate positions
})

šŸ“ Project Structure

firefox-mcp-server/
ā”œā”€ā”€ index.js              # Main MCP server implementation
ā”œā”€ā”€ package.json           # Project configuration
ā”œā”€ā”€ README.md             # This file
ā”œā”€ā”€ CLAUDE.md             # Claude Code integration guide
ā”œā”€ā”€ examples/             # Usage examples
│   ā”œā”€ā”€ demo-tibia-simple.js
│   ā”œā”€ā”€ demo-tibia.js
│   └── demo-multiplayer.js
ā”œā”€ā”€ tests/                # Test files
│   └── test.js
└── docs/                 # Additional documentation
    ā”œā”€ā”€ ENHANCEMENT_USAGE.md
    └── README-multi.md

šŸ¤ Contributing

We welcome contributions! This project is designed to be:

  • LLM-Friendly: Tool names and descriptions optimized for AI assistant discovery

  • Extensible: Easy to add new browser automation capabilities

  • Well-Documented: Comprehensive examples and documentation

šŸ“‹ Requirements

  • Node.js: 18.0.0 or higher

  • Firefox: Automatically installed via Playwright

  • MCP Client: Claude Code, Cline, or other MCP-compatible tools

šŸ”’ Security

This server provides comprehensive browser automation capabilities. Use with trusted MCP clients only. The server can:

  • Execute arbitrary JavaScript in browser contexts

  • Monitor all network traffic and WebSocket messages

  • Access page content and user interactions

  • Take screenshots and access media devices

šŸ“„ License

MIT License - see LICENSE file for details.


Perfect for AI assistants working with web applications, multiplayer games, and real-time debugging scenarios.

Available Tools

29 tools
backD

Navigate back

Inputs: tabId.

clear_debug_buffersC

Clear debug event buffers for a tab

Inputs: tabId, types.

clickD

Click on an element

Inputs: coordinates, selector, tabId.

close_browserA

Close browser and all tabs

Inputs: no named parameters.

close_tabC

Close a specific tab

Inputs: tabId (required).

create_tabC

Create a new tab with isolated session and debugging

Inputs: tabId (required), contextId, enableMonitoring, url.

dragD

Perform drag operation

Inputs: duration, fromCoordinates, offsetX, offsetY, +4 more.

execute_scriptC

Execute JavaScript in the browser

Inputs: script (required), tabId.

forwardC

Navigate forward

Inputs: tabId.

get_all_debug_activityC

Get combined feed of all debug events

Inputs: limit, since, tabId.

get_console_logsC

Get captured console logs from browser

Inputs: limit, since, tabId, types.

get_current_urlC

Get current page URL

Inputs: tabId.

get_javascript_errorsC

Get captured JavaScript errors

Inputs: limit, since, tabId.

get_network_activityC

Get captured network requests and responses

Inputs: filter, limit, since, tabId.

get_page_contentC

Get HTML content

Inputs: selector, tabId.

get_page_textC

Get visible text content

Inputs: selector, tabId.

get_performance_metricsC

Get performance metrics (timing, memory usage)

Inputs: tabId.

get_websocket_messagesC

Get captured WebSocket messages (for LiveView debugging)

Inputs: limit, since, tabId.

inject_debugging_helpersC

Inject debugging helper functions into the page

Inputs: includeWebSocketMonitoring, tabId.

launch_firefox_multiC

Launch Firefox browser with multi-tab support and debugging

Inputs: enableDebugLogging, headless.

list_tabsB

List all active tabs

Inputs: no named parameters.

reloadD

Reload page

Inputs: tabId.

screenshotC

Take a screenshot

Inputs: fullPage, path, tabId.

send_keyD

Send keyboard events

Inputs: key (required), modifiers, repeat, selector, +1 more.

set_active_tabD

Set active tab

Inputs: tabId (required).

start_monitoringC

Start/restart monitoring for a tab

Inputs: tabId, types.

type_textC

Type text into an input field

Inputs: selector (required), text (required), tabId.

wait_for_elementC

Wait for element to appear

Inputs: selector (required), tabId, timeout.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    C2.7/5.0

    Scored across 29 tools

    Disambiguation4/5

    Most tools have distinct purposes, but some overlap exists between click, send_key, and type_text for user input actions, and between get_page_content and get_page_text for content extraction. The descriptions help clarify differences, but an agent might occasionally misselect between these similar tools.

    Naming Consistency5/5

    Tool names follow a consistent snake_case pattern with clear verb_noun structures throughout, such as navigate, get_current_url, and create_tab. There are no deviations in naming conventions, making the set predictable and easy to parse.

    Tool Count3/5

    With 29 tools, the count feels heavy for a browser automation server, bordering on excessive. While the tools cover many aspects, some could potentially be consolidated or omitted without losing functionality, making the set slightly overwhelming for its scope.

    Completeness5/5

    The tool set provides comprehensive coverage for browser automation and debugging, including navigation, tab management, content extraction, user interactions, monitoring, and debugging features. There are no obvious gaps; agents can perform full workflows from launching the browser to analyzing performance and errors.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      An MCP server that exposes Firefox browser automation capabilities through the Model Context Protocol, enabling AI assistants to control web browsers for navigation, interaction, and data collection tasks.
      4
      BSD 3-Clause
    • A
      license
      Not graded
      quality
      D
      maintenance
      A comprehensive browser automation MCP server using Playwright, offering 50+ tools for page control, element interaction, content extraction, and more across multiple browser engines.
      25 npm
      1
      MIT
    • A
      license
      B
      quality
      D
      maintenance
      An MCP server for generic browser automation using Playwright. Enables MCP clients to navigate pages, inspect elements, execute JavaScript, capture screenshots, and monitor console logs and network traffic via a headless Chromium instance.
      7
      ISC
    • A
      license
      Not graded
      quality
      B
      maintenance
      MCP server for the Firefox you actually use: an add-on plus a small native helper, so an agent gets your real profile, tabs and logged-in sessions instead of a blank headless browser. 45 tools for tabs, accessibility snapshots with refs, clicking, typing, screenshots, bookmarks, history and downloads.
      12
      Mozilla Public 2.0