brave-real-browser-mcp-server 2.21.7 → 2.23.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.
package/README.md CHANGED
@@ -1,54 +1,13 @@
1
-
2
- ⚠️ **UNDER MAINTENANCE** - This project is still being actively developed. Some features may be incomplete or change without notice.
3
-
4
1
  # Brave Real Browser MCP Server
5
2
 
6
- Provides AI assistants with powerful, detection-resistant browser automation capabilities built on ZFC Digital's brave-real-browser package.
3
+ > **AI assistants के लिए powerful, anti-detection browser automation - Unified MCP+LSP+SSE ecosystem**
7
4
 
8
5
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
6
+ [![npm version](https://img.shields.io/npm/v/brave-real-browser-mcp-server.svg)](https://www.npmjs.com/package/brave-real-browser-mcp-server)
9
7
 
10
- ## Table of Contents
11
-
12
- 1. [Quick Start for Beginners](#quick-start-for-beginners)
13
- 2. [Introduction](#introduction)
14
- 3. [Features](#features)
15
- 4. [Prerequisites](#prerequisites)
16
- 5. [Installation](#installation)
17
- 6. [Usage](#usage)
18
- - [With Claude Desktop](#with-claude-desktop)
19
- - [With Claude Code CLI](#with-claude-code-cli)
20
- - [With Cursor IDE](#with-cursor-ide)
21
- - [With Other AI Assistants](#with-other-ai-assistants)
22
- 7. [Available Tools](#available-tools)
23
- 8. [Advanced Features](#advanced-features)
24
- 9. [Configuration](#configuration)
25
- 10. [Troubleshooting](#troubleshooting)
26
- 11. [Development](#development)
27
- 12. [Testing](#testing)
28
- 13. [Contributing](#contributing)
29
- 14. [License](#license)
30
-
31
- ## Quick Start for Beginners
32
-
33
- ### What is this?
34
- This is an MCP (Model Context Protocol) server that lets AI assistants like Claude control a real web browser. Think of it as giving Claude "hands" to interact with websites - it can click buttons, fill forms, extract content, and much more, all while avoiding bot detection.
35
-
36
- ### Important: You DON'T Need to Install This Package!
37
- If you're just using this MCP server (not developing it), you don't need to run `npm install`. The `npx` command in the configuration will automatically download and run the latest version for you. Installation is only required for development purposes.
38
-
39
- ### Step-by-Step Setup
8
+ ## 🚀 Quick Start
40
9
 
41
- #### 1. Install Node.js (Required)
42
- - Go to [nodejs.org](https://nodejs.org/)
43
- - Download and install Node.js (version 18 or higher)
44
- - Verify installation by opening terminal/command prompt and typing: `node --version`
45
-
46
- #### 2. Configure Claude Desktop
47
-
48
- **For Windows:**
49
- 1. Open File Explorer and navigate to: `%APPDATA%\Claude\`
50
- 2. Open (or create) `claude_desktop_config.json`
51
- 3. Add this configuration:
10
+ ### Option 1: NPX (Recommended for AI IDEs)
52
11
 
53
12
  ```json
54
13
  {
@@ -61,1274 +20,211 @@ If you're just using this MCP server (not developing it), you don't need to run
61
20
  }
62
21
  ```
63
22
 
64
- **For Mac:**
65
- 1. Open Finder and press `Cmd+Shift+G`
66
- 2. Go to: `~/Library/Application Support/Claude/`
67
- 3. Open (or create) `claude_desktop_config.json`
68
- 4. Add the same configuration as above
69
-
70
- **For Linux:**
71
- 1. Navigate to: `~/.config/Claude/`
72
- 2. Open (or create) `claude_desktop_config.json`
73
- 3. Add the same configuration as above
74
-
75
- **Why @latest?** The `@latest` tag ensures you always get the most recent version with bug fixes and improvements. The `npx` command automatically downloads and runs it without installing anything permanently on your system.
76
-
77
- #### 3. Restart Claude Desktop
78
- Close and reopen Claude Desktop completely.
79
-
80
- #### 4. Test It Works
81
- In Claude Desktop, try saying:
82
- > "Initialize a browser and navigate to google.com, then get the page content"
83
-
84
- If everything is working, Claude should be able to:
85
- - Start a browser
86
- - Navigate to Google
87
- - Extract and show you the page content
88
-
89
- ### What Can You Do With It?
90
-
91
- Once set up, you can ask Claude to:
92
- - **Browse websites**: "Go to amazon.com and search for laptops"
93
- - **Fill forms**: "Fill out this contact form with my details"
94
- - **Extract data**: "Get all the product prices from this page"
95
- - **Automate tasks**: "Log into my account and download my invoice"
96
- - **Solve captchas**: "Handle any captchas that appear"
97
-
98
- ### Safety Notes
99
- - Claude will show you what it's doing - you can see the browser window
100
- - Always review what Claude does before approving sensitive actions
101
- - Use headless mode (`headless: true`) if you don't want to see the browser window
102
- - Be respectful of websites' terms of service
103
-
104
- ## Introduction
105
-
106
- The Brave Real Browser MCP Server acts as a bridge between AI assistants
107
- and browser automation. It leverages brave-real-browser to provide stealth
108
- browsing capabilities that can bypass common bot detection mechanisms.
109
-
110
- This server implements the Model Context Protocol (MCP), allowing AI
111
- assistants to control a real browser, extract content, and more.
112
-
113
- ## Features
114
-
115
- - **Stealth by default**: All browser instances use anti-detection features
116
- - **Enhanced Windows support**: Comprehensive Chrome detection and ECONNREFUSED error fixes (v1.3.0)
117
- - **Smart Chrome detection**: Registry-based detection + 15+ installation paths (Windows)
118
- - **Connection resilience**: Automatic localhost/127.0.0.1 fallback with port management
119
- - **Multiple retry strategies**: 5 different connection approaches with progressive fallback
120
- - **Advanced configuration**: Full support for all brave-real-browser options
121
- - **Dynamic selector discovery**: Intelligent element finding without hardcoded selectors
122
- - **Random scrolling**: Tools for natural scrolling to avoid detection
123
- - **Comprehensive toolset**: 33 tools covering all browser automation needs
124
- - **Proxy support**: Built-in proxy configuration for enhanced privacy
125
- - **Captcha handling**: Support for solving reCAPTCHA, hCaptcha, and Turnstile
126
- - **Robust error handling**: Advanced error recovery with circuit breaker pattern
127
- - **Stack overflow protection**: Comprehensive protection against infinite recursion
128
- - **Timeout controls**: Automatic timeout mechanisms prevent hanging operations
129
- - **Platform optimization**: Windows-specific flags and longer timeouts for better compatibility
130
-
131
- ## Prerequisites
132
-
133
- - Node.js >= 18.0.0
134
- - npm or yarn
135
- - Google Chrome or Chromium browser installed
136
- - Basic understanding of TypeScript/JavaScript (for development)
137
-
138
- ### Platform-Specific Requirements
139
-
140
- **Windows:**
141
- - Google Chrome installation (automatic detection in v1.3.0+ includes):
142
- - Standard installations: `C:\Program Files\Google\Chrome\Application\chrome.exe`
143
- - 32-bit installations: `C:\Program Files (x86)\Google\Chrome\Application\chrome.exe`
144
- - User installations: `%LOCALAPPDATA%\Google\Chrome\Application\chrome.exe`
145
- - Chrome Canary: `%LOCALAPPDATA%\Google\Chrome SxS\Application\chrome.exe`
146
- - Portable installations and Registry-detected paths
147
- - Manual path specification: Use `CHROME_PATH` environment variable
23
+ **Config locations:**
24
+ - **Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
25
+ - **Mac:** `~/Library/Application Support/Claude/`
26
+ - **Linux:** `~/.config/Claude/`
148
27
 
149
- **macOS:**
150
- - Google Chrome or Chromium must be installed in `/Applications/`
151
-
152
- **Linux:**
153
- - Install Chrome/Chromium: `sudo apt-get install -y google-chrome-stable` or `sudo apt-get install -y chromium-browser`
154
- - Install xvfb for headless operation: `sudo apt-get install -y xvfb`
155
-
156
- ## Installation for Developers
157
-
158
- > **Note for Claude Desktop Users:** You don't need to install anything! The npx command in your configuration automatically handles everything. Skip to the [Usage](#usage) section.
159
-
160
- This section is for developers who want to:
161
- - Contribute to the project
162
- - Run the server locally for development
163
- - Create custom modifications
164
-
165
- ### Global Installation (For Command Line Usage)
166
-
167
- If you want to run the server directly from the command line without using npx:
168
-
169
- ```bash
170
- npm install -g brave-real-browser-mcp-server@latest
171
- ```
172
-
173
- After global installation, you can run:
174
- ```bash
175
- brave-real-browser-mcp-server
176
- ```
177
-
178
- ### Development Setup (For Contributors)
28
+ ### Option 2: Unified Server (Full Features)
179
29
 
180
30
  ```bash
181
- # Clone the repository
182
- git clone https://github.com/withLinda/brave-real-browser-mcp-server.git
183
- cd brave-real-browser-mcp-server
184
-
185
- # Install dependencies
186
- npm install
187
-
188
- # Build the project
189
- npm run build
190
-
191
- # Run in development mode
192
31
  npm run dev
193
32
  ```
194
33
 
195
- ## Usage
196
-
197
- ### With Claude Desktop
198
-
199
- The configuration below uses `npx` to automatically download and run the latest version. No installation required!
200
-
201
- ```json
202
- {
203
- "mcpServers": {
204
- "brave-real-browser": {
205
- "command": "npx",
206
- "args": ["brave-real-browser-mcp-server@latest"]
207
- }
208
- }
209
- }
210
- ```
211
-
212
- > **What does npx do?** The `npx` command downloads and runs the package without permanently installing it. The `@latest` ensures you always get the newest version with all bug fixes and improvements.
213
-
214
- ### With Claude Code CLI
215
-
216
- Claude Code CLI offers multiple convenient methods to add the brave-real-browser MCP server. Choose the method that best fits your workflow:
217
-
218
- #### Method 1: Quick Setup (Recommended)
219
-
220
- The fastest way to get started is using the `claude mcp add` command:
221
-
222
- ```bash
223
- claude mcp add brave-real-browser -- npx brave-real-browser-mcp-server@latest
224
- ```
225
-
226
- This command:
227
- - Adds the server to your local scope (available only to you in current project)
228
- - Uses npx to automatically download and run the latest version
229
- - No installation required - everything is handled automatically
230
-
231
- #### Method 2: Add with Environment Variables
232
-
233
- If you need to configure proxy settings or custom Chrome paths:
234
-
235
- ```bash
236
- claude mcp add brave-real-browser \
237
- -e CHROME_PATH="/path/to/chrome" \
238
- -e PROXY_URL="http://proxy:8080" \
239
- -- npx brave-real-browser-mcp-server@latest
240
- ```
241
-
242
- #### Method 3: Scoped Configuration
243
-
244
- **For User-Wide Access (Available Across All Projects):**
245
- ```bash
246
- claude mcp add brave-real-browser -s user -- npx brave-real-browser-mcp-server@latest
247
- ```
248
-
249
- **For Project-Wide Access (Shared with Team via .mcp.json):**
250
- ```bash
251
- claude mcp add brave-real-browser -s project -- npx brave-real-browser-mcp-server@latest
252
- ```
253
-
254
- #### Method 4: JSON Configuration
255
-
256
- For advanced users who want precise control:
257
-
258
- ```bash
259
- claude mcp add-json brave-real-browser '{
260
- "type": "stdio",
261
- "command": "npx",
262
- "args": ["brave-real-browser-mcp-server@latest"],
263
- "env": {
264
- "CHROME_PATH": "/path/to/chrome",
265
- "PROXY_URL": "http://proxy:8080"
266
- }
267
- }'
268
- ```
269
-
270
- #### Verification and Testing
271
-
272
- After adding the server:
273
-
274
- 1. **Check MCP Server Status:**
275
- ```bash
276
- /mcp
277
- ```
278
- This command in Claude Code shows all active MCP servers.
279
-
280
- 2. **Test the Server:**
281
- In Claude Code, try:
282
- > "Initialize a browser and navigate to google.com, then get the page content"
283
-
284
- If working correctly, you should see:
285
- - Browser initialization
286
- - Navigation to Google
287
- - Page content extracted and displayed
288
-
289
- #### Configuration Scopes Explained
290
-
291
- | Scope | Description | Config Location | Use Case |
292
- |-------|-------------|----------------|----------|
293
- | **local** (default) | Available only to you in current project | `.mcp.json` in project | Testing, project-specific |
294
- | **project** | Shared with entire team | `.mcp.json` committed to repo | Team collaboration |
295
- | **user** | Available to you across all projects | User config directory | Personal productivity |
296
-
297
- #### Benefits of Claude Code CLI
298
-
299
- - **Automatic Updates**: Using `@latest` ensures you get bug fixes and improvements
300
- - **No Installation**: npx handles downloading and running automatically
301
- - **Environment Variables**: Easy configuration of proxies, Chrome paths, etc.
302
- - **Scope Control**: Choose where the server is available (local/project/user)
303
- - **Team Sharing**: Project scope allows sharing configurations with teammates
304
- - **Status Monitoring**: Built-in `/mcp` command for server health checks
305
-
306
- ### With Cursor IDE
307
-
308
- Cursor IDE uses the same npx approach - no installation needed! Here are the setup methods:
309
-
310
- #### Method 1: One-Click Installation (Recommended)
311
-
312
- 1. **Open Cursor IDE**
313
- 2. **Open Command Palette** (`Ctrl+Shift+P` on Windows/Linux, `Cmd+Shift+P` on Mac)
314
- 3. **Search for "Cursor Settings"** and select it
315
- 4. **Click on "MCP" in the sidebar**
316
- 5. **Browse curated MCP servers** and install browser automation tools with one-click
317
- 6. **OAuth authentication** will be handled automatically
318
-
319
- #### Method 2: Manual Configuration
320
-
321
- **Configuration File Location:**
322
- - **Project-specific**: Create `.cursor/mcp.json` in your project directory
323
- - **Global**: Create `~/.cursor/mcp.json` in your home directory
324
-
325
- **Basic Configuration (No Installation Required):**
326
- ```json
327
- {
328
- "mcpServers": {
329
- "brave-real-browser": {
330
- "command": "npx",
331
- "args": ["brave-real-browser-mcp-server@latest"]
332
- }
333
- }
334
- }
335
- ```
336
-
337
- > **Important:** Just like Claude Desktop, Cursor will use `npx` to automatically download and run the server. You don't need to install anything with npm!
338
-
339
- **Windows-Specific Configuration (if experiencing Chrome path issues):**
340
- ```json
341
- {
342
- "mcpServers": {
343
- "brave-real-browser": {
344
- "command": "npx",
345
- "args": ["brave-real-browser-mcp-server@latest"],
346
- "env": {
347
- "CHROME_PATH": "C:/Program Files/Google/Chrome/Application/chrome.exe"
348
- }
349
- }
350
- }
351
- }
352
- ```
353
-
354
- > **Note**: Browser options like headless mode should be configured when initializing the browser through the `browser_init` tool, not via environment variables.
355
-
356
- **Advanced Configuration with Custom Chrome Path:**
357
- ```json
358
- {
359
- "mcpServers": {
360
- "brave-real-browser": {
361
- "command": "npx",
362
- "args": ["brave-real-browser-mcp-server@latest"],
363
- "env": {
364
- "CHROME_PATH": "C:/Program Files/Google/Chrome/Application/chrome.exe"
365
- }
366
- }
367
- }
368
- }
369
- ```
370
-
371
- > **Note**: Proxy settings and browser options should be configured when asking Claude to initialize the browser using the `browser_init` tool.
372
-
373
- #### Platform-Specific Chrome Paths for Cursor IDE
374
-
375
- If Chrome auto-detection fails, you can specify the Chrome path using the `CHROME_PATH` environment variable:
376
-
377
- **Windows:**
378
- ```json
379
- "env": {
380
- "CHROME_PATH": "C:/Program Files/Google/Chrome/Application/chrome.exe"
381
- }
382
- ```
383
- Alternative Windows paths:
384
- - `"C:/Program Files (x86)/Google/Chrome/Application/chrome.exe"`
385
- - `"%LOCALAPPDATA%/Google/Chrome/Application/chrome.exe"`
386
-
387
- **macOS:**
388
- ```json
389
- "env": {
390
- "CHROME_PATH": "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
391
- }
392
- ```
393
-
394
- **Linux:**
395
- ```json
396
- "env": {
397
- "CHROME_PATH": "/usr/bin/google-chrome"
398
- }
399
- ```
400
- Alternative Linux paths: `/usr/bin/chromium-browser`, `/snap/bin/chromium`
401
-
402
-
403
- #### Testing Cursor IDE Setup
404
-
405
- After configuration:
406
- 1. **Restart Cursor IDE completely**
407
- 2. **Open a new chat**
408
- 3. **Test with**: "Initialize a browser and navigate to google.com, then get the page content"
409
-
410
- If successful, you should see:
411
- - Browser window opening
412
- - Navigation to Google
413
- - Page content extracted and displayed in the chat
414
-
415
- #### Cursor IDE Troubleshooting
416
-
417
- **Common Issues:**
418
-
419
- 1. **"MCP server not found"**
420
- - Verify config file location and JSON syntax
421
- - Use [jsonlint.com](https://jsonlint.com/) to validate JSON
422
- - Ensure Node.js 18+ is installed
34
+ ---
423
35
 
424
- 2. **"Browser failed to launch" on Windows**
425
- - Add explicit Chrome path in `executablePath`
426
- - Try running Cursor IDE as Administrator
427
- - Check Windows Defender isn't blocking Chrome
36
+ ## Features
428
37
 
429
- 3. **"Permission denied"**
430
- - Use `sudo npm install -g brave-real-browser-mcp-server` on Linux/Mac
431
- - Run Command Prompt as Administrator on Windows
38
+ | Feature | Description |
39
+ |---------|-------------|
40
+ | **33 MCP Tools** | Complete browser automation toolkit |
41
+ | **Unified Server** | MCP + SSE + LSP in one command |
42
+ | **Stealth Mode** | 50+ anti-detection features |
43
+ | **Captcha Solving** | reCAPTCHA, hCaptcha, Turnstile |
44
+ | **Brave Browser** | Auto-detection, uBlock Origin built-in |
45
+ | **TypeScript Analyzer** | Full Compiler API integration |
46
+ | **Real-time Streaming** | SSE for live progress updates |
47
+ | **Auto-Sync** | SharedEventBus connects all protocols |
432
48
 
433
- 4. **Configuration not loading**
434
- - Ensure file is named exactly `mcp.json` (not `mcp.json.txt`)
435
- - Check file is in correct directory
436
- - Restart Cursor IDE after changes
49
+ ---
437
50
 
438
- ### With Other AI Assistants
51
+ ## 🌐 Unified MCP+LSP+SSE Ecosystem
439
52
 
440
- Start the server:
53
+ **एक command से सब active:**
441
54
 
442
55
  ```bash
443
- brave-real-browser-mcp-server
444
- ```
445
-
446
- Or if installed from source:
447
-
448
- ```bash
449
- npm start
450
- ```
451
-
452
- The server communicates via stdin/stdout using the MCP protocol.
453
-
454
- ### Example Interactions
455
-
456
- #### Basic Web Browsing
457
- ```text
458
- User: "Initialize a browser and navigate to example.com"
459
- AI: I'll initialize a stealth browser and navigate to the website.
460
- [Uses browser_init and navigate tools]
461
-
462
- ```
463
-
464
- #### Form Automation
465
- ```text
466
- User: "Fill in the search form with 'test query'"
467
- AI: I'll type that into the search field.
468
- [Uses type tool with selector and text]
469
-
470
- User: "Click the search button"
471
- AI: I'll click the search button.
472
- [Uses click tool]
56
+ npm run dev
473
57
  ```
474
58
 
475
- #### Data Extraction
476
- ```text
477
- User: "Get all the product names from this e-commerce page"
478
- AI: I'll extract the product information from the page.
479
- [Uses get_content tool with appropriate selectors]
480
-
481
- User: "Save the page content as text"
482
- AI: I'll get the text content of the entire page.
483
- [Uses get_content tool with type: 'text']
484
-
485
- User: "Save this page content as a markdown file"
486
- AI: I'll extract the page content and save it as a formatted markdown file.
487
- [Uses save_content_as_markdown tool with specified file path]
59
+ ### Output:
488
60
  ```
61
+ 🦁 Brave Real Browser - Unified Server v2.22.0
62
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
63
+ 📡 HTTP Server: http://localhost:3000
489
64
 
65
+ 🛠️ Available MCP Tools:
66
+ 🚀 browser_init 🔴 browser_close 🌐 navigate
67
+ 📄 get_content 🔍 find_element 🖱️ click
68
+ ⌨️ type 🤖 solve_captcha 🎬 media_extractor
69
+ ... and 24 more tools
490
70
 
491
- #### Working with Proxies
492
- ```text
493
- User: "Initialize a browser with a proxy server"
494
- AI: I'll set up the browser with your proxy configuration.
495
- [Uses browser_init with proxy: "https://proxy.example.com:8080"]
71
+ 🔗 SharedEventBus: Auto-syncing MCP ↔ LSP ↔ SSE
72
+ 📋 Total: 33 MCP tools | TypeScript Analyzer Active
73
+ Ready! All protocols unified and auto-synced.
496
74
  ```
497
75
 
498
- ## Available Tools
499
-
500
- This server provides **33 powerful tools** organized into categories for comprehensive browser automation.
501
-
502
- ---
503
-
504
- ### 🖥️ Core Browser Tools (4 tools)
505
-
506
- | Tool | Description |
507
- |------|-------------|
508
- | `browser_init` | Initialize stealth browser with anti-detection features, uBlock Origin, and configurable options (headless, proxy, plugins) |
509
- | `navigate` | Navigate to any URL with customizable wait conditions (load, domcontentloaded, networkidle) |
510
- | `get_content` | Extract page content as HTML or plain text, with optional CSS selector for specific elements |
511
- | `browser_close` | Safely close the browser instance and cleanup resources |
512
-
513
- ---
76
+ ### All Endpoints:
514
77
 
515
- ### 🖱️ Interaction Tools (4 tools)
516
-
517
- | Tool | Description |
518
- |------|-------------|
519
- | `click` | Click on any element using CSS selector, with optional navigation wait |
520
- | `type` | Type text into input fields with human-like delays between keystrokes |
521
- | `wait` | Wait for various conditions: selector visibility, navigation, or timeout |
522
- | `press_key` | Simulate keyboard key presses with modifiers (Ctrl, Shift, Alt) - supports Enter, Tab, Escape, etc. |
78
+ | Category | Endpoint | Purpose |
79
+ |----------|----------|---------|
80
+ | **MCP** | `POST /mcp` | MCP over HTTP |
81
+ | **MCP** | `GET /mcp/sse` | SSE real-time streaming |
82
+ | **MCP** | `POST /mcp/message` | SSE message handler |
83
+ | **LSP** | `POST /lsp/completion` | Autocomplete |
84
+ | **LSP** | `POST /lsp/hover` | Hover documentation |
85
+ | **LSP** | `POST /lsp/analyze` | TypeScript analysis |
86
+ | **LSP** | `POST /lsp/definition` | Go to definition |
87
+ | **LSP** | `POST /lsp/references` | Find references |
88
+ | **Other** | `GET /health` | Health check |
89
+ | **Other** | `GET /events` | Event bus stats |
523
90
 
524
91
  ---
525
92
 
526
- ### 🔍 Selector & Element Discovery Tools (4 tools)
93
+ ## 🛠️ All 33 MCP Tools
527
94
 
95
+ ### Browser Management
528
96
  | Tool | Description |
529
97
  |------|-------------|
530
- | `find_selector` | Find CSS selector for elements containing specific text (exact or partial match) |
531
- | `find_element_advanced` | Advanced element finding using XPath, CSS selectors, or text content |
532
- | `smart_selector_generator` | AI-powered selector generation based on natural language descriptions |
533
- | `batch_element_scraper` | Efficiently scrape lists of similar elements with customizable attributes |
534
-
535
- ---
536
-
537
- ### 📝 Content Extraction Tools (5 tools)
98
+ | `browser_init` | Initialize Brave browser with stealth |
99
+ | `browser_close` | Close browser instance |
538
100
 
101
+ ### Navigation
539
102
  | Tool | Description |
540
103
  |------|-------------|
541
- | `save_content_as_markdown` | Convert page content to formatted markdown file with metadata |
542
- | `search_content` | Search text or regex patterns in page content with context |
543
- | `extract_json` | Extract embedded JSON data (LD+JSON, __NEXT_DATA__, window variables) |
544
- | `scrape_meta_tags` | Extract SEO, Open Graph, and Twitter meta tags |
545
- | `extract_schema` | Extract Schema.org structured data (JSON-LD and Microdata) |
546
-
547
- ---
548
-
549
- ### 🔗 Navigation & Redirect Tools (3 tools)
104
+ | `navigate` | Navigate to URL |
105
+ | `wait` | Wait for conditions |
550
106
 
107
+ ### Content
551
108
  | Tool | Description |
552
109
  |------|-------------|
553
- | `breadcrumb_navigator` | Navigate using site breadcrumbs - find and click breadcrumb links |
554
- | `url_redirect_tracer` | Trace standard URL redirects and show the complete redirect chain |
555
- | `multi_layer_redirect_trace` | Trace complex redirects including JavaScript and meta refresh redirects |
556
-
557
- ---
558
-
559
- ### 🌐 Network & API Tools (4 tools)
110
+ | `get_content` | Get page HTML/text |
111
+ | `find_element` | Find by selector/text/AI |
112
+ | `save_content_as_markdown` | Save as markdown file |
560
113
 
114
+ ### Interaction
561
115
  | Tool | Description |
562
116
  |------|-------------|
563
- | `network_recorder` | Record full network traffic with headers, body, and response data |
564
- | `api_finder` | Discover hidden API endpoints by monitoring XHR/fetch requests |
565
- | `ajax_content_waiter` | Wait for dynamic AJAX/JavaScript content to load |
566
- | `deep_analysis` | Comprehensive analysis: console logs, network, DOM stats, and screenshot |
567
-
568
- ---
569
-
570
- ### 🎬 Media Extraction Tools (3 tools)
117
+ | `click` | Click on element |
118
+ | `type` | Type text into input |
119
+ | `press_key` | Keyboard press |
120
+ | `random_scroll` | Natural scrolling |
121
+ | `solve_captcha` | Solve CAPTCHAs |
571
122
 
123
+ ### Media Extraction
572
124
  | Tool | Description |
573
125
  |------|-------------|
574
- | `advanced_video_extraction` | Extract video URLs from pages including YouTube, Vimeo, embedded players |
575
- | `media_extractor` | Extract audio/video elements and embedded media |
576
- | `image_extractor_advanced` | Advanced image extraction with size filtering, backgrounds, and lazy-load support |
577
-
578
- ---
579
-
580
- ### 📷 Screenshot Tools (1 tool)
126
+ | `media_extractor` | Extract video/audio |
127
+ | `m3u8_parser` | Parse HLS streams |
128
+ | `stream_extractor` | Direct download URLs |
581
129
 
130
+ ### Advanced
582
131
  | Tool | Description |
583
132
  |------|-------------|
584
- | `element_screenshot` | Capture screenshot of specific elements by selector |
133
+ | `search_content` | Search patterns |
134
+ | `extract_json` | Extract embedded JSON |
135
+ | `scrape_meta_tags` | Meta/OG tags |
136
+ | `deep_analysis` | Full page analysis |
137
+ | `network_recorder` | Record traffic |
138
+ | `api_finder` | Discover APIs |
139
+ | `ajax_content_waiter` | Wait for AJAX |
140
+ | `link_harvester` | Harvest links |
141
+ | `batch_element_scraper` | Batch scrape |
142
+ | `extract_schema` | Schema.org data |
143
+ | `element_screenshot` | Screenshot element |
144
+ | `breadcrumb_navigator` | Navigate breadcrumbs |
145
+ | `redirect_tracer` | Trace redirects |
146
+ | `progress_tracker` | Track progress |
147
+ | `cookie_manager` | Manage cookies |
148
+ | `file_downloader` | Download files |
149
+ | `iframe_handler` | Handle iframes |
150
+ | `popup_handler` | Handle popups |
585
151
 
586
152
  ---
587
153
 
588
- ### 🔗 Link Tools (1 tool)
589
-
590
- | Tool | Description |
591
- |------|-------------|
592
- | `link_harvester` | Harvest all links from page with filtering (internal, external, pattern) |
154
+ ## 📋 Commands
593
155
 
594
- ---
156
+ ```bash
157
+ # Install
158
+ npm install
595
159
 
596
- ### 🛡️ Anti-Detection Tools (1 tool)
160
+ # Build
161
+ npm run build
597
162
 
598
- | Tool | Description |
599
- |------|-------------|
600
- | `solve_captcha` | Solve CAPTCHAs (reCAPTCHA, hCaptcha, Turnstile) with auto-detection |
163
+ # Development (Unified - Recommended!)
164
+ npm run dev # MCP + SSE + LSP on port 3000
601
165
 
602
- ---
166
+ # Alternate modes
167
+ npm run dev:stdio # STDIO only (for AI IDEs)
168
+ npm run dev:sse # SSE standalone
169
+ npm run dev:http # HTTP Stream standalone
603
170
 
604
- ### 📊 Utility Tools (2 tools)
171
+ # Production
172
+ npm start # Unified server
173
+ npm run start:stdio # STDIO mode
605
174
 
606
- | Tool | Description |
607
- |------|-------------|
608
- | `random_scroll` | Perform natural random scrolling to avoid bot detection |
609
- | `progress_tracker` | Track automation progress for multi-step tasks |
175
+ # Tests
176
+ npm test
177
+ npm run test:e2e
178
+ ```
610
179
 
611
180
  ---
612
181
 
613
- ### 🎬 Streaming & Download Tools (3 tools)
182
+ ## ⚙️ Environment Variables
614
183
 
615
- | Tool | Description |
616
- |------|-------------|
617
- | `iframe_handler` | Extract content from nested iframes including embedded video players |
618
- | `popup_handler` | Handle popups, new tabs, and ad overlays during navigation |
619
- | `stream_extractor` | Master tool: Extract direct download/stream URLs with automatic countdown waiting and format detection |
184
+ | Variable | Default | Description |
185
+ |----------|---------|-------------|
186
+ | `MCP_PORT` | `3000` | Server port |
187
+ | `MCP_HOST` | `localhost` | Server host |
188
+ | `DEBUG` | `false` | Debug logging |
620
189
 
621
190
  ---
622
191
 
623
- ### Tool Parameters Quick Reference
192
+ ## 🔧 Browser Options
624
193
 
625
- #### browser_init
626
194
  ```json
627
195
  {
628
196
  "headless": false,
629
- "disableXvfb": false,
630
- "ignoreAllFlags": true,
631
- "proxy": "http://proxy:8080",
632
- "plugins": ["plugin1"],
633
- "customConfig": { "bravePath": "/path/to/brave" }
634
- }
635
- ```
636
-
637
- #### navigate
638
- ```json
639
- {
640
- "url": "https://example.com",
641
- "waitUntil": "domcontentloaded" // or: load, networkidle0, networkidle2
197
+ "proxy": "http://proxy:8080"
642
198
  }
643
199
  ```
644
200
 
645
- #### get_content
646
- ```json
647
- {
648
- "type": "html", // or: text
649
- "selector": ".main-content"
650
- }
651
- ```
652
-
653
- #### search_content
654
- ```json
655
- {
656
- "pattern": "search term",
657
- "isRegex": false,
658
- "caseSensitive": false,
659
- "selector": "body"
660
- }
661
- ```
662
-
663
- #### find_element_advanced
664
- ```json
665
- {
666
- "xpath": "//button[@type='submit']",
667
- "cssSelector": "form button",
668
- "contains": "Submit"
669
- }
670
- ```
671
-
672
- ## Advanced Features
673
-
674
- ### Dynamic Selector Discovery
675
-
676
- The server includes intelligent element discovery capabilities through the `find_selector` tool:
677
-
678
- - **Text-based element finding**: Automatically locates elements containing specific text
679
- - **Smart CSS selector generation**: Creates unique, robust CSS selectors similar to Chrome DevTools
680
- - **Element type filtering**: Optionally restrict search to specific HTML elements (e.g., buttons, links)
681
- - **Exact or partial text matching**: Choose between precise text matching or substring searches
682
- - **Universal compatibility**: Works across any website without hardcoded selectors
683
-
684
- **Example Usage:**
685
- ```text
686
- User: "Find the submit button that says 'Sign Up'"
687
- AI: I'll locate that button for you.
688
- [Uses find_selector with text: "Sign Up", elementType: "button"]
689
-
690
- AI: Found button at selector: "form > button.btn-primary:nth-of-type(2)"
691
- ```
692
-
693
- This approach eliminates the need for manually crafted selectors and makes automation more reliable across different websites.
694
-
695
- ### Natural Interactions
696
-
697
- The server includes tools designed for natural browsing behavior:
698
-
699
- - **Random scrolling**: Performs scrolling with natural timing and variable distances
700
-
701
- This feature helps avoid detection by sophisticated bot-detection systems
702
- that analyze user behavior patterns.
703
-
704
- ### Captcha Handling
705
-
706
- The server includes basic support for solving common captcha types:
707
-
708
- - reCAPTCHA
709
- - hCaptcha
710
- - Cloudflare Turnstile
711
-
712
- Note that captcha solving capabilities depend on the underlying
713
- brave-real-browser implementation.
714
-
715
- ## Configuration
716
-
717
- ### Automatic Chrome Path Detection (Enhanced in v1.3.0)
718
-
719
- The server automatically detects Chrome installation paths across different operating systems with significantly improved Windows support:
720
-
721
- - **Windows (v1.3.0+)**:
722
- - Registry-based detection for installed Chrome versions
723
- - Searches 15+ common installation directories including Program Files, user-specific locations, and portable installations
724
- - Support for Chrome Canary fallback
725
- - Environment variable detection (`CHROME_PATH`, `PUPPETEER_EXECUTABLE_PATH`)
726
- - Detailed troubleshooting guidance when Chrome is not found
727
-
728
- - **macOS**: Looks for Chrome in `/Applications/Google Chrome.app/` and Chrome Canary locations
729
-
730
- - **Linux**: Checks multiple locations including `/usr/bin/google-chrome`, `/usr/bin/chromium-browser`, and snap installations
731
-
732
- **Windows Registry Detection** (NEW in v1.3.0):
733
- The server now queries Windows Registry to find Chrome installations, making detection more reliable across different installation types.
734
-
735
- If Chrome is not found automatically, you can specify a custom path using:
736
- 1. Environment variable: `set CHROME_PATH="C:\Your\Chrome\Path\chrome.exe"`
737
- 2. Browser init option: `customConfig.chromePath` when initializing the browser
738
-
739
- ### Configuring Custom Options (like headless mode)
740
- Custom options like headless mode are **not configured in the MCP config file**. Instead, they're passed when initializing the browser using the `browser_init` tool:
741
-
742
- When you ask Claude to initialize a browser, you can specify options like:
743
-
744
- ```
745
- Please initialize a browser with headless mode enabled and a 30-second timeout
746
- ```
747
-
748
- Claude will then use the `browser_init` tool with appropriate parameters:
749
-
750
- ```json
751
- {
752
- "headless": true,
753
- "connectOption": {
754
- "timeout": 30000
755
- }
756
- }
757
- ```
758
-
759
- ### Available Browser Options
760
- When initializing with `browser_init`, you can configure:
761
-
762
- - `headless`: true/false (Set to true for headless operation)
763
- - `disableXvfb`: true/false (Disable X Virtual Framebuffer)
764
- - `ignoreAllFlags`: true/false (Ignore all Chrome flags)
765
- - `proxy`: "https://proxy:8080" (Proxy server URL)
766
- - `plugins`: ["plugin1", "plugin2"] (Array of plugins to load)
767
- - `connectOption`: Additional connection options like:
768
- - `slowMo`: 250 (Slow down operations by milliseconds)
769
- - `timeout`: 60,000 (Connection timeout)
770
-
771
- The MCP config file only tells Claude where to find the server - all browser-specific options are configured through your conversations with Claude.
772
-
773
- ### Browser Options Example
774
-
775
- When initializing the browser with `browser_init`, you can configure:
776
-
777
- ```json
778
- {
779
- "headless": false,
780
- "disableXvfb": false,
781
- "ignoreAllFlags": false,
782
- "proxy": "https://proxy:8080",
783
- "plugins": ["plugin1", "plugin2"],
784
- "connectOption": {
785
- "slowMo": 250,
786
- "timeout": 60000
787
- }
788
- }
789
- ```
790
-
791
- ### Advanced Configuration Examples
792
-
793
- #### Specifying Custom Chrome Path
794
- ```json
795
- {
796
- "customConfig": {
797
- "chromePath": "C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe"
798
- }
799
- }
800
- ```
801
-
802
- #### Using a Proxy
803
- ```json
804
- {
805
- "headless": true,
806
- "proxy": "https://username:password@proxy.example.com:8080"
807
- }
808
- ```
809
-
810
- #### Stealth Mode with Custom Options
811
- ```json
812
- {
813
- "headless": false,
814
- "ignoreAllFlags": true,
815
- "disableXvfb": false,
816
- "connectOption": {
817
- "slowMo": 100,
818
- "devtools": false
819
- }
820
- }
821
- ```
822
-
823
-
824
- ### Server Configuration
825
-
826
- For advanced users, you can modify the server behavior by editing the source code:
827
-
828
- - Change default viewport size in the `initializeBrowser` function
829
- - Adjust timeout values for various operations
830
- - Enable debug logging
831
-
832
- ## Troubleshooting
833
-
834
- ### Major Windows Connection Issues (Fixed in v1.3.0)
835
-
836
- **🔧 ECONNREFUSED Error Solutions**
837
-
838
- Version 1.3.0 includes comprehensive fixes for the `connect ECONNREFUSED 127.0.0.1:60725` error commonly experienced on Windows systems:
839
-
840
- **Enhanced Chrome Path Detection:**
841
- - Added Windows Registry-based Chrome detection
842
- - Expanded search to 15+ Windows installation locations including portable installations
843
- - Added support for Chrome Canary fallback
844
- - Environment variable support (`CHROME_PATH`, `PUPPETEER_EXECUTABLE_PATH`)
845
-
846
- **Windows-Specific Launch Optimizations:**
847
- - 20+ Windows-specific Chrome flags for better compatibility
848
- - Multiple fallback strategies (5 different connection approaches)
849
- - Progressive retry logic with exponential backoff
850
- - Enhanced timeout handling (120s for Windows vs 90s for other platforms)
851
-
852
- **Connection Resilience Features:**
853
- - Localhost vs 127.0.0.1 fallback handling (fixes known Puppeteer issue)
854
- - Port availability checking and automatic port assignment
855
- - Network connectivity testing before browser launch
856
- - Enhanced error categorization and automatic fallback strategies
857
-
858
- **If you're still experiencing ECONNREFUSED errors:**
859
-
860
- 1. **Environment Variables (Recommended):**
861
- ```bash
862
- set CHROME_PATH="C:\Program Files\Google\Chrome\Application\chrome.exe"
863
- ```
864
-
865
- 2. **Manual Chrome Path Configuration:**
866
- ```text
867
- Ask Claude: "Initialize browser with custom Chrome path at C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe"
868
- ```
869
-
870
- 3. **Network Troubleshooting:**
871
- ```bash
872
- # Test localhost resolution
873
- ping localhost
874
- # Should resolve to 127.0.0.1
875
-
876
- # Check Windows hosts file
877
- notepad C:\Windows\System32\drivers\etc\hosts
878
- # Ensure: 127.0.0.1 localhost
879
- ```
880
-
881
- 4. **Chrome Process Management:**
882
- ```bash
883
- # Kill existing Chrome processes
884
- taskkill /f /im chrome.exe
885
- ```
886
-
887
- ### Common Issues
888
-
889
- #### npx-Specific Issues
890
-
891
- 1. **"spawn npx ENOENT" or "command not found" errors**
892
- - **Cause:** npx is not in your system PATH or Node.js is not properly installed
893
- - **Solutions:**
894
- - Verify Node.js installation: `node --version` and `npm --version`
895
- - Reinstall Node.js from [nodejs.org](https://nodejs.org/)
896
- - For NVM users, see the NVM-specific section below
897
-
898
- 2. **"npx: command not found" in Claude Desktop/Cursor**
899
- - **Windows:** Make sure to restart your IDE after installing Node.js
900
- - **Mac/Linux:** Add npm to PATH: `export PATH="$PATH:$(npm bin -g)"`
901
- - **Alternative:** Use the full path to npx: `/usr/local/bin/npx`
902
-
903
- 3. **npx hangs or takes too long**
904
- - npx downloads the package on first run, which can take 30-60 seconds
905
- - Ensure you have a stable internet connection
906
- - Try clearing npm cache: `npm cache clean --force`
907
-
908
- 4. **Using NVM (Node Version Manager)?**
909
- - Standard npx commands may fail with NVM
910
- - **Solution 1:** Use absolute paths in your config:
911
- ```json
912
- {
913
- "mcpServers": {
914
- "brave-real-browser": {
915
- "command": "/Users/yourname/.nvm/versions/node/v20.0.0/bin/npx",
916
- "args": ["brave-real-browser-mcp-server@latest"]
917
- }
918
- }
919
- }
920
- ```
921
- - **Solution 2:** Set a default Node version: `nvm alias default 20.0.0`
922
-
923
- 5. **Permission denied errors with npx**
924
- - **Mac/Linux:** Try with sudo: `sudo npx brave-real-browser-mcp-server@latest`
925
- - **Better solution:** Fix npm permissions: `npm config set prefix ~/.npm`
926
-
927
- #### Other Common Issues
928
-
929
- 1. **"Maximum call stack size exceeded" errors**
930
- - This was fixed in version 1.2.0 with comprehensive stack overflow protection
931
- - The server now includes circuit breaker patterns and recursion depth tracking
932
- - Timeout controls prevent hanging operations that could lead to stack overflow
933
- - If you encounter this error, ensure you're using the latest version: `npx brave-real-browser-mcp-server@latest`
934
-
935
- 2. **"command not found" or "syntax error" when using npx**
936
- - This was fixed in version 1.0.3 with the addition of a proper shebang line
937
- - Make sure you're using the latest version: `npx brave-real-browser-mcp-server@latest`
938
- - For global installation: `npm install -g brave-real-browser-mcp-server@latest`
939
- - If still having issues, install globally: `npm install -g brave-real-browser-mcp-server`
940
- - Check your PATH includes npm global binaries: `npm config get prefix`
941
-
942
- 3. **Browser won't start**
943
- - Check if Chrome/Chromium is installed in standard locations
944
- - **Windows specific troubleshooting**:
945
-
946
- **Step 1: Verify Chrome Installation Paths**
947
- Check these locations in order:
948
- - `C:\Program Files\Google\Chrome\Application\chrome.exe`
949
- - `C:\Program Files (x86)\Google\Chrome\Application\chrome.exe`
950
- - `%LOCALAPPDATA%\Google\Chrome\Application\chrome.exe`
951
- - `%PROGRAMFILES%\Google\Chrome\Application\chrome.exe`
952
-
953
- **Step 2: Manual Path Configuration**
954
- If Chrome is in a different location, specify it manually:
955
- ```
956
- Ask Claude: "Initialize browser with custom Chrome path at C:\Your\Chrome\Path\chrome.exe"
957
- ```
958
-
959
- **Step 3: Windows Launch Arguments**
960
- For Windows compatibility, use these launch arguments:
961
- ```
962
- Ask Claude: "Initialize browser with args --disable-gpu --disable-setuid-sandbox"
963
- ```
964
-
965
- **Step 4: Windows-Specific Solutions**
966
- - **Run as Administrator**: Try running your IDE/terminal as Administrator
967
- - **Windows Defender**: Add Chrome and Node.js to Windows Defender exclusions
968
- - **Antivirus Software**: Temporarily disable antivirus to test if it's blocking Chrome
969
- - **User Account Control**: Lower UAC settings temporarily for testing
970
- - **Chrome Processes**: Kill any existing Chrome processes in Task Manager
971
-
972
- **Step 5: Alternative Chrome Installation**
973
- If Chrome detection still fails:
974
- - Download Chrome directly from [google.com/chrome](https://www.google.com/chrome/)
975
- - Install to default location (`C:\Program Files\Google\Chrome\`)
976
- - Restart your IDE after installation
977
-
978
- **Step 6: PowerShell vs Command Prompt**
979
- Try switching between PowerShell and Command Prompt:
980
- - Test with `cmd.exe` instead of PowerShell
981
- - Test with PowerShell instead of Command Prompt
982
-
983
- **Step 7: Node.js and npm Configuration**
984
- - Ensure Node.js is added to PATH: `node --version`
985
- - Clear npm cache: `npm cache clean --force`
986
- - Reinstall global packages: `npm install -g brave-real-browser-mcp-server@latest`
987
-
988
- - **Linux**: Install dependencies: `sudo apt-get install -y google-chrome-stable`
989
- - **macOS**: Ensure Chrome is in `/Applications/`
990
- - Try with `headless: true` first
991
- - Check console output for Chrome path detection messages
992
-
993
- 4. **Claude doesn't see the MCP server**
994
- - Verify `claude_desktop_config.json` is in the correct location
995
- - Check JSON syntax is valid (use [jsonlint.com](https://jsonlint.com/))
996
- - Restart Claude Desktop completely
997
- - Check for any error messages in Claude Desktop
998
-
999
- **4a. Claude Code CLI doesn't see the MCP server**
1000
- - **Installation Issues**:
1001
- - Verify `claude mcp add` command was successful
1002
- - Check command syntax: `claude mcp add brave-real-browser -- npx brave-real-browser-mcp-server@latest`
1003
- - Ensure you have the latest Claude Code CLI version
1004
-
1005
- - **Scope and Configuration**:
1006
- - Check which scope you used: local (default), project, or user
1007
- - For local scope: ensure you're in the correct project directory
1008
- - For project scope: verify `.mcp.json` exists in project root
1009
- - For user scope: check user config directory
1010
-
1011
- - **MCP Server Status**:
1012
- - Use `/mcp` command in Claude Code to check server status
1013
- - Look for the "brave-real-browser" server in the list
1014
- - Check if server status shows "connected" or error messages
1015
-
1016
- - **Environment Variables**:
1017
- - If using custom environment variables (Chrome path, proxy), verify they're correctly set
1018
- - Test without environment variables first: `claude mcp add brave-real-browser -- npx brave-real-browser-mcp-server@latest`
1019
-
1020
- - **Node.js and npx Issues**:
1021
- - Verify Node.js version 18+: `node --version`
1022
- - Test npx directly: `npx brave-real-browser-mcp-server@latest`
1023
- - Clear npm cache: `npm cache clean --force`
1024
-
1025
- - **Protocol Version Issues** (Known Issue):
1026
- - Claude CLI may show protocolVersion validation errors despite correct configuration
1027
- - This is a known issue with internal validation in Claude CLI
1028
- - Server may still work despite validation warnings
1029
-
1030
- - **Re-adding Server**:
1031
- ```bash
1032
- # Remove and re-add if issues persist
1033
- claude mcp remove brave-real-browser
1034
- claude mcp add brave-real-browser -- npx brave-real-browser-mcp-server@latest
1035
- ```
1036
-
1037
- **4b. Cursor IDE doesn't see the MCP server**
1038
- - **Config File Location Issues**:
1039
- - Verify `mcp.json` is in the correct location:
1040
- - Global: `~/.cursor/mcp.json` (`%USERPROFILE%\.cursor\mcp.json` on Windows)
1041
- - Project: `.cursor/mcp.json` in your project root
1042
- - Ensure filename is exactly `mcp.json` (not `mcp.json.txt`)
1043
- - Check file permissions allow reading
1044
-
1045
- - **JSON Syntax Validation**:
1046
- - Use [jsonlint.com](https://jsonlint.com/) to validate JSON syntax
1047
- - Common issues: missing commas, incorrect quotes, trailing commas
1048
- - Ensure proper escaping of Windows paths: `"C:/Program Files/Google/Chrome/Application/chrome.exe"`
1049
-
1050
- - **Cursor IDE Restart Process**:
1051
- - Close Cursor IDE completely (check Task Manager on Windows)
1052
- - Wait 5 seconds
1053
- - Restart Cursor IDE
1054
- - Open Command Palette and check MCP servers are listed
1055
-
1056
- - **Environment Variables**:
1057
- - Verify Node.js is accessible: `node --version`
1058
- - Check PATH includes npm: `npm --version`
1059
- - Clear any conflicting environment variables
1060
-
1061
- - **Cursor IDE Version Compatibility**:
1062
- - Ensure Cursor IDE version supports MCP (latest versions)
1063
- - Update Cursor IDE if using an older version
1064
- - Check Cursor IDE documentation for MCP requirements
1065
-
1066
- 5. **Permission denied errors**
1067
- - On Linux/Mac: Try `sudo npm install -g brave-real-browser-mcp-server`
1068
- - Or use nvm to manage Node.js without sudo
1069
- - On Windows: Run command prompt as Administrator
1070
-
1071
- 6. **Detection issues**
1072
- - Use appropriate delays between actions for better reliability
1073
- - Add random delays with `random_scroll`
1074
- - Use proxy if needed: `proxy: "http://proxy.example.com:8080"`
1075
-
1076
- 7. **Memory leaks**
1077
- - Always close browser instances with `browser_close` when done
1078
- - Don't initialize multiple browsers without closing previous ones
1079
- - Check for uncaught exceptions that might prevent cleanup
1080
-
1081
- 8. **Timeout errors**
1082
- - Increase timeout values: `{ "timeout": 60000 }`
1083
- - Use `wait` tool before interacting with elements
1084
- - Check network connectivity and website response times
1085
-
1086
- ### Frequently Asked Questions
1087
-
1088
- **Q: When should I use npm install vs npx?**
1089
- A:
1090
- - **Use npx (recommended for most users):** When using with Claude Desktop, Claude Code CLI, or Cursor IDE. The npx command in your config automatically downloads and runs the latest version without installation.
1091
- - **Use npm install -g:** Only if you want to run the server directly from command line frequently, or if you're developing/contributing to the project.
1092
- - **Never needed:** If you're just a Claude Desktop/Claude Code CLI user following the Quick Start guide - npx handles everything!
1093
-
1094
- **Q: Should I use Claude Desktop or Claude Code CLI?**
1095
- A: Both are excellent choices, depending on your needs:
1096
-
1097
- **Claude Desktop:**
1098
- - **Best for:** Simple web browsing automation, content extraction, basic form filling
1099
- - **Setup:** Manual JSON config file editing
1100
- - **Sharing:** Individual use only
1101
- - **Interface:** Desktop GUI application
1102
- - **Authentication:** None required
1103
-
1104
- **Claude Code CLI:**
1105
- - **Best for:** Development workflows, team collaboration, project-specific automation
1106
- - **Setup:** Simple command-line setup (`claude mcp add`)
1107
- - **Sharing:** Supports team sharing via project scope
1108
- - **Interface:** Command-line integration with IDEs
1109
- - **Authentication:** OAuth support available
1110
- - **Advanced Features:** Environment variables, scope control, server monitoring
1111
-
1112
- **Use Claude Code CLI if you:**
1113
- - Work in development teams
1114
- - Need project-specific browser automation
1115
- - Want environment variable configuration
1116
- - Prefer command-line workflows
1117
- - Need server health monitoring
1118
-
1119
- **Use Claude Desktop if you:**
1120
- - Want a simple GUI experience
1121
- - Do individual browsing automation
1122
- - Don't need team collaboration features
1123
- - Prefer visual interfaces over command-line
1124
-
1125
- **Q: Why do we use @latest in the npx command?**
1126
- A: The `@latest` tag ensures you always get the newest version with bug fixes and security updates. Without it, npx might cache an older version. It's especially important for actively maintained projects.
1127
-
1128
- **Q: Does this work with headless browsers?**
1129
- A: Yes, set `headless: true` in browser_init options.
1130
-
1131
- **Q: Can I use multiple browsers at once?**
1132
- A: Currently supports one browser instance. Close the current one before starting a new one.
1133
-
1134
- **Q: What captchas can it solve?**
1135
- A: Supports reCAPTCHA, hCaptcha, and Cloudflare Turnstile through brave-real-browser.
1136
-
1137
- **Q: Is this detectable by websites?**
1138
- A: brave-real-browser includes anti-detection features, but no solution is 100% undetectable.
1139
-
1140
- **Q: Can I use custom Chrome extensions?**
1141
- A: Yes, through the `plugins` option in browser_init.
1142
-
1143
- **Q: Does it work on all operating systems?**
1144
- A: Yes, tested on Windows, macOS, and Linux. The server automatically detects Chrome installations on all platforms.
1145
-
1146
- **Q: What's the difference between Claude Desktop, Claude Code CLI, and Cursor IDE configurations?**
1147
- A: Here's a comparison:
1148
-
1149
- | Feature | Claude Desktop | Claude Code CLI | Cursor IDE |
1150
- |---------|---------------|-----------------|------------|
1151
- | **Setup Method** | Manual JSON editing | Command-line (`claude mcp add`) | One-click install OR manual JSON |
1152
- | **Config Location** | `claude_desktop_config.json` | `.mcp.json` (scoped) | `.cursor/mcp.json` |
1153
- | **Team Sharing** | No | Yes (project scope) | Yes |
1154
- | **Environment Variables** | Limited support | Full support | Full support |
1155
- | **Scope Control** | No | Yes (local/project/user) | Project/Global |
1156
- | **Server Monitoring** | No | Yes (`/mcp` command) | Limited |
1157
- | **Authentication** | None | OAuth available | OAuth available |
1158
- | **Best For** | Individual GUI use | Development teams | Code-focused workflows |
1159
-
1160
- **Command Examples:**
1161
- - **Claude Desktop**: Edit config file with JSON
1162
- - **Claude Code CLI**: `claude mcp add brave-real-browser -- npx brave-real-browser-mcp-server@latest`
1163
- - **Cursor IDE**: One-click install or manual JSON config
1164
-
1165
- **Q: What if Chrome is installed in a non-standard location?**
1166
- A: Version 1.3.0 dramatically improves Chrome detection. The server now searches 15+ locations including portable installations and uses Windows Registry detection. If Chrome is still not found automatically, you can:
1167
- 1. Set environment variable: `set CHROME_PATH="C:\Your\Chrome\Path\chrome.exe"`
1168
- 2. Use the `customConfig.chromePath` option: `{"customConfig": {"chromePath": "C:\\Custom\\Chrome\\chrome.exe"}}`
1169
-
1170
- **Q: Why am I getting "Chrome not found" or ECONNREFUSED errors on Windows?**
1171
- A: Version 1.3.0 includes comprehensive fixes for Windows Chrome detection and connection issues. The server now automatically searches these locations and more:
1172
- - `C:\Program Files\Google\Chrome\Application\chrome.exe`
1173
- - `C:\Program Files (x86)\Google\Chrome\Application\chrome.exe`
1174
- - `%LOCALAPPDATA%\Google\Chrome\Application\chrome.exe`
1175
- - `%USERPROFILE%\AppData\Local\Google\Chrome\Application\chrome.exe`
1176
- - Chrome Canary installations
1177
- - Portable Chrome installations
1178
- - Registry-detected installations
201
+ ---
1179
202
 
1180
- The server also implements multiple connection strategies with automatic fallback between localhost and 127.0.0.1, plus enhanced Windows-specific Chrome flags for better compatibility.
203
+ ## 📋 Prerequisites
1181
204
 
1182
- **Q: I'm still getting ECONNREFUSED errors after upgrading to v1.3.0. What should I do?**
1183
- A: Try these steps in order:
1184
- 1. Set the `CHROME_PATH` environment variable to your Chrome location
1185
- 2. Kill all existing Chrome processes: `taskkill /f /im chrome.exe`
1186
- 3. Check your Windows hosts file contains: `127.0.0.1 localhost`
1187
- 4. Try running your IDE as Administrator
1188
- 5. Add Chrome to Windows Defender exclusions
1189
- 6. If using a VPN/proxy, try disabling it temporarily
205
+ - **Node.js** >= 18.0.0
206
+ - **Brave Browser** (auto-detected)
1190
207
 
1191
- ### Debug Mode
208
+ ---
1192
209
 
1193
- To enable debug logging:
210
+ ## 🐛 Troubleshooting
1194
211
 
212
+ ### Port in use
1195
213
  ```bash
1196
- DEBUG=true npm start
214
+ MCP_PORT=3001 npm run dev
1197
215
  ```
1198
216
 
1199
- Or when running from source:
217
+ ### Debug mode
1200
218
  ```bash
1201
219
  DEBUG=true npm run dev
1202
220
  ```
1203
221
 
1204
- ### Getting Help
1205
-
1206
- If you're still having issues:
1207
- 1. Check the [GitHub Issues](https://github.com/your-organization/brave-real-browser-mcp-server/issues)
1208
- 2. Create a new issue with:
1209
- - Your operating system
1210
- - Node.js version (`node --version`)
1211
- - npm version (`npm --version`)
1212
- - Full error message
1213
- - Steps to reproduce the problem
1214
-
1215
- ## Development
1216
-
1217
- ### Project Structure
1218
-
1219
- ```text
1220
- brave-real-browser-mcp-server/
1221
- ├── src/
1222
- │ ├── index.ts # Main server implementation
1223
- │ └── stealth-actions.ts # Browser interaction functions
1224
- ├── test/
1225
- │ └── test-server.ts # Test script
1226
- ├── package.json
1227
- └── tsconfig.json
1228
- ```
1229
-
1230
- ### Building from Source
1231
-
1232
- ```bash
1233
- # Install dependencies
1234
- npm install
1235
-
1236
- # Run in development mode
1237
- npm run dev
1238
-
1239
- # Build for production
1240
- npm run build
1241
-
1242
- # Test the server
1243
- npm test
1244
- ```
1245
-
1246
- ### Adding New Tools
1247
-
1248
- To add a new tool:
1249
-
1250
- 1. Add the tool definition to the `TOOLS` array in `src/index.ts`
1251
- 2. Implement the tool handler in the `CallToolRequestSchema` handler
1252
- 3. Test the new tool functionality
1253
-
1254
- ## Testing
1255
-
1256
- This project includes a comprehensive testing suite with multiple categories optimized for different purposes:
1257
-
1258
- ### Quick Tests (CI/CD) - ~30 seconds
1259
- ```bash
1260
- npm run test:quick # Fast Jest tests for protocol compliance
1261
- npm test # Alias for test:quick
1262
- ```
1263
-
1264
- ### Comprehensive Tests - ~5-10 minutes
1265
- ```bash
1266
- npm run test:full # End-to-end MCP client testing
1267
- ```
1268
-
1269
- ### Performance Testing - ~2-3 minutes
1270
- ```bash
1271
- npm run test:performance # Browser performance benchmarking
1272
- ```
1273
-
1274
- Performance tests measure:
1275
- - Browser initialization timing (5 trials)
1276
- - Navigation performance across different site types
1277
- - Concurrent operation handling
1278
- - Session longevity testing (30+ operations over 30 seconds)
1279
-
1280
- ### Debug Tools - ~10 seconds
1281
- ```bash
1282
- npm run test:debug # Environment diagnostics and troubleshooting
1283
- ```
1284
-
1285
- Debug tools provide:
1286
- - Environment validation (Node.js version, platform, memory)
1287
- - Chrome installation detection with specific paths
1288
- - Quick server health check with startup timing
1289
- - Network connectivity validation
1290
- - Build status verification
1291
-
1292
- ### All Tests - ~7-13 minutes
1293
- ```bash
1294
- npm run test:all # Runs quick + full + performance tests
1295
- npm run test:dashboard # Unified test runner with reporting
1296
- ```
1297
-
1298
- The test dashboard provides:
1299
- - Unified execution of multiple test categories
1300
- - Real-time progress reporting
1301
- - Performance metrics and timing
1302
- - Overall test status summary
1303
- - Recommendations for failed tests
1304
- - JSON results saved to `test-results/` directory
1305
-
1306
- ### Integration Testing
1307
- ```bash
1308
- npm run test:integration # Claude Code CLI integration testing
1309
- ```
1310
-
1311
- For detailed testing information, see [TESTING.md](TESTING.md).
1312
-
1313
- ## Contributing
1314
-
1315
- Contributions are welcome! Please feel free to submit a Pull Request.
1316
-
1317
- 1. Fork the repository
1318
- 2. Create your feature branch (`git checkout -b feature/amazing-feature`)
1319
- 3. Commit your changes (`git commit -m 'Add some amazing feature'`)
1320
- 4. Push to the branch (`git push origin feature/amazing-feature`)
1321
- 5. Open a Pull Request
1322
-
1323
- ## License
1324
-
1325
- This project is licensed under the MIT License - see the LICENSE file for details.
222
+ ---
1326
223
 
1327
- ## Acknowledgments
224
+ ## 📄 License
1328
225
 
1329
- This MCP server is based on the excellent [brave-real-browser](https://github.com/ZFC-Digital/brave-real-browser) library by ZFC-Digital.
226
+ MIT License - see [LICENSE](LICENSE)
1330
227
 
1331
- **Thank you** to the brave-real-browser team for creating such a powerful and detection-resistant browser automation solution!
228
+ ---
1332
229
 
1333
- - GitHub: [https://github.com/ZFC-Digital/brave-real-browser](https://github.com/ZFC-Digital/brave-real-browser)
1334
- - npm: [https://www.npmjs.com/package/brave-real-browser](https://www.npmjs.com/package/brave-real-browser)
230
+ Made with ❤️ by [codeiva4u](https://github.com/codeiva4u)