fire-fodex
# fire-fodex
Firefox を、MCP agent からそのまま触るためのローカルツールです。
Chrome じゃなくて Firefox を使いたい。
でも AI agent からタブを見たり、クリックしたり、スクショを取ったりしたい。
そのために WebExtension、native messaging、MCP server をつないでいます。
OpenAI の Chrome plugin の移植ではありません。Firefox 用に別で作った橋です。
まだ v1 なので、かなりローカル開発者向けです。拡張機能は手で読み込みます。MCP server も自分で起動します。普段使いのブラウザプロファイルで動かす前に、コードは一回見てください。
## できること
- Firefox のタブ一覧を見る
- 新しいタブを開く
- 既存タブを agent 用に確保する
- ページ移動、リロード、戻る、進む
- 表示中ページの軽い snapshot を取る
- 画面内の文字を探す
- クリック、入力、貼り付け、フォーカス、テキスト選択、キー入力
- マウス移動、スクロール、ドラッグ
- 文字や selector が出るまで待つ
- 通常スクショと full-page スクショ
## やらないこと
- Firefox の cookie、保存済みパスワード、profile database、localStorage は直接読みません
- ブラウザの情報を勝手に外へ送りません
- cloud sync、account auth、操作録画、権限 UI はありません
- AMO 向けの配布はまだしていません
`firefox_eval` はあります。ページ側で少しだけ処理したい時の逃げ道です。
ただし sandbox ではありません。cookie、storage、password 抜き取りっぽい文字列は止めますが、それで安全と言い切れるものではないです。信用できない agent に、普段の Firefox profile を触らせないでください。
## 必要なもの
- Windows
- Firefox Stable
- Node.js 24+
- npm 11+
## セットアップ
```powershell
cd path\to\fire-fodex
npm install
npm run build
npm run install:host
```
Firefox 側で拡張機能を読み込みます。
1. Firefox を開く
2. `about:debugging#/runtime/this-firefox` に行く
3. `Load Temporary Add-on...` を押す
4. `extension\manifest.json` を選ぶ
MCP server を起動します。
```powershell
npm run mcp
```
MCP client 側の設定例です。
```json
{
"mcpServers": {
"fire-fodex": {
"command": "node",
"args": [
"path\\to\\fire-fodex\\dist\\mcp-server\\index.js"
]
}
}
}
```
## Tools
- `firefox_list_tabs`
- `firefox_claim_tab`
- `firefox_open_tab`
- `firefox_navigate`
- `firefox_snapshot`
- `firefox_screenshot`
- `firefox_find`
- `firefox_wait_for`
- `firefox_mouse_click`
- `firefox_mouse_move`
- `firefox_scroll`
- `firefox_drag`
- `firefox_focus`
- `firefox_select_text`
- `firefox_paste`
- `firefox_eval`
- `firefox_click`
- `firefox_type`
- `firefox_keypress`
- `firefox_back`
- `firefox_forward`
- `firefox_reload`
- `firefox_close_tab`
- `firefox_release`
基本は、見てから触る流れです。
- `firefox_snapshot` や `firefox_find` で画面を見る
- form は `firefox_focus`、`firefox_paste`、`firefox_type`、`firefox_keypress`
- pointer 操作は `firefox_mouse_click`、`firefox_mouse_move`、`firefox_scroll`、`firefox_drag`
- ページが変わる操作の後は `firefox_wait_for`
- 見た目が大事なら `firefox_screenshot`
## 確認
```powershell
npm run typecheck
npm test
npm run lint:extension
npm run check
powershell -ExecutionPolicy Bypass -File scripts\smoke.ps1
```
`smoke.ps1` は、native host を入れて Firefox 側で拡張機能を読み込んでから動かしてください。
## 権限
拡張機能は `<all_urls>` を要求します。普通のサイトを横断して操作するためです。
強い権限です。v1 は「中身を読んで、自分のローカルで動かす」人向けとして置いています。
## 仕組み
```text
AI agent / MCP client
|
| stdio MCP
v
fire-fodex MCP server
|
| localhost JSON request
v
native messaging host
|
| Firefox native messaging stdio
v
Firefox WebExtension
|
| tabs + content scripts
v
Firefox tabs
```
拡張機能がつながっている間、native host は `127.0.0.1:17365` で待ち受けます。
TDQS
Scored across 24 tools
Most tools have distinct purposes, but firefox_click and firefox_mouse_click overlap in functionality, as both can click using selectors. Additionally, firefox_focus and firefox_click could be confused. Overall, the distinctions are clear enough for most use cases.
All tools consistently use the 'firefox_' prefix. The naming pattern is mostly verb or verb_noun, but there are exceptions like 'mouse_click' (noun+verb) and 'mouse_move', which break the pattern slightly. The majority follow a predictable style.
24 tools is on the high side for a browser automation server, but each tool covers a specific action. While the count is above the typical 3-15 range, it is not excessive and reflects the complexity of controlling a browser.
The tool set covers essential browser automation tasks: navigation, tab management, user input, scrolling, screenshots, and DOM interaction. Missing features like alert handling or file uploads are minor gaps, but core workflows are well-supported.