mcp-firefox
Connects to Firefox's Remote Debugging Protocol over TCP, exposing browser DevTools capabilities (JS evaluation, navigation, screenshots, network capture) as tools for LLMs via MCP.
README
mcp-firefox
An MCP (Model Context Protocol) server that connects to Firefox's Remote Debugging Protocol (RDP) over TCP, exposing browser DevTools capabilities as tools for LLMs.
How It Works
Firefox has a built-in Remote Debugging Protocol that speaks length-prefixed JSON over TCP. This server maintains a persistent connection to that port and translates MCP tool calls into RDP messages, returning the results to the LLM.
LLM ↔ MCP (HTTP :8090) ↔ Firefox RDP (TCP :6000)
The RDP client uses a background reader task to handle both request/response pairs and unsolicited events (like network traffic), enabling real-time capture features.
Tools
| Tool | Description |
|---|---|
evaluate_js |
Evaluate a JavaScript expression in the current tab's console (supports top-level await) |
list_tabs |
List all open browser tabs with URLs and titles |
navigate |
Navigate the current tab to a URL |
get_page_source |
Get the full HTML source of the current page |
get_console_messages |
Get cached console messages (errors, logs) |
read_page |
Extract readable text content from the page (strips nav, ads, boilerplate) |
screenshot |
Take a screenshot — viewport, full page, or a specific CSS selector element |
start_capture |
Start capturing network requests (like opening the Network tab) |
read_capture |
Read captured network events (URLs, methods, status, timing, optionally bodies) |
stop_capture |
Stop network capture and clean up |
raw_rdp_command |
Send arbitrary RDP JSON for experimentation |
Firefox Setup
1. Enable Remote Debugging
Open about:config in Firefox and set:
| Preference | Value | Purpose |
|---|---|---|
devtools.debugger.remote-enabled |
true |
Allow remote debug connections |
devtools.debugger.prompt-connection |
false |
Skip the "allow connection?" dialog (optional) |
devtools.chrome.enabled |
true |
Enable chrome debugging |
2. Start the Debug Listener
firefox --start-debugger-server 6000
This opens a TCP listener on localhost:6000. Your tabs and session restore normally.
3. Verify
ss -tlnp | grep 6000
You should see Firefox listening on 127.0.0.1:6000.
Installation
Requires Python 3.11+. Uses uv for dependency management:
uv venv
uv pip install -e .
Running
.venv/bin/firefox-mcp
The MCP server starts on http://0.0.0.0:8090/mcp using streamable HTTP transport (stateless mode).
Environment Variables
| Variable | Default | Description |
|---|---|---|
FIREFOX_RDP_HOST |
localhost |
Firefox RDP host |
FIREFOX_RDP_PORT |
6000 |
Firefox RDP port |
MCP Client Configuration
{
"mcpServers": {
"firefox-devtools": {
"url": "http://localhost:8090/mcp"
}
}
}
Usage Examples
Page Content & Screenshots
# Read article text from a news site you're logged into
> read_page
# Take a screenshot of a specific element
> screenshot(selector=".article-body")
# Full page screenshot
> screenshot(fullpage=True)
Network Capture
Capture API traffic from web apps (streaming services, SPAs, etc.):
# Start recording network traffic
> start_capture
# Navigate to the app or trigger actions
> navigate("https://www.disneyplus.com/home")
# See what API calls were made
> read_capture
# Get response bodies (JSON payloads, manifests, etc.)
> read_capture(include_bodies=True)
# Done
> stop_capture
Raw RDP Exploration
> raw_rdp_command({"to": "root", "type": "listTabs"})
> raw_rdp_command({"to": "<consoleActor>", "type": "getCachedMessages", "messageTypes": ["PageError", "ConsoleAPI"]})
Use list_tabs first to discover actor IDs, then experiment with raw_rdp_command.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。