ferrum-mcp 1.0.0
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.
- checksums.yaml +7 -0
- data/.env.example +90 -0
- data/CHANGELOG.md +229 -0
- data/CONTRIBUTING.md +469 -0
- data/LICENSE +21 -0
- data/README.md +334 -0
- data/SECURITY.md +286 -0
- data/bin/ferrum-mcp +66 -0
- data/bin/lint +10 -0
- data/bin/serve +3 -0
- data/bin/test +4 -0
- data/docs/API_REFERENCE.md +1410 -0
- data/docs/CONFIGURATION.md +254 -0
- data/docs/DEPLOYMENT.md +846 -0
- data/docs/DOCKER.md +836 -0
- data/docs/DOCKER_BOTBROWSER.md +455 -0
- data/docs/GETTING_STARTED.md +249 -0
- data/docs/TROUBLESHOOTING.md +677 -0
- data/lib/ferrum_mcp/browser_manager.rb +101 -0
- data/lib/ferrum_mcp/cli/command_handler.rb +99 -0
- data/lib/ferrum_mcp/cli/server_runner.rb +166 -0
- data/lib/ferrum_mcp/configuration.rb +229 -0
- data/lib/ferrum_mcp/resource_manager.rb +223 -0
- data/lib/ferrum_mcp/server.rb +254 -0
- data/lib/ferrum_mcp/session.rb +227 -0
- data/lib/ferrum_mcp/session_manager.rb +183 -0
- data/lib/ferrum_mcp/tools/accept_cookies_tool.rb +458 -0
- data/lib/ferrum_mcp/tools/base_tool.rb +114 -0
- data/lib/ferrum_mcp/tools/clear_cookies_tool.rb +66 -0
- data/lib/ferrum_mcp/tools/click_tool.rb +218 -0
- data/lib/ferrum_mcp/tools/close_session_tool.rb +49 -0
- data/lib/ferrum_mcp/tools/create_session_tool.rb +146 -0
- data/lib/ferrum_mcp/tools/drag_and_drop_tool.rb +171 -0
- data/lib/ferrum_mcp/tools/evaluate_js_tool.rb +46 -0
- data/lib/ferrum_mcp/tools/execute_script_tool.rb +48 -0
- data/lib/ferrum_mcp/tools/fill_form_tool.rb +78 -0
- data/lib/ferrum_mcp/tools/find_by_text_tool.rb +153 -0
- data/lib/ferrum_mcp/tools/get_attribute_tool.rb +56 -0
- data/lib/ferrum_mcp/tools/get_cookies_tool.rb +70 -0
- data/lib/ferrum_mcp/tools/get_html_tool.rb +52 -0
- data/lib/ferrum_mcp/tools/get_session_info_tool.rb +40 -0
- data/lib/ferrum_mcp/tools/get_text_tool.rb +67 -0
- data/lib/ferrum_mcp/tools/get_title_tool.rb +42 -0
- data/lib/ferrum_mcp/tools/get_url_tool.rb +39 -0
- data/lib/ferrum_mcp/tools/go_back_tool.rb +49 -0
- data/lib/ferrum_mcp/tools/go_forward_tool.rb +49 -0
- data/lib/ferrum_mcp/tools/hover_tool.rb +76 -0
- data/lib/ferrum_mcp/tools/list_sessions_tool.rb +33 -0
- data/lib/ferrum_mcp/tools/navigate_tool.rb +59 -0
- data/lib/ferrum_mcp/tools/press_key_tool.rb +91 -0
- data/lib/ferrum_mcp/tools/query_shadow_dom_tool.rb +225 -0
- data/lib/ferrum_mcp/tools/refresh_tool.rb +49 -0
- data/lib/ferrum_mcp/tools/screenshot_tool.rb +121 -0
- data/lib/ferrum_mcp/tools/session_tool.rb +37 -0
- data/lib/ferrum_mcp/tools/set_cookie_tool.rb +77 -0
- data/lib/ferrum_mcp/tools/solve_captcha_tool.rb +528 -0
- data/lib/ferrum_mcp/transport/http_server.rb +93 -0
- data/lib/ferrum_mcp/transport/rate_limiter.rb +79 -0
- data/lib/ferrum_mcp/transport/stdio_server.rb +63 -0
- data/lib/ferrum_mcp/version.rb +5 -0
- data/lib/ferrum_mcp/whisper_service.rb +222 -0
- data/lib/ferrum_mcp.rb +35 -0
- metadata +248 -0
|
@@ -0,0 +1,455 @@
|
|
|
1
|
+
# Docker with BotBrowser Integration
|
|
2
|
+
|
|
3
|
+
This guide explains how to build and run FerrumMCP Docker images with BotBrowser support for anti-detection capabilities.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
FerrumMCP supports two Docker image variants:
|
|
8
|
+
|
|
9
|
+
1. **Standard** (`Dockerfile`): Uses system Chromium - lightweight, faster builds
|
|
10
|
+
2. **BotBrowser** (`Dockerfile.with-botbrowser`): Includes BotBrowser binary - anti-detection
|
|
11
|
+
|
|
12
|
+
## BotBrowser vs Standard Chromium
|
|
13
|
+
|
|
14
|
+
| Feature | Standard Chromium | BotBrowser |
|
|
15
|
+
|---------|-------------------|------------|
|
|
16
|
+
| Size | ~1.96GB | ~2.5GB+ |
|
|
17
|
+
| Anti-detection | Basic | Advanced |
|
|
18
|
+
| Fingerprint masking | No | Yes |
|
|
19
|
+
| Profile support | No | Yes (encrypted profiles) |
|
|
20
|
+
| Use case | General automation | Protected sites, account creation |
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Prerequisites
|
|
25
|
+
|
|
26
|
+
### BotBrowser Binary
|
|
27
|
+
|
|
28
|
+
BotBrowser is **open-source** but the browser binary must be obtained separately:
|
|
29
|
+
|
|
30
|
+
1. **Download from GitHub Releases**:
|
|
31
|
+
```bash
|
|
32
|
+
# Visit https://github.com/MiddleSchoolStudent/BotBrowser/releases
|
|
33
|
+
# Download the latest Linux binary for your architecture (amd64/arm64)
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
2. **Or compile from source**:
|
|
37
|
+
```bash
|
|
38
|
+
git clone https://github.com/MiddleSchoolStudent/BotBrowser.git
|
|
39
|
+
cd BotBrowser
|
|
40
|
+
# Follow compilation instructions in the repository
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### BotBrowser Profiles (Optional)
|
|
44
|
+
|
|
45
|
+
Encrypted profiles are **licensed separately** and should be obtained from:
|
|
46
|
+
- BotBrowser team directly
|
|
47
|
+
- Authorized resellers
|
|
48
|
+
- Your own generated profiles (requires private key)
|
|
49
|
+
|
|
50
|
+
**Note**: The Docker image doesn't include profiles - they should be mounted as volumes at runtime.
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## Building the Image
|
|
55
|
+
|
|
56
|
+
### Option 1: Copy BotBrowser Binary from Build Context
|
|
57
|
+
|
|
58
|
+
1. **Prepare BotBrowser directory**:
|
|
59
|
+
```bash
|
|
60
|
+
cd /path/to/ferrum-mcp
|
|
61
|
+
mkdir -p botbrowser
|
|
62
|
+
|
|
63
|
+
# Copy BotBrowser binary (adjust paths)
|
|
64
|
+
cp /path/to/botbrowser/chrome botbrowser/
|
|
65
|
+
cp -r /path/to/botbrowser/lib* botbrowser/ # Copy required libraries
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
2. **Build the image**:
|
|
69
|
+
```bash
|
|
70
|
+
docker build \
|
|
71
|
+
-f Dockerfile.with-botbrowser \
|
|
72
|
+
--build-arg INCLUDE_BOTBROWSER=true \
|
|
73
|
+
-t ferrum-mcp:botbrowser \
|
|
74
|
+
.
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Option 2: Download During Build (Advanced)
|
|
78
|
+
|
|
79
|
+
Uncomment the download section in `Dockerfile.with-botbrowser` and provide the URL:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
docker build \
|
|
83
|
+
-f Dockerfile.with-botbrowser \
|
|
84
|
+
--build-arg INCLUDE_BOTBROWSER=true \
|
|
85
|
+
--build-arg BOTBROWSER_DOWNLOAD_URL=https://github.com/.../botbrowser-linux-amd64.tar.gz \
|
|
86
|
+
-t ferrum-mcp:botbrowser \
|
|
87
|
+
.
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Verify the Build
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
# Check image size
|
|
94
|
+
docker images ferrum-mcp:botbrowser
|
|
95
|
+
|
|
96
|
+
# Verify BotBrowser is present
|
|
97
|
+
docker run --rm ferrum-mcp:botbrowser ls -la /opt/botbrowser
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## Running with BotBrowser
|
|
103
|
+
|
|
104
|
+
### Basic Usage (HTTP Transport)
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
docker run -d \
|
|
108
|
+
--name ferrum-mcp-bot \
|
|
109
|
+
--security-opt seccomp=unconfined \
|
|
110
|
+
-p 3000:3000 \
|
|
111
|
+
ferrum-mcp:botbrowser
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### With BotBrowser Profiles
|
|
115
|
+
|
|
116
|
+
Mount your encrypted profiles as a volume:
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
docker run -d \
|
|
120
|
+
--name ferrum-mcp-bot \
|
|
121
|
+
--security-opt seccomp=unconfined \
|
|
122
|
+
-p 3000:3000 \
|
|
123
|
+
-v /path/to/profiles:/app/profiles:ro \
|
|
124
|
+
-e BOT_PROFILE_US=/app/profiles/us_chrome.enc:US Chrome:US fingerprint \
|
|
125
|
+
-e BOT_PROFILE_EU=/app/profiles/eu_firefox.enc:EU Firefox:EU fingerprint \
|
|
126
|
+
ferrum-mcp:botbrowser
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### Claude Desktop Integration
|
|
130
|
+
|
|
131
|
+
**Configuration** (`claude_desktop_config.json`):
|
|
132
|
+
|
|
133
|
+
```json
|
|
134
|
+
{
|
|
135
|
+
"mcpServers": {
|
|
136
|
+
"ferrum-mcp-bot": {
|
|
137
|
+
"command": "docker",
|
|
138
|
+
"args": [
|
|
139
|
+
"run",
|
|
140
|
+
"--rm",
|
|
141
|
+
"-i",
|
|
142
|
+
"--security-opt",
|
|
143
|
+
"seccomp=unconfined",
|
|
144
|
+
"-v",
|
|
145
|
+
"/path/to/profiles:/app/profiles:ro",
|
|
146
|
+
"-e",
|
|
147
|
+
"BOT_PROFILE_US=/app/profiles/us.enc:US Profile:US Chrome fingerprint",
|
|
148
|
+
"ferrum-mcp:botbrowser",
|
|
149
|
+
"ruby",
|
|
150
|
+
"bin/ferrum-mcp",
|
|
151
|
+
"--transport",
|
|
152
|
+
"stdio"
|
|
153
|
+
],
|
|
154
|
+
"env": {}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
## Using BotBrowser Profiles
|
|
163
|
+
|
|
164
|
+
### Profile Configuration
|
|
165
|
+
|
|
166
|
+
Profiles are configured via environment variables:
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
BOT_PROFILE_<ID>=<path>:<name>:<description>
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
**Example**:
|
|
173
|
+
```bash
|
|
174
|
+
BOT_PROFILE_US=/app/profiles/us_chrome.enc:US Chrome:Chrome 142 US fingerprint
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
### Creating a Session with BotBrowser
|
|
178
|
+
|
|
179
|
+
Via MCP tools:
|
|
180
|
+
|
|
181
|
+
```json
|
|
182
|
+
{
|
|
183
|
+
"name": "create_session",
|
|
184
|
+
"arguments": {
|
|
185
|
+
"browser_id": "botbrowser",
|
|
186
|
+
"bot_profile_id": "us",
|
|
187
|
+
"headless": true
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
Or discover available profiles first:
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
# List available BotBrowser profiles
|
|
196
|
+
curl -X POST http://localhost:3000/mcp/v1 \
|
|
197
|
+
-H "Content-Type: application/json" \
|
|
198
|
+
-d '{
|
|
199
|
+
"jsonrpc": "2.0",
|
|
200
|
+
"id": 1,
|
|
201
|
+
"method": "resources/read",
|
|
202
|
+
"params": {
|
|
203
|
+
"uri": "ferrum://bot-profiles"
|
|
204
|
+
}
|
|
205
|
+
}'
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
---
|
|
209
|
+
|
|
210
|
+
## Multi-Architecture Support
|
|
211
|
+
|
|
212
|
+
### Build for Specific Platform
|
|
213
|
+
|
|
214
|
+
```bash
|
|
215
|
+
# AMD64 (x86_64)
|
|
216
|
+
docker build \
|
|
217
|
+
-f Dockerfile.with-botbrowser \
|
|
218
|
+
--build-arg INCLUDE_BOTBROWSER=true \
|
|
219
|
+
--platform linux/amd64 \
|
|
220
|
+
-t ferrum-mcp:botbrowser-amd64 \
|
|
221
|
+
.
|
|
222
|
+
|
|
223
|
+
# ARM64 (Apple Silicon, ARM servers)
|
|
224
|
+
docker build \
|
|
225
|
+
-f Dockerfile.with-botbrowser \
|
|
226
|
+
--build-arg INCLUDE_BOTBROWSER=true \
|
|
227
|
+
--platform linux/arm64 \
|
|
228
|
+
-t ferrum-mcp:botbrowser-arm64 \
|
|
229
|
+
.
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
### Multi-Arch Build with Buildx
|
|
233
|
+
|
|
234
|
+
```bash
|
|
235
|
+
docker buildx create --use
|
|
236
|
+
docker buildx build \
|
|
237
|
+
-f Dockerfile.with-botbrowser \
|
|
238
|
+
--build-arg INCLUDE_BOTBROWSER=true \
|
|
239
|
+
--platform linux/amd64,linux/arm64 \
|
|
240
|
+
-t ferrum-mcp:botbrowser \
|
|
241
|
+
--push \
|
|
242
|
+
.
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
---
|
|
246
|
+
|
|
247
|
+
## Profile Management
|
|
248
|
+
|
|
249
|
+
### Mounting Profiles
|
|
250
|
+
|
|
251
|
+
**Read-only mount** (recommended):
|
|
252
|
+
```bash
|
|
253
|
+
-v /path/to/profiles:/app/profiles:ro
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
**Read-write mount** (if profiles need updating):
|
|
257
|
+
```bash
|
|
258
|
+
-v /path/to/profiles:/app/profiles:rw
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
### Profile Directory Structure
|
|
262
|
+
|
|
263
|
+
```
|
|
264
|
+
profiles/
|
|
265
|
+
├── us_chrome_142.enc # US Chrome profile
|
|
266
|
+
├── eu_firefox_126.enc # EU Firefox profile
|
|
267
|
+
├── mobile_android.enc # Mobile Android profile
|
|
268
|
+
└── ...
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
### Environment Variables for Profiles
|
|
272
|
+
|
|
273
|
+
```bash
|
|
274
|
+
docker run -d \
|
|
275
|
+
-v $(pwd)/profiles:/app/profiles:ro \
|
|
276
|
+
-e BOT_PROFILE_US=/app/profiles/us_chrome_142.enc:US:Chrome 142 US \
|
|
277
|
+
-e BOT_PROFILE_EU=/app/profiles/eu_firefox_126.enc:EU:Firefox 126 EU \
|
|
278
|
+
-e BOT_PROFILE_MOBILE=/app/profiles/mobile_android.enc:Mobile:Android 14 \
|
|
279
|
+
ferrum-mcp:botbrowser
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
---
|
|
283
|
+
|
|
284
|
+
## Troubleshooting
|
|
285
|
+
|
|
286
|
+
### BotBrowser Not Found
|
|
287
|
+
|
|
288
|
+
**Error**: "BotBrowser binary not found at /opt/botbrowser/chrome"
|
|
289
|
+
|
|
290
|
+
**Solutions**:
|
|
291
|
+
1. Verify binary was copied during build:
|
|
292
|
+
```bash
|
|
293
|
+
docker run --rm ferrum-mcp:botbrowser ls -la /opt/botbrowser
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
2. Check build logs for errors:
|
|
297
|
+
```bash
|
|
298
|
+
docker build -f Dockerfile.with-botbrowser --no-cache . 2>&1 | grep -i bot
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
3. Ensure `INCLUDE_BOTBROWSER=true` was set during build
|
|
302
|
+
|
|
303
|
+
### Profile Not Loading
|
|
304
|
+
|
|
305
|
+
**Error**: "Failed to load BotBrowser profile"
|
|
306
|
+
|
|
307
|
+
**Solutions**:
|
|
308
|
+
1. Verify profile path is correct:
|
|
309
|
+
```bash
|
|
310
|
+
docker exec <container> ls -la /app/profiles
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
2. Check file permissions (should be readable by UID 1000):
|
|
314
|
+
```bash
|
|
315
|
+
ls -la /path/to/profiles
|
|
316
|
+
# Files should be owned by user with UID 1000 or have read permissions for all
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
3. Verify profile is encrypted (`.enc` extension):
|
|
320
|
+
```bash
|
|
321
|
+
file /path/to/profiles/*.enc
|
|
322
|
+
# Should show: data (encrypted)
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
### Performance Issues
|
|
326
|
+
|
|
327
|
+
**Symptom**: BotBrowser slower than expected
|
|
328
|
+
|
|
329
|
+
**Solutions**:
|
|
330
|
+
1. Increase Docker memory allocation (recommended: 4GB+)
|
|
331
|
+
2. Use SSD for profile storage
|
|
332
|
+
3. Reduce concurrent sessions
|
|
333
|
+
4. Consider using `--cap-add=SYS_ADMIN` instead of `--security-opt seccomp=unconfined`
|
|
334
|
+
|
|
335
|
+
---
|
|
336
|
+
|
|
337
|
+
## Security Considerations
|
|
338
|
+
|
|
339
|
+
### Profile Encryption
|
|
340
|
+
|
|
341
|
+
- Profiles should always be encrypted (`.enc` files)
|
|
342
|
+
- Never commit unencrypted profiles to version control
|
|
343
|
+
- Use read-only mounts to prevent profile modification
|
|
344
|
+
|
|
345
|
+
### Container Isolation
|
|
346
|
+
|
|
347
|
+
- Run with non-root user (default: `ferrum`, UID 1000)
|
|
348
|
+
- Use `--security-opt seccomp=unconfined` only when necessary
|
|
349
|
+
- Consider network isolation for sensitive operations
|
|
350
|
+
|
|
351
|
+
### Profile Storage
|
|
352
|
+
|
|
353
|
+
**Best practices**:
|
|
354
|
+
```bash
|
|
355
|
+
# Encrypted profiles directory with restricted permissions
|
|
356
|
+
chmod 700 ~/botbrowser-profiles
|
|
357
|
+
chmod 600 ~/botbrowser-profiles/*.enc
|
|
358
|
+
|
|
359
|
+
# Mount read-only in container
|
|
360
|
+
-v ~/botbrowser-profiles:/app/profiles:ro
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
---
|
|
364
|
+
|
|
365
|
+
## Comparison with Standard Image
|
|
366
|
+
|
|
367
|
+
### When to Use Standard Image
|
|
368
|
+
|
|
369
|
+
✅ **Use Standard (`Dockerfile`)** when:
|
|
370
|
+
- General web scraping
|
|
371
|
+
- Internal tools/APIs
|
|
372
|
+
- Sites without anti-bot protection
|
|
373
|
+
- Quick prototyping
|
|
374
|
+
- Smaller image size needed
|
|
375
|
+
|
|
376
|
+
### When to Use BotBrowser Image
|
|
377
|
+
|
|
378
|
+
✅ **Use BotBrowser (`Dockerfile.with-botbrowser`)** when:
|
|
379
|
+
- Protected sites (Cloudflare, PerimeterX, etc.)
|
|
380
|
+
- Account creation at scale
|
|
381
|
+
- Social media automation
|
|
382
|
+
- E-commerce automation
|
|
383
|
+
- Advanced anti-detection required
|
|
384
|
+
|
|
385
|
+
---
|
|
386
|
+
|
|
387
|
+
## CI/CD Integration
|
|
388
|
+
|
|
389
|
+
### GitHub Actions Example
|
|
390
|
+
|
|
391
|
+
```yaml
|
|
392
|
+
name: Build BotBrowser Image
|
|
393
|
+
|
|
394
|
+
on:
|
|
395
|
+
workflow_dispatch:
|
|
396
|
+
inputs:
|
|
397
|
+
botbrowser_url:
|
|
398
|
+
description: 'BotBrowser download URL'
|
|
399
|
+
required: true
|
|
400
|
+
|
|
401
|
+
jobs:
|
|
402
|
+
build:
|
|
403
|
+
runs-on: ubuntu-latest
|
|
404
|
+
steps:
|
|
405
|
+
- uses: actions/checkout@v4
|
|
406
|
+
|
|
407
|
+
- name: Download BotBrowser
|
|
408
|
+
run: |
|
|
409
|
+
mkdir -p botbrowser
|
|
410
|
+
wget -O botbrowser.tar.gz ${{ github.event.inputs.botbrowser_url }}
|
|
411
|
+
tar -xzf botbrowser.tar.gz -C botbrowser
|
|
412
|
+
|
|
413
|
+
- name: Build Image
|
|
414
|
+
run: |
|
|
415
|
+
docker build \
|
|
416
|
+
-f Dockerfile.with-botbrowser \
|
|
417
|
+
--build-arg INCLUDE_BOTBROWSER=true \
|
|
418
|
+
-t ferrum-mcp:botbrowser \
|
|
419
|
+
.
|
|
420
|
+
|
|
421
|
+
- name: Push to Registry
|
|
422
|
+
run: |
|
|
423
|
+
docker tag ferrum-mcp:botbrowser ${{ secrets.DOCKER_REGISTRY }}/ferrum-mcp:botbrowser
|
|
424
|
+
docker push ${{ secrets.DOCKER_REGISTRY }}/ferrum-mcp:botbrowser
|
|
425
|
+
```
|
|
426
|
+
|
|
427
|
+
---
|
|
428
|
+
|
|
429
|
+
## Next Steps
|
|
430
|
+
|
|
431
|
+
- [Docker Deployment](DOCKER.md) - General Docker deployment guide
|
|
432
|
+
- [BotBrowser Integration](BOTBROWSER_INTEGRATION.md) - Detailed BotBrowser setup
|
|
433
|
+
- [Configuration](CONFIGURATION.md) - Environment variables reference
|
|
434
|
+
- [API Reference](API_REFERENCE.md) - All available tools
|
|
435
|
+
|
|
436
|
+
---
|
|
437
|
+
|
|
438
|
+
## Support
|
|
439
|
+
|
|
440
|
+
### Getting BotBrowser
|
|
441
|
+
|
|
442
|
+
- **GitHub**: https://github.com/MiddleSchoolStudent/BotBrowser
|
|
443
|
+
- **Releases**: https://github.com/MiddleSchoolStudent/BotBrowser/releases
|
|
444
|
+
|
|
445
|
+
### Getting Profiles
|
|
446
|
+
|
|
447
|
+
Profiles must be obtained separately:
|
|
448
|
+
- Contact BotBrowser team for trial profiles
|
|
449
|
+
- Purchase enterprise profiles
|
|
450
|
+
- Generate your own (requires private key from BotBrowser)
|
|
451
|
+
|
|
452
|
+
### Issues
|
|
453
|
+
|
|
454
|
+
- BotBrowser issues: https://github.com/MiddleSchoolStudent/BotBrowser/issues
|
|
455
|
+
- FerrumMCP issues: https://github.com/Eth3rnit3/FerrumMCP/issues
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
# Getting Started with FerrumMCP
|
|
2
|
+
|
|
3
|
+
## What is FerrumMCP?
|
|
4
|
+
|
|
5
|
+
FerrumMCP provides AI assistants with browser automation capabilities via the MCP protocol. It allows your AI to navigate websites, interact with elements, extract content, and take screenshots - all through a standardized interface.
|
|
6
|
+
|
|
7
|
+
**Key features:**
|
|
8
|
+
- 🌐 Full browser automation (navigate, click, fill forms, etc.)
|
|
9
|
+
- 📸 Screenshot capture (full page or specific elements)
|
|
10
|
+
- 🔍 Content extraction (text, HTML, attributes)
|
|
11
|
+
- 🍪 Cookie management
|
|
12
|
+
- ⚡ JavaScript execution
|
|
13
|
+
- 🔄 Session-based architecture with multiple concurrent browsers
|
|
14
|
+
- 🤖 Smart cookie banner detection and acceptance
|
|
15
|
+
- 🧩 CAPTCHA solving with Whisper AI (alpha)
|
|
16
|
+
- 🦾 BotBrowser integration for anti-detection
|
|
17
|
+
|
|
18
|
+
## Quick Start
|
|
19
|
+
|
|
20
|
+
### Option 1: Using Docker (Recommended)
|
|
21
|
+
|
|
22
|
+
Pull and run the official Docker image:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
docker pull eth3rnit3/ferrum-mcp:latest
|
|
26
|
+
docker run -p 3000:3000 eth3rnit3/ferrum-mcp:latest
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
The server will be available at `http://0.0.0.0:3000`.
|
|
30
|
+
|
|
31
|
+
**Docker Hub:** [eth3rnit3/ferrum-mcp](https://hub.docker.com/r/eth3rnit3/ferrum-mcp)
|
|
32
|
+
|
|
33
|
+
### Option 2: Local Installation
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
git clone https://github.com/Eth3rnit3/FerrumMCP.git
|
|
37
|
+
cd FerrumMCP
|
|
38
|
+
bundle install
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
**Requirements:**
|
|
42
|
+
- Ruby 3.2 or higher
|
|
43
|
+
- Chrome/Chromium browser
|
|
44
|
+
- (Optional) whisper-cli for CAPTCHA solving
|
|
45
|
+
- (Optional) BotBrowser for anti-detection
|
|
46
|
+
|
|
47
|
+
### Start the Server
|
|
48
|
+
|
|
49
|
+
#### HTTP Transport (Default)
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
ruby bin/ferrum-mcp
|
|
53
|
+
# or explicitly
|
|
54
|
+
ruby bin/ferrum-mcp --transport http
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
The server will start on `http://0.0.0.0:3000` by default.
|
|
58
|
+
|
|
59
|
+
#### STDIO Transport
|
|
60
|
+
|
|
61
|
+
For MCP clients that require stdio protocol (e.g., Claude Desktop):
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
ruby bin/ferrum-mcp --transport stdio
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
#### Help and Options
|
|
68
|
+
|
|
69
|
+
View all available options:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
ruby bin/ferrum-mcp --help
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Connect Your AI Assistant
|
|
76
|
+
|
|
77
|
+
### Claude Desktop
|
|
78
|
+
|
|
79
|
+
#### Option 1: Using Docker (Recommended)
|
|
80
|
+
|
|
81
|
+
The easiest and most reliable way to run FerrumMCP with Claude Desktop is via Docker. This eliminates dependencies and provides a consistent environment.
|
|
82
|
+
|
|
83
|
+
**Prerequisites:**
|
|
84
|
+
- Docker installed and running
|
|
85
|
+
- FerrumMCP Docker image built or pulled
|
|
86
|
+
|
|
87
|
+
**Configuration file location:**
|
|
88
|
+
- **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
89
|
+
- **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
|
|
90
|
+
- **Linux**: `~/.config/Claude/claude_desktop_config.json`
|
|
91
|
+
|
|
92
|
+
**Build the image:**
|
|
93
|
+
```bash
|
|
94
|
+
cd /path/to/ferrum-mcp
|
|
95
|
+
docker build -t ferrum-mcp:latest .
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
**Or pull from Docker Hub:**
|
|
99
|
+
```bash
|
|
100
|
+
docker pull eth3rnit3/ferrum-mcp:latest
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
**Claude Desktop configuration:**
|
|
104
|
+
```json
|
|
105
|
+
{
|
|
106
|
+
"mcpServers": {
|
|
107
|
+
"ferrum-mcp": {
|
|
108
|
+
"command": "docker",
|
|
109
|
+
"args": [
|
|
110
|
+
"run",
|
|
111
|
+
"--rm",
|
|
112
|
+
"-i",
|
|
113
|
+
"--security-opt",
|
|
114
|
+
"seccomp=unconfined",
|
|
115
|
+
"ferrum-mcp:latest",
|
|
116
|
+
"ruby",
|
|
117
|
+
"bin/ferrum-mcp",
|
|
118
|
+
"--transport",
|
|
119
|
+
"stdio"
|
|
120
|
+
],
|
|
121
|
+
"env": {}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
**Important notes:**
|
|
128
|
+
- `--rm`: Automatically removes the container when it stops
|
|
129
|
+
- `-i`: Interactive mode (required for stdio communication)
|
|
130
|
+
- `--security-opt seccomp=unconfined`: Required for Chromium to run in Docker
|
|
131
|
+
- **Headless mode is mandatory** in Docker (automatically enforced)
|
|
132
|
+
- Sessions with `headless: false` will be rejected with an error
|
|
133
|
+
|
|
134
|
+
After updating the config, **restart Claude Desktop**.
|
|
135
|
+
|
|
136
|
+
#### Option 2: Using Local Ruby Installation
|
|
137
|
+
|
|
138
|
+
If you prefer running FerrumMCP locally without Docker:
|
|
139
|
+
|
|
140
|
+
```json
|
|
141
|
+
{
|
|
142
|
+
"mcpServers": {
|
|
143
|
+
"ferrum-mcp": {
|
|
144
|
+
"command": "/path/to/ruby",
|
|
145
|
+
"args": [
|
|
146
|
+
"/path/to/ferrum-mcp/bin/ferrum-mcp",
|
|
147
|
+
"--transport",
|
|
148
|
+
"stdio"
|
|
149
|
+
],
|
|
150
|
+
"env": {
|
|
151
|
+
"BROWSER_HEADLESS": "false"
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
**Important**: Replace the paths with your actual paths:
|
|
159
|
+
- **Ruby path**: Find it with `which ruby` (e.g., `/Users/username/.rbenv/versions/3.3.5/bin/ruby`)
|
|
160
|
+
- **Server path**: Full path to your `bin/ferrum-mcp` (e.g., `/Users/username/code/ferrum-mcp/bin/ferrum-mcp`)
|
|
161
|
+
|
|
162
|
+
**Example with rbenv**:
|
|
163
|
+
```json
|
|
164
|
+
{
|
|
165
|
+
"mcpServers": {
|
|
166
|
+
"ferrum-mcp": {
|
|
167
|
+
"command": "/Users/username/.rbenv/versions/3.3.5/bin/ruby",
|
|
168
|
+
"args": [
|
|
169
|
+
"/Users/username/code/ferrum-mcp/bin/ferrum-mcp",
|
|
170
|
+
"--transport",
|
|
171
|
+
"stdio"
|
|
172
|
+
],
|
|
173
|
+
"env": {
|
|
174
|
+
"BROWSER_HEADLESS": "false"
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
After updating the config, restart Claude Desktop.
|
|
182
|
+
|
|
183
|
+
#### Using HTTP Transport
|
|
184
|
+
|
|
185
|
+
Alternative setup using HTTP (requires manual server start):
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
# Start the server
|
|
189
|
+
ruby bin/ferrum-mcp --transport http
|
|
190
|
+
|
|
191
|
+
# In another terminal, add to Claude
|
|
192
|
+
claude mcp add --transport http ferrum-mcp http://0.0.0.0:3000/mcp
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
### Other MCP Clients
|
|
196
|
+
|
|
197
|
+
For any MCP-compatible client:
|
|
198
|
+
- **HTTP Transport**: Configure pointing to `http://0.0.0.0:3000/mcp`
|
|
199
|
+
- **STDIO Transport**: Run `ruby bin/ferrum-mcp --transport stdio` as a subprocess
|
|
200
|
+
|
|
201
|
+
## Usage Examples
|
|
202
|
+
|
|
203
|
+
Once connected, your AI assistant can perform browser automation tasks:
|
|
204
|
+
|
|
205
|
+
**Navigate to a website:**
|
|
206
|
+
> "Navigate to https://example.com"
|
|
207
|
+
|
|
208
|
+
**Extract information:**
|
|
209
|
+
> "Go to GitHub trending and tell me the top 3 repositories"
|
|
210
|
+
|
|
211
|
+
**Take screenshots:**
|
|
212
|
+
> "Take a screenshot of the current page"
|
|
213
|
+
|
|
214
|
+
**Interact with forms:**
|
|
215
|
+
> "Fill in the search box with 'AI tools' and submit the form"
|
|
216
|
+
|
|
217
|
+
**Execute JavaScript:**
|
|
218
|
+
> "Click the login button and wait for the page to load"
|
|
219
|
+
|
|
220
|
+
**Handle cookies:**
|
|
221
|
+
> "Accept the cookie banner on this website"
|
|
222
|
+
|
|
223
|
+
**Solve CAPTCHAs:**
|
|
224
|
+
> "Solve the audio CAPTCHA on this page"
|
|
225
|
+
|
|
226
|
+
## Session Management
|
|
227
|
+
|
|
228
|
+
FerrumMCP uses a session-based architecture. Each browser instance is managed as a session:
|
|
229
|
+
|
|
230
|
+
1. **Create a session** before performing browser operations
|
|
231
|
+
2. **Use the session ID** for all subsequent operations
|
|
232
|
+
3. **Close the session** when done (or let it auto-close after 30 minutes of inactivity)
|
|
233
|
+
|
|
234
|
+
Example workflow:
|
|
235
|
+
```
|
|
236
|
+
AI: Create a new browser session
|
|
237
|
+
AI: Navigate to https://example.com (using session ID)
|
|
238
|
+
AI: Take a screenshot (using session ID)
|
|
239
|
+
AI: Close the session
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
You can run multiple sessions concurrently with different configurations (different browsers, profiles, etc.).
|
|
243
|
+
|
|
244
|
+
## Next Steps
|
|
245
|
+
|
|
246
|
+
- Read the [API Reference](API_REFERENCE.md) to understand all available tools
|
|
247
|
+
- Check [Configuration Guide](CONFIGURATION.md) for advanced setup
|
|
248
|
+
- See [Troubleshooting](TROUBLESHOOTING.md) if you encounter issues
|
|
249
|
+
- Learn about [BotBrowser Integration](BOTBROWSER_INTEGRATION.md) for anti-detection
|