foxmcp 1.5.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- foxmcp-1.5.0/.gitignore +73 -0
- foxmcp-1.5.0/LICENSE +21 -0
- foxmcp-1.5.0/PKG-INFO +272 -0
- foxmcp-1.5.0/README.md +256 -0
- foxmcp-1.5.0/predefined-ex/dom-summarize.sh +207 -0
- foxmcp-1.5.0/predefined-ex/gcal-cal-event-js.sh +310 -0
- foxmcp-1.5.0/predefined-ex/gcal-daily-events-js.sh +192 -0
- foxmcp-1.5.0/predefined-ex/gcal-monthly-events-js.sh +196 -0
- foxmcp-1.5.0/predefined-ex/set-file-input.py +28 -0
- foxmcp-1.5.0/predefined-ex/youtube-play-pause.sh +63 -0
- foxmcp-1.5.0/pyproject.toml +36 -0
- foxmcp-1.5.0/server/__init__.py +8 -0
- foxmcp-1.5.0/server/browser_proxy.py +257 -0
- foxmcp-1.5.0/server/cli.py +14 -0
- foxmcp-1.5.0/server/file_transfer.py +160 -0
- foxmcp-1.5.0/server/mcp_tools.py +2659 -0
- foxmcp-1.5.0/server/requirements.txt +5 -0
- foxmcp-1.5.0/server/server.py +1184 -0
- foxmcp-1.5.0/server/single_instance.py +208 -0
- foxmcp-1.5.0/server/version.py +3 -0
foxmcp-1.5.0/.gitignore
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
*.so
|
|
6
|
+
.Python
|
|
7
|
+
build/
|
|
8
|
+
develop-eggs/
|
|
9
|
+
dist-python/
|
|
10
|
+
downloads/
|
|
11
|
+
eggs/
|
|
12
|
+
.eggs/
|
|
13
|
+
lib/
|
|
14
|
+
lib64/
|
|
15
|
+
parts/
|
|
16
|
+
sdist/
|
|
17
|
+
var/
|
|
18
|
+
wheels/
|
|
19
|
+
share/python-wheels/
|
|
20
|
+
*.egg-info/
|
|
21
|
+
.installed.cfg
|
|
22
|
+
*.egg
|
|
23
|
+
MANIFEST
|
|
24
|
+
|
|
25
|
+
# Virtual Environment
|
|
26
|
+
venv/
|
|
27
|
+
env/
|
|
28
|
+
ENV/
|
|
29
|
+
.venv/
|
|
30
|
+
|
|
31
|
+
# Testing
|
|
32
|
+
.coverage
|
|
33
|
+
.pytest_cache/
|
|
34
|
+
coverage.xml
|
|
35
|
+
*.cover
|
|
36
|
+
.hypothesis/
|
|
37
|
+
htmlcov/
|
|
38
|
+
|
|
39
|
+
# Test import symbolic links (managed by Makefile)
|
|
40
|
+
tests/integration/test_imports.py
|
|
41
|
+
tests/unit/test_imports.py
|
|
42
|
+
|
|
43
|
+
# IDE
|
|
44
|
+
.vscode/
|
|
45
|
+
.idea/
|
|
46
|
+
*.swp
|
|
47
|
+
*.swo
|
|
48
|
+
*~
|
|
49
|
+
|
|
50
|
+
# Extension build artifacts
|
|
51
|
+
extension.zip
|
|
52
|
+
server.zip
|
|
53
|
+
dist/
|
|
54
|
+
*.xpi
|
|
55
|
+
|
|
56
|
+
# OS
|
|
57
|
+
.DS_Store
|
|
58
|
+
.DS_Store?
|
|
59
|
+
._*
|
|
60
|
+
.Spotlight-V100
|
|
61
|
+
.Trashes
|
|
62
|
+
ehthumbs.db
|
|
63
|
+
Thumbs.db
|
|
64
|
+
|
|
65
|
+
# Logs
|
|
66
|
+
*.log
|
|
67
|
+
logs/
|
|
68
|
+
|
|
69
|
+
# Temporary files
|
|
70
|
+
*.tmp
|
|
71
|
+
*.temp
|
|
72
|
+
.tmp/firefox
|
|
73
|
+
firefox
|
foxmcp-1.5.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 FoxMCP Project
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
foxmcp-1.5.0/PKG-INFO
ADDED
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: foxmcp
|
|
3
|
+
Version: 1.5.0
|
|
4
|
+
Summary: Connect MCP clients to your Firefox browser
|
|
5
|
+
Project-URL: Homepage, https://github.com/ThinkerYzu/foxmcp
|
|
6
|
+
Project-URL: Issues, https://github.com/ThinkerYzu/foxmcp/issues
|
|
7
|
+
License-Expression: MIT
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
Requires-Python: >=3.10
|
|
10
|
+
Requires-Dist: fastmcp<4,>=3.0.0
|
|
11
|
+
Requires-Dist: httpx>=0.27
|
|
12
|
+
Requires-Dist: pydantic>=2.11.7
|
|
13
|
+
Requires-Dist: uvicorn>=0.31.1
|
|
14
|
+
Requires-Dist: websockets>=15.0
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
|
|
17
|
+
<p align="center">
|
|
18
|
+
<img src="https://raw.githubusercontent.com/ThinkerYzu/foxmcp/master/extension/icons/foxmcp-128.png" alt="FoxMCP fox logo" width="96" height="96">
|
|
19
|
+
</p>
|
|
20
|
+
|
|
21
|
+
# FoxMCP — Firefox Browser Automation via MCP
|
|
22
|
+
|
|
23
|
+
Connect an MCP-compatible AI assistant to Firefox. Manage tabs and windows,
|
|
24
|
+
read pages, upload local files, organize bookmarks, search history, and inspect
|
|
25
|
+
network requests.
|
|
26
|
+
|
|
27
|
+
FoxMCP has two parts: a Firefox extension and a local Python server. Your AI
|
|
28
|
+
client talks to the server, which sends commands to the extension.
|
|
29
|
+
|
|
30
|
+
**Privacy:** Connected AI clients can access your browser data and run page
|
|
31
|
+
scripts. Use trusted clients and consider a dedicated Firefox profile.
|
|
32
|
+
See [SECURITY.md](SECURITY.md) for the threat model.
|
|
33
|
+
|
|
34
|
+
## Quick start
|
|
35
|
+
|
|
36
|
+
PyPI packaging is prepared for the next release; `foxmcp` has not yet been
|
|
37
|
+
published to PyPI. Use the GitHub installer below today. The upcoming
|
|
38
|
+
[uvx setup](#run-with-uvx-next-release) removes the server installation directory.
|
|
39
|
+
|
|
40
|
+
You need Firefox, an MCP client, Python **3.10+** with `venv`, and the commands
|
|
41
|
+
`bash`, `curl`, `unzip`, and `sha256sum`. The commands below use a Bash shell.
|
|
42
|
+
On Debian/Ubuntu, install missing prerequisites with
|
|
43
|
+
`sudo apt install python3 python3-venv curl unzip coreutils`.
|
|
44
|
+
|
|
45
|
+
### 1. Install the server
|
|
46
|
+
|
|
47
|
+
Run this in a new directory where you want FoxMCP installed:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
mkdir foxmcp && cd foxmcp
|
|
51
|
+
curl -fSL https://github.com/ThinkerYzu/foxmcp/releases/download/v1.5.0/install-from-github.sh | bash
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
The installer verifies the release archive checksums, creates `venv/`, installs
|
|
55
|
+
Python dependencies, and creates `start-foxmcp.sh`. It also installs example
|
|
56
|
+
scripts and a `CLAUDE.md` template, and offers to connect Claude Code.
|
|
57
|
+
|
|
58
|
+
For unattended setup, save the installer outside the target directory and run
|
|
59
|
+
`bash /path/to/install-from-github.sh --non-interactive` from an empty directory.
|
|
60
|
+
|
|
61
|
+
### 2. Install the Firefox extension
|
|
62
|
+
|
|
63
|
+
Open [FoxMCP on Firefox Add-ons](https://addons.mozilla.org/en-US/firefox/addon/foxmcp/)
|
|
64
|
+
and click **Add to Firefox**.
|
|
65
|
+
|
|
66
|
+
Use matching server and extension versions. Click the FoxMCP toolbar icon to see
|
|
67
|
+
a mismatch warning with both versions inside the popup. No automatic dialog or
|
|
68
|
+
notification opens. The server also logs a warning; older peers may show a version
|
|
69
|
+
as unavailable. Tools remain available while you update both together. Mozilla review can delay the Add-ons
|
|
70
|
+
version after a GitHub release; to try a version awaiting approval, use the
|
|
71
|
+
[temporary add-on instructions](docs/development.md#loading-in-firefox).
|
|
72
|
+
|
|
73
|
+
### 3. Start the server
|
|
74
|
+
|
|
75
|
+
From your installation directory:
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
./start-foxmcp.sh
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Leave it running. Click the FoxMCP toolbar icon in Firefox and check that it shows
|
|
82
|
+
a connected status. The default ports are **8765** for the extension's WebSocket
|
|
83
|
+
connection and **3000** for the MCP HTTP endpoint.
|
|
84
|
+
|
|
85
|
+
### 4. Connect your AI client
|
|
86
|
+
|
|
87
|
+
For Claude Code, run this in another terminal:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
claude mcp add --transport http foxmcp http://localhost:3000/mcp/
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
If the installer already connected Claude Code, skip that command.
|
|
94
|
+
|
|
95
|
+
For Codex, run:
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
codex mcp add foxmcp --url http://localhost:3000/mcp/
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
For another MCP client, add an HTTP server with URL
|
|
102
|
+
`http://localhost:3000/mcp/`.
|
|
103
|
+
|
|
104
|
+
### 5. Try it
|
|
105
|
+
|
|
106
|
+
Ask your assistant:
|
|
107
|
+
|
|
108
|
+
```text
|
|
109
|
+
List all open Firefox tabs.
|
|
110
|
+
Open https://example.org in a new tab.
|
|
111
|
+
Get the text from the current page.
|
|
112
|
+
Take a screenshot of the current tab.
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
To target a particular tab, right-click it in Firefox's tab bar and choose
|
|
116
|
+
**Tab ID = … (click to copy)**. Paste the copied `tab_id = …` into your request.
|
|
117
|
+
Tab IDs change when Firefox restarts.
|
|
118
|
+
|
|
119
|
+
## What you can do
|
|
120
|
+
|
|
121
|
+
| Area | Capabilities |
|
|
122
|
+
|---|---|
|
|
123
|
+
| Tabs and groups | List, open, close, switch, reorder, move between windows, group and ungroup; take screenshots |
|
|
124
|
+
| Windows | Create, close, focus, resize, position, minimize and maximize |
|
|
125
|
+
| Page content | Read text or HTML, execute JavaScript, run predefined scripts, load local files for uploads |
|
|
126
|
+
| Navigation | Go to a URL, go back or forward, reload |
|
|
127
|
+
| Bookmarks | List, search, create, update, move and delete bookmarks and folders |
|
|
128
|
+
| History | Search, list recent visits and delete entries |
|
|
129
|
+
| Network | Monitor requests by URL pattern; inspect headers and captured text response bodies |
|
|
130
|
+
|
|
131
|
+
Native tab groups require Firefox **139+**. Local file uploads use files readable
|
|
132
|
+
by the Python server; see [loading local files](docs/scripts.md#loading-local-files).
|
|
133
|
+
See the [API reference](docs/api-reference.md) for tool names and parameters.
|
|
134
|
+
|
|
135
|
+
## Other setup options
|
|
136
|
+
|
|
137
|
+
### Run with uvx (next release)
|
|
138
|
+
|
|
139
|
+
After the first PyPI release, install [uv](https://docs.astral.sh/uv/getting-started/installation/)
|
|
140
|
+
and the [Firefox extension](https://addons.mozilla.org/en-US/firefox/addon/foxmcp/).
|
|
141
|
+
For one Claude Code client, register a server it launches itself:
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
claude mcp add foxmcp -- uvx foxmcp --stdio
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
For several clients, start one shared HTTP server with `uvx foxmcp`, then use
|
|
148
|
+
[the HTTP registration commands](#4-connect-your-ai-client). The extension
|
|
149
|
+
connects to WebSocket port 8765 in either mode. Separate stdio clients still
|
|
150
|
+
conflict on that port, and the first browser call may need a retry while the
|
|
151
|
+
extension reconnects; see [stdio tradeoffs](docs/configuration.md#serving-mcp-over-stdio).
|
|
152
|
+
|
|
153
|
+
The packaged command includes and enables the example scripts. An explicit
|
|
154
|
+
`FOXMCP_EXT_SCRIPTS` overrides them; an empty value disables scripts. To match a
|
|
155
|
+
particular extension release, use `uvx --from foxmcp==VERSION foxmcp --stdio`,
|
|
156
|
+
replacing `VERSION` with that release's version. Python 3.10+ and Bash for the
|
|
157
|
+
shell examples are required.
|
|
158
|
+
|
|
159
|
+
### Install from source
|
|
160
|
+
|
|
161
|
+
You also need Git, `make`, and `zip` (on Debian/Ubuntu:
|
|
162
|
+
`sudo apt install git make zip`).
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
git clone https://github.com/ThinkerYzu/foxmcp.git
|
|
166
|
+
cd foxmcp
|
|
167
|
+
make install
|
|
168
|
+
make package
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
[Load the built extension in Firefox](docs/development.md#loading-in-firefox),
|
|
172
|
+
then start the server with `make run-server`. Continue with
|
|
173
|
+
[Connect your AI client](#4-connect-your-ai-client) above.
|
|
174
|
+
|
|
175
|
+
### Let your client start the server
|
|
176
|
+
|
|
177
|
+
Use stdio with `--single-instance` to start the server automatically and share it
|
|
178
|
+
across chats. Configure each client to launch
|
|
179
|
+
`venv/bin/python server/server.py --stdio --single-instance`, using absolute paths.
|
|
180
|
+
Clients discover and share the browser connection on the extension port. They
|
|
181
|
+
join an existing server or start a background worker automatically. Closing one
|
|
182
|
+
chat leaves the others connected. Automatic workers stop after 60 seconds without
|
|
183
|
+
clients; manually started servers keep running. On Windows, use `venv\Scripts\python.exe`.
|
|
184
|
+
See [stdio setup](docs/configuration.md#serving-mcp-over-stdio).
|
|
185
|
+
|
|
186
|
+
## Configuration
|
|
187
|
+
|
|
188
|
+
Click the FoxMCP toolbar icon to change extension connection settings. If you
|
|
189
|
+
change the WebSocket port, change it on both the extension and the server.
|
|
190
|
+
|
|
191
|
+
For manual startup, run these from the installation directory:
|
|
192
|
+
|
|
193
|
+
```bash
|
|
194
|
+
# Custom WebSocket and MCP HTTP ports
|
|
195
|
+
venv/bin/python server/server.py --port 9000 --mcp-port 4000
|
|
196
|
+
|
|
197
|
+
# Hide tool groups from clients
|
|
198
|
+
venv/bin/python server/server.py --disable-tools bookmarks,history
|
|
199
|
+
|
|
200
|
+
# Hide a group but keep its screenshot tool
|
|
201
|
+
venv/bin/python server/server.py --disable-tools tabs --enable-tools tabs_capture_screenshot
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
All **45 tools** are enabled by default. Available groups are `windows`, `tabs`,
|
|
205
|
+
`containers`, `bookmarks`, `navigation`, `content`, `requests`, `history`, and `debug`.
|
|
206
|
+
See [configuration](docs/configuration.md) for client examples and other options.
|
|
207
|
+
|
|
208
|
+
## Firefox containers
|
|
209
|
+
|
|
210
|
+
Use `containers_list` to discover named containers and their opaque
|
|
211
|
+
`cookie_store_id` values. Pass one to `tabs_create` to open in that container,
|
|
212
|
+
or to `tabs_list` to filter. Use `firefox-default` for normal browsing. Omission
|
|
213
|
+
keeps existing behavior; invalid selections fail without opening a fallback tab.
|
|
214
|
+
|
|
215
|
+
`containers_create`, `containers_update` and `containers_remove` manage persistent
|
|
216
|
+
profile containers. Removal clears stored site data and refuses containers with
|
|
217
|
+
open tabs. Containers survive client disconnects. See the
|
|
218
|
+
[API reference](docs/api-reference.md#firefox-containers) for details.
|
|
219
|
+
|
|
220
|
+
The extension requires `contextualIdentities` and `cookies` permissions for
|
|
221
|
+
container APIs and tab selection. Installation can enable Firefox containers;
|
|
222
|
+
subsequent disabling is respected. Update both extension and server together.
|
|
223
|
+
|
|
224
|
+
## Predefined scripts
|
|
225
|
+
|
|
226
|
+
External executable scripts can generate JavaScript for FoxMCP to run in a tab.
|
|
227
|
+
The release installer configures the examples in `predefined-scripts/`; the
|
|
228
|
+
packaged `foxmcp` command uses its bundled examples by default. Both include
|
|
229
|
+
DOM summaries, YouTube controls, calendar extraction, and a file-input helper.
|
|
230
|
+
Ask your assistant which predefined scripts are available.
|
|
231
|
+
|
|
232
|
+
For your own scripts, set `FOXMCP_EXT_SCRIPTS` to their directory **before starting
|
|
233
|
+
the server**. For example, save this as `get-title.sh` in that directory and run
|
|
234
|
+
`chmod +x get-title.sh`:
|
|
235
|
+
|
|
236
|
+
```bash
|
|
237
|
+
#!/bin/bash
|
|
238
|
+
# Return the current page title.
|
|
239
|
+
echo 'document.title'
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
Then ask your assistant to run `get-title.sh` in a tab. Restart the server after
|
|
243
|
+
adding scripts to refresh the list shown to clients. See the
|
|
244
|
+
[script guide](docs/scripts.md) for arguments, setup, and file upload examples.
|
|
245
|
+
|
|
246
|
+
## Troubleshooting
|
|
247
|
+
|
|
248
|
+
| Problem | Check |
|
|
249
|
+
|---|---|
|
|
250
|
+
| Extension disconnected | Start the server and check the host/port in the FoxMCP popup. `curl -i http://localhost:8765` should return **426 Upgrade Required**. |
|
|
251
|
+
| MCP client cannot connect | Check its URL. `curl -i http://localhost:3000/mcp/` should return a **307** redirect when using HTTP mode. |
|
|
252
|
+
| Server logs “address already in use” | Another service owns a port. FoxMCP can keep running even when its MCP listener fails; use [different ports](docs/development.md#port-conflicts) and check both listeners. |
|
|
253
|
+
| Server reports missing Python packages | Use `venv/bin/python`, or the provided startup script. |
|
|
254
|
+
| Built extension will not install | Follow the [Firefox channel and signing guidance](docs/development.md#loading-in-firefox). |
|
|
255
|
+
|
|
256
|
+
For other errors, run the server in the foreground and inspect its output.
|
|
257
|
+
|
|
258
|
+
## Documentation and development
|
|
259
|
+
|
|
260
|
+
- [Configuration](docs/configuration.md) — ports, MCP clients, tool selection and reconnect behavior
|
|
261
|
+
- [API reference](docs/api-reference.md) — all tools and parameters
|
|
262
|
+
- [Scripts](docs/scripts.md) — reusable automation and local file uploads
|
|
263
|
+
- [Request monitoring](docs/web-request-monitoring.md) — filters, response bodies and monitor lifetime
|
|
264
|
+
- [Development](docs/development.md) — extension installation, builds, tests and release workflow
|
|
265
|
+
- [Architecture](docs/architecture.md) and [protocol](docs/protocol.md) — how the components communicate
|
|
266
|
+
- [Release notes](RELEASES.md) and [changelog](CHANGELOG.md) — updates and upgrade instructions
|
|
267
|
+
- [Security](SECURITY.md) — trust boundaries and vulnerability reporting
|
|
268
|
+
|
|
269
|
+
To contribute, fork the repository, run `make setup` and `make test`, and submit
|
|
270
|
+
a pull request with tests for new behavior.
|
|
271
|
+
|
|
272
|
+
Licensed under the [MIT License](LICENSE).
|
foxmcp-1.5.0/README.md
ADDED
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="https://raw.githubusercontent.com/ThinkerYzu/foxmcp/master/extension/icons/foxmcp-128.png" alt="FoxMCP fox logo" width="96" height="96">
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
# FoxMCP — Firefox Browser Automation via MCP
|
|
6
|
+
|
|
7
|
+
Connect an MCP-compatible AI assistant to Firefox. Manage tabs and windows,
|
|
8
|
+
read pages, upload local files, organize bookmarks, search history, and inspect
|
|
9
|
+
network requests.
|
|
10
|
+
|
|
11
|
+
FoxMCP has two parts: a Firefox extension and a local Python server. Your AI
|
|
12
|
+
client talks to the server, which sends commands to the extension.
|
|
13
|
+
|
|
14
|
+
**Privacy:** Connected AI clients can access your browser data and run page
|
|
15
|
+
scripts. Use trusted clients and consider a dedicated Firefox profile.
|
|
16
|
+
See [SECURITY.md](SECURITY.md) for the threat model.
|
|
17
|
+
|
|
18
|
+
## Quick start
|
|
19
|
+
|
|
20
|
+
PyPI packaging is prepared for the next release; `foxmcp` has not yet been
|
|
21
|
+
published to PyPI. Use the GitHub installer below today. The upcoming
|
|
22
|
+
[uvx setup](#run-with-uvx-next-release) removes the server installation directory.
|
|
23
|
+
|
|
24
|
+
You need Firefox, an MCP client, Python **3.10+** with `venv`, and the commands
|
|
25
|
+
`bash`, `curl`, `unzip`, and `sha256sum`. The commands below use a Bash shell.
|
|
26
|
+
On Debian/Ubuntu, install missing prerequisites with
|
|
27
|
+
`sudo apt install python3 python3-venv curl unzip coreutils`.
|
|
28
|
+
|
|
29
|
+
### 1. Install the server
|
|
30
|
+
|
|
31
|
+
Run this in a new directory where you want FoxMCP installed:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
mkdir foxmcp && cd foxmcp
|
|
35
|
+
curl -fSL https://github.com/ThinkerYzu/foxmcp/releases/download/v1.5.0/install-from-github.sh | bash
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
The installer verifies the release archive checksums, creates `venv/`, installs
|
|
39
|
+
Python dependencies, and creates `start-foxmcp.sh`. It also installs example
|
|
40
|
+
scripts and a `CLAUDE.md` template, and offers to connect Claude Code.
|
|
41
|
+
|
|
42
|
+
For unattended setup, save the installer outside the target directory and run
|
|
43
|
+
`bash /path/to/install-from-github.sh --non-interactive` from an empty directory.
|
|
44
|
+
|
|
45
|
+
### 2. Install the Firefox extension
|
|
46
|
+
|
|
47
|
+
Open [FoxMCP on Firefox Add-ons](https://addons.mozilla.org/en-US/firefox/addon/foxmcp/)
|
|
48
|
+
and click **Add to Firefox**.
|
|
49
|
+
|
|
50
|
+
Use matching server and extension versions. Click the FoxMCP toolbar icon to see
|
|
51
|
+
a mismatch warning with both versions inside the popup. No automatic dialog or
|
|
52
|
+
notification opens. The server also logs a warning; older peers may show a version
|
|
53
|
+
as unavailable. Tools remain available while you update both together. Mozilla review can delay the Add-ons
|
|
54
|
+
version after a GitHub release; to try a version awaiting approval, use the
|
|
55
|
+
[temporary add-on instructions](docs/development.md#loading-in-firefox).
|
|
56
|
+
|
|
57
|
+
### 3. Start the server
|
|
58
|
+
|
|
59
|
+
From your installation directory:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
./start-foxmcp.sh
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Leave it running. Click the FoxMCP toolbar icon in Firefox and check that it shows
|
|
66
|
+
a connected status. The default ports are **8765** for the extension's WebSocket
|
|
67
|
+
connection and **3000** for the MCP HTTP endpoint.
|
|
68
|
+
|
|
69
|
+
### 4. Connect your AI client
|
|
70
|
+
|
|
71
|
+
For Claude Code, run this in another terminal:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
claude mcp add --transport http foxmcp http://localhost:3000/mcp/
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
If the installer already connected Claude Code, skip that command.
|
|
78
|
+
|
|
79
|
+
For Codex, run:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
codex mcp add foxmcp --url http://localhost:3000/mcp/
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
For another MCP client, add an HTTP server with URL
|
|
86
|
+
`http://localhost:3000/mcp/`.
|
|
87
|
+
|
|
88
|
+
### 5. Try it
|
|
89
|
+
|
|
90
|
+
Ask your assistant:
|
|
91
|
+
|
|
92
|
+
```text
|
|
93
|
+
List all open Firefox tabs.
|
|
94
|
+
Open https://example.org in a new tab.
|
|
95
|
+
Get the text from the current page.
|
|
96
|
+
Take a screenshot of the current tab.
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
To target a particular tab, right-click it in Firefox's tab bar and choose
|
|
100
|
+
**Tab ID = … (click to copy)**. Paste the copied `tab_id = …` into your request.
|
|
101
|
+
Tab IDs change when Firefox restarts.
|
|
102
|
+
|
|
103
|
+
## What you can do
|
|
104
|
+
|
|
105
|
+
| Area | Capabilities |
|
|
106
|
+
|---|---|
|
|
107
|
+
| Tabs and groups | List, open, close, switch, reorder, move between windows, group and ungroup; take screenshots |
|
|
108
|
+
| Windows | Create, close, focus, resize, position, minimize and maximize |
|
|
109
|
+
| Page content | Read text or HTML, execute JavaScript, run predefined scripts, load local files for uploads |
|
|
110
|
+
| Navigation | Go to a URL, go back or forward, reload |
|
|
111
|
+
| Bookmarks | List, search, create, update, move and delete bookmarks and folders |
|
|
112
|
+
| History | Search, list recent visits and delete entries |
|
|
113
|
+
| Network | Monitor requests by URL pattern; inspect headers and captured text response bodies |
|
|
114
|
+
|
|
115
|
+
Native tab groups require Firefox **139+**. Local file uploads use files readable
|
|
116
|
+
by the Python server; see [loading local files](docs/scripts.md#loading-local-files).
|
|
117
|
+
See the [API reference](docs/api-reference.md) for tool names and parameters.
|
|
118
|
+
|
|
119
|
+
## Other setup options
|
|
120
|
+
|
|
121
|
+
### Run with uvx (next release)
|
|
122
|
+
|
|
123
|
+
After the first PyPI release, install [uv](https://docs.astral.sh/uv/getting-started/installation/)
|
|
124
|
+
and the [Firefox extension](https://addons.mozilla.org/en-US/firefox/addon/foxmcp/).
|
|
125
|
+
For one Claude Code client, register a server it launches itself:
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
claude mcp add foxmcp -- uvx foxmcp --stdio
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
For several clients, start one shared HTTP server with `uvx foxmcp`, then use
|
|
132
|
+
[the HTTP registration commands](#4-connect-your-ai-client). The extension
|
|
133
|
+
connects to WebSocket port 8765 in either mode. Separate stdio clients still
|
|
134
|
+
conflict on that port, and the first browser call may need a retry while the
|
|
135
|
+
extension reconnects; see [stdio tradeoffs](docs/configuration.md#serving-mcp-over-stdio).
|
|
136
|
+
|
|
137
|
+
The packaged command includes and enables the example scripts. An explicit
|
|
138
|
+
`FOXMCP_EXT_SCRIPTS` overrides them; an empty value disables scripts. To match a
|
|
139
|
+
particular extension release, use `uvx --from foxmcp==VERSION foxmcp --stdio`,
|
|
140
|
+
replacing `VERSION` with that release's version. Python 3.10+ and Bash for the
|
|
141
|
+
shell examples are required.
|
|
142
|
+
|
|
143
|
+
### Install from source
|
|
144
|
+
|
|
145
|
+
You also need Git, `make`, and `zip` (on Debian/Ubuntu:
|
|
146
|
+
`sudo apt install git make zip`).
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
git clone https://github.com/ThinkerYzu/foxmcp.git
|
|
150
|
+
cd foxmcp
|
|
151
|
+
make install
|
|
152
|
+
make package
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
[Load the built extension in Firefox](docs/development.md#loading-in-firefox),
|
|
156
|
+
then start the server with `make run-server`. Continue with
|
|
157
|
+
[Connect your AI client](#4-connect-your-ai-client) above.
|
|
158
|
+
|
|
159
|
+
### Let your client start the server
|
|
160
|
+
|
|
161
|
+
Use stdio with `--single-instance` to start the server automatically and share it
|
|
162
|
+
across chats. Configure each client to launch
|
|
163
|
+
`venv/bin/python server/server.py --stdio --single-instance`, using absolute paths.
|
|
164
|
+
Clients discover and share the browser connection on the extension port. They
|
|
165
|
+
join an existing server or start a background worker automatically. Closing one
|
|
166
|
+
chat leaves the others connected. Automatic workers stop after 60 seconds without
|
|
167
|
+
clients; manually started servers keep running. On Windows, use `venv\Scripts\python.exe`.
|
|
168
|
+
See [stdio setup](docs/configuration.md#serving-mcp-over-stdio).
|
|
169
|
+
|
|
170
|
+
## Configuration
|
|
171
|
+
|
|
172
|
+
Click the FoxMCP toolbar icon to change extension connection settings. If you
|
|
173
|
+
change the WebSocket port, change it on both the extension and the server.
|
|
174
|
+
|
|
175
|
+
For manual startup, run these from the installation directory:
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
# Custom WebSocket and MCP HTTP ports
|
|
179
|
+
venv/bin/python server/server.py --port 9000 --mcp-port 4000
|
|
180
|
+
|
|
181
|
+
# Hide tool groups from clients
|
|
182
|
+
venv/bin/python server/server.py --disable-tools bookmarks,history
|
|
183
|
+
|
|
184
|
+
# Hide a group but keep its screenshot tool
|
|
185
|
+
venv/bin/python server/server.py --disable-tools tabs --enable-tools tabs_capture_screenshot
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
All **45 tools** are enabled by default. Available groups are `windows`, `tabs`,
|
|
189
|
+
`containers`, `bookmarks`, `navigation`, `content`, `requests`, `history`, and `debug`.
|
|
190
|
+
See [configuration](docs/configuration.md) for client examples and other options.
|
|
191
|
+
|
|
192
|
+
## Firefox containers
|
|
193
|
+
|
|
194
|
+
Use `containers_list` to discover named containers and their opaque
|
|
195
|
+
`cookie_store_id` values. Pass one to `tabs_create` to open in that container,
|
|
196
|
+
or to `tabs_list` to filter. Use `firefox-default` for normal browsing. Omission
|
|
197
|
+
keeps existing behavior; invalid selections fail without opening a fallback tab.
|
|
198
|
+
|
|
199
|
+
`containers_create`, `containers_update` and `containers_remove` manage persistent
|
|
200
|
+
profile containers. Removal clears stored site data and refuses containers with
|
|
201
|
+
open tabs. Containers survive client disconnects. See the
|
|
202
|
+
[API reference](docs/api-reference.md#firefox-containers) for details.
|
|
203
|
+
|
|
204
|
+
The extension requires `contextualIdentities` and `cookies` permissions for
|
|
205
|
+
container APIs and tab selection. Installation can enable Firefox containers;
|
|
206
|
+
subsequent disabling is respected. Update both extension and server together.
|
|
207
|
+
|
|
208
|
+
## Predefined scripts
|
|
209
|
+
|
|
210
|
+
External executable scripts can generate JavaScript for FoxMCP to run in a tab.
|
|
211
|
+
The release installer configures the examples in `predefined-scripts/`; the
|
|
212
|
+
packaged `foxmcp` command uses its bundled examples by default. Both include
|
|
213
|
+
DOM summaries, YouTube controls, calendar extraction, and a file-input helper.
|
|
214
|
+
Ask your assistant which predefined scripts are available.
|
|
215
|
+
|
|
216
|
+
For your own scripts, set `FOXMCP_EXT_SCRIPTS` to their directory **before starting
|
|
217
|
+
the server**. For example, save this as `get-title.sh` in that directory and run
|
|
218
|
+
`chmod +x get-title.sh`:
|
|
219
|
+
|
|
220
|
+
```bash
|
|
221
|
+
#!/bin/bash
|
|
222
|
+
# Return the current page title.
|
|
223
|
+
echo 'document.title'
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
Then ask your assistant to run `get-title.sh` in a tab. Restart the server after
|
|
227
|
+
adding scripts to refresh the list shown to clients. See the
|
|
228
|
+
[script guide](docs/scripts.md) for arguments, setup, and file upload examples.
|
|
229
|
+
|
|
230
|
+
## Troubleshooting
|
|
231
|
+
|
|
232
|
+
| Problem | Check |
|
|
233
|
+
|---|---|
|
|
234
|
+
| Extension disconnected | Start the server and check the host/port in the FoxMCP popup. `curl -i http://localhost:8765` should return **426 Upgrade Required**. |
|
|
235
|
+
| MCP client cannot connect | Check its URL. `curl -i http://localhost:3000/mcp/` should return a **307** redirect when using HTTP mode. |
|
|
236
|
+
| Server logs “address already in use” | Another service owns a port. FoxMCP can keep running even when its MCP listener fails; use [different ports](docs/development.md#port-conflicts) and check both listeners. |
|
|
237
|
+
| Server reports missing Python packages | Use `venv/bin/python`, or the provided startup script. |
|
|
238
|
+
| Built extension will not install | Follow the [Firefox channel and signing guidance](docs/development.md#loading-in-firefox). |
|
|
239
|
+
|
|
240
|
+
For other errors, run the server in the foreground and inspect its output.
|
|
241
|
+
|
|
242
|
+
## Documentation and development
|
|
243
|
+
|
|
244
|
+
- [Configuration](docs/configuration.md) — ports, MCP clients, tool selection and reconnect behavior
|
|
245
|
+
- [API reference](docs/api-reference.md) — all tools and parameters
|
|
246
|
+
- [Scripts](docs/scripts.md) — reusable automation and local file uploads
|
|
247
|
+
- [Request monitoring](docs/web-request-monitoring.md) — filters, response bodies and monitor lifetime
|
|
248
|
+
- [Development](docs/development.md) — extension installation, builds, tests and release workflow
|
|
249
|
+
- [Architecture](docs/architecture.md) and [protocol](docs/protocol.md) — how the components communicate
|
|
250
|
+
- [Release notes](RELEASES.md) and [changelog](CHANGELOG.md) — updates and upgrade instructions
|
|
251
|
+
- [Security](SECURITY.md) — trust boundaries and vulnerability reporting
|
|
252
|
+
|
|
253
|
+
To contribute, fork the repository, run `make setup` and `make test`, and submit
|
|
254
|
+
a pull request with tests for new behavior.
|
|
255
|
+
|
|
256
|
+
Licensed under the [MIT License](LICENSE).
|