Firefox MCP
Allows AI to connect to an existing Firefox browser, read open tabs, click and type on pages, and continue working after connection timeouts or reconnects.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Firefox MCP list the tabs currently open in my Firefox browser"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Firefox MCP
AI가 Firefox의 탭을 읽고, 클릭하고, 입력할 수 있게 해 주는 MCP 서버입니다. 내가 열어 둔 Firefox에 연결해서 함께 사용할 수 있습니다.
Mozilla Firefox DevTools MCP v0.10.7을 바탕으로, 연결이 멈췄을 때의 처리를 보완한 개인 수정본입니다.
무엇을 고쳤나요?
무한 대기 방지: WebDriver 명령에 15초 제한을 적용합니다.
연결 복구: 응답하지 않는 연결을 정리하고 다음 요청에서 재접속할 수 있게 합니다. 기존 Firefox에 연결한 경우 브라우저 창은 유지합니다.
중복 실행 방지: 결과를 확인하지 못한 클릭·입력을 자동으로 다시 실행하지 않습니다.
프로세스 정리 개선: 실제 geckodriver를 직접 실행해 연결 프로세스가 남는 문제를 줄였습니다.
모든 사이트나 Firefox 오류를 해결하는 도구는 아닙니다. 시간 초과가 발생한 작업은 화면에서 결과를 확인한 뒤 다시 요청하세요.
Related MCP server: Browser Control MCP
설치
Node.js 20.19 이상, Firefox, Git이 필요합니다.
git clone https://github.com/Junyoung1201/firefox-mcp.git
cd firefox-mcp
npm ci
npm run build:mozCodex에서 사용하기
1. Firefox를 원격 연결 옵션으로 실행합니다.
이미 실행 중이라면 먼저 종료한 뒤 실행하세요. 아래는 Linux 기준입니다.
firefox --marionette --remote-debugging-port자주 사용한다면 Firefox 바로가기의 실행 명령에 위 두 옵션을 추가하면 됩니다.
2. ~/.codex/config.toml에 추가합니다.
/절대/경로/firefox-mcp를 실제 설치한 폴더 경로로 바꾸세요. 기존 Firefox MCP 설정이 있으면 해당 항목을 교체합니다.
[mcp_servers.firefox-devtools]
command = "node"
args = [
"/절대/경로/firefox-mcp/dist.moz/index.js",
"--connect-existing",
"--marionette-port", "2828",
"--idle-timeout", "60"
]3. Codex를 재시작하고 요청합니다.
Firefox에서 열려 있는 탭 목록을 보여줘.
사용하지 않는 연결은 60초 후 해제하고, 다음 요청에서 다시 연결합니다. 연결된 브라우저의 로그인된 페이지도 접근할 수 있으므로, 사용하는 AI와 작업 범위를 확인하세요.
검증
Linux · Firefox 159 환경에서 단위 테스트 729개, 연결 복구 등을 포함한 통합 테스트 12개를 통과했습니다. geckodriver를 강제로 멈춘 뒤, Firefox 창을 유지하면서 재접속하는 경우도 확인했습니다.
npm run test:unit
npm run typecheck
npm run typecheck:tests전체 테스트 방법은 테스트 문서를 참고하세요.
원본과 라이선스
원본 코드와 이력을 보존한 독립 저장소이며, Mozilla 공식 배포판이 아닙니다.
라이선스: MIT 또는 Apache-2.0
이 수정본은 npm에 배포하지 않았습니다. 위의 소스 설치 방법을 사용하세요.
Available Tools
35 toolsaccept_dialogA
Accept browser dialog. Provide promptText for prompts.
Inputs: promptText.
clear_downloadsA
Clear the tracked downloads buffer.
Inputs: no named parameters.
clear_snapshotC
Clear snapshot UIDs. Usually not needed.
Inputs: no named parameters.
click_by_uidA
Click element by UID. Set dblClick for double-click.
Inputs: uid (required), dblClick.
close_firefox_sessionA
Ends the browser session. If the server connected to your existing Firefox, this releases the connection and leaves Firefox running. If the server started Firefox itself, this closes it. Call this when the browser task is complete and no further browser interaction is expected.
Inputs: no named parameters.
close_pageA
Close tab by index.
Inputs: pageIdx (required).
dismiss_dialogA
Dismiss browser dialog.
Inputs: no named parameters.
drag_by_uid_to_uidB
Drag element to another (HTML5 drag events).
Inputs: toUid (required), fromUid (required).
evaluate_scriptA
Run a JS function in the page and return its result. Prefer this for targeted reads (a value, text, computed style, whether an element exists) instead of a full take_snapshot. Use the UID interaction tools for clicking, typing, and filling.
Inputs: function (required), args, saveTo, preview, +2 more.
fill_by_uidB
Fill text input/textarea by UID.
Inputs: uid (required), value (required).
fill_form_by_uidA
Fill multiple form fields at once.
Inputs: elements (required).
get_firefox_infoARead-only
Get information about the current Firefox instance configuration, including binary path, environment variables, and output file location.
Inputs: no named parameters.
get_firefox_outputARead-only
Retrieve Firefox output (stdout/stderr including MOZ_LOG, warnings, crashes, stack traces). Returns recent output from the capture file. Use filters to focus on specific content.
Inputs: grep, lines, since.
get_page_textARead-only
Get the visible text of the page (document.body.innerText). Caps at maxLength (default 20000 chars); saveTo saves the full text to a file.
Inputs: saveTo, preview, maxLength.
hover_by_uidB
Hover over element by UID.
Inputs: uid (required).
install_extensionA
Install a Firefox extension using WebDriver BiDi webExtension.install command. Supports installing from archive (.xpi/.zip), base64-encoded data, or unpacked directory.
Inputs: type (required), path, value, permanent.
list_downloadsARead-only
List downloads tracked since startup, including status and saved file path.
Inputs: limit, format, status, urlContains.
list_pagesARead-only
List open tabs (index, title, URL). Selected tab is marked.
Inputs: no named parameters.
new_pageB
Open new tab at URL. Returns tab index.
Inputs: url (required), wait.
press_keyA
Press a single key, optionally with modifiers, to submit, dismiss, navigate or trigger a shortcut. Not for entering text: use fill_by_uid instead.
Inputs: key (required), uid.
print_pageBRead-only
Print the current page to a PDF file using print CSS. Returns the saved file path.
Inputs: saveTo, landscape, background.
resolve_uid_to_selectorARead-only
Resolve UID to CSS selector. Fails if the element is gone.
Inputs: uid (required).
screencast_startA
Start recording a screencast (video) of the current page viewport, saving the output to a file in the downloads directory. Returns a screencast id to pass to screencast_stop. Multiple recordings can run at once.
Inputs: width, height, context, mimeType, +1 more.
screencast_stopA
Stop an in-progress screencast recording started with screencast_start and finalize the video file. Returns the path to the saved file.
Inputs: screencast.
screenshot_by_uidARead-only
Capture element screenshot by UID as base64 PNG.
Inputs: uid (required), saveTo.
screenshot_pageBRead-only
Capture viewport screenshot as base64 PNG. Set fullPage for the whole scrollable document.
Inputs: saveTo, fullPage.
select_pageA
Select active tab by index, URL, or title. Index takes precedence.
Inputs: url, title, pageIdx.
set_download_behaviorA
Control how downloads are handled: allow (save to a destination folder), deny (cancel), or reset to default. Avoids the native save-file dialog. Requires a recent Firefox.
Inputs: behavior (required), downloadFolder.
set_viewport_sizeA
Set viewport dimensions in pixels. Applies to the selected tab only.
Inputs: width (required), height (required).
take_snapshotARead-only
Capture DOM snapshot with stable UIDs. A UID stays valid across snapshots until its element is removed or the page navigates. Output caps at maxLines (default 100); scope with selector or dump the full tree with saveTo.
Inputs: saveTo, preview, maxDepth, maxLines, +4 more.
type_textA
Type text key by key into the focused element, optionally followed by a key such as Enter. Use fill_by_uid to set the value of a known input; use this for elements that only react to real typing, such as autocomplete fields and rich text editors.
Inputs: text (required), uid, submitKey.
uninstall_extensionA
Uninstall a Firefox extension using WebDriver BiDi webExtension.uninstall command. Requires the extension ID returned by install_extension or obtained from list_extensions.
Inputs: id (required).
upload_file_by_uidB
Upload file to file input by UID.
Inputs: uid (required), filePath (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 35 tools
Most tools target distinct resource+action pairs (navigation, DOM interaction, screenshots, downloads, dialogs, viewport, extensions, screencasts). There is mild overlap between fill_by_uid/type_text/fill_form_by_uid and between get_page_text/take_snapshot/evaluate_script, but descriptions explicitly steer the agent toward the right one in each case.
Names are overwhelmingly consistent snake_case verb_noun (list_pages, navigate_page, close_page, take_snapshot, click_by_uid, set_viewport_size). Minor deviations like new_page (instead of create_page) and the take_/get_ verb mix for content retrieval are readable and do not break the pattern.
35 tools is on the heavy side for a single server, though the breadth of a full browser-automation surface (tabs, DOM, forms, screenshots, downloads, dialogs, extensions, screencasts) justifies most of them. It is borderline: the surface could be trimmed or grouped without losing capability, so a heavy-but-defensible score.
Covers the browser lifecycle very thoroughly: page CRUD, navigation, DOM interaction, forms, uploads, downloads, dialogs, viewport, extension management, screencasts, JS eval, and process info/output. Minor gaps remain—uninstall_extension references a list_extensions tool that isn't present, and there is no explicit wait-for-condition or cookie/storage management.
Maintenance
Related MCP Connectors
Connect AI assistants to your approved computer for files, commands, browser and desktop tasks.
Control a real browser from AI agents: navigate, click, type, screenshot, read the page.
AI-powered browser automation — navigate, click, fill forms, and extract data from any website.
Let AI agents use any website you're logged in to. Sessions stay encrypted on your machine.
Related MCP Servers
- AlicenseCqualityCmaintenanceEnables AI assistants to read and drive a real, logged-in Firefox browser, including tabs, cookies, history, and site interactions, all through the Model Context Protocol.5216 npmMIT
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to operate a real, logged-in Firefox session through an extension, including tab and history management, page reading, screenshots, and clicking, typing, or scrolling on domains the user approves.MIT
- AlicenseBqualityBmaintenanceLet AI agents use the Firefox, Zen, or LibreWolf browser you already have open, with your logins, cookies, and extensions intact. No Playwright, Chromium, or WebDriver. Agents work in background tabs while you keep browsing: read pages, click, fill forms, take screenshots, and capture network traffic. A WebExtension plus a local bridge lets several agents share one browser.14297 PyPI40MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI assistants to manage Firefox tabs, search browsing history, and read live webpage text and links with explicit per-domain user consent.MIT