brave-real-browser-mcp-server 1.5.16

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 ADDED
@@ -0,0 +1,1205 @@
1
+
2
+ ⚠️ **UNDER MAINTENANCE** - This project is still being actively developed. Some features may be incomplete or change without notice.
3
+
4
+ # Brave Real Browser MCP Server
5
+
6
+ Provides AI assistants with powerful, detection-resistant browser automation capabilities built on ZFC Digital's puppeteer-real-browser package.
7
+
8
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
9
+
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
40
+
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:
52
+
53
+ ```json
54
+ {
55
+ "mcpServers": {
56
+ "brave-real-browser": {
57
+ "command": "npx",
58
+ "args": ["brave-real-browser-mcp-server@latest"]
59
+ }
60
+ }
61
+ }
62
+ ```
63
+
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 Puppeteer Real Browser MCP Server acts as a bridge between AI assistants
107
+ and browser automation. It leverages puppeteer-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 puppeteer-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**: 11 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
148
+
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)
179
+
180
+ ```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
+ npm run dev
193
+ ```
194
+
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 puppeteer-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
423
+
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
428
+
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
432
+
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
437
+
438
+ ### With Other AI Assistants
439
+
440
+ Start the server:
441
+
442
+ ```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]
473
+ ```
474
+
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]
488
+ ```
489
+
490
+
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"]
496
+ ```
497
+
498
+ ## Available Tools
499
+
500
+ ### Core Browser Tools
501
+
502
+ | Tool Name | Description | Required Parameters | Optional Parameters |
503
+ |-----------|-------------|---------------------|-------------------|
504
+ | `browser_init` | Initialize stealth browser with advanced options | None | `headless`, `disableXvfb`, `ignoreAllFlags`, `proxy`, `plugins`, `connectOption` |
505
+ | `navigate` | Navigate to a URL | `url` | `waitUntil` |
506
+ | `get_content` | Get page content (HTML or text) | None | `type`, `selector` |
507
+ | `browser_close` | Close the browser instance | None | None |
508
+
509
+ ### Interaction Tools
510
+
511
+ | Tool Name | Description | Required Parameters | Optional Parameters |
512
+ |-----------|-------------|---------------------|-------------------|
513
+ | `click` | Standard click on element | `selector` | `waitForNavigation` |
514
+ | `type` | Type text into input field | `selector`, `text` | `delay` |
515
+ | `wait` | Wait for various conditions | `type`, `value` | `timeout` |
516
+ | `find_selector` | Find CSS selector for element containing specific text | `text` | `elementType`, `exact` |
517
+
518
+
519
+ ### Behavior Tools
520
+
521
+ | Tool Name | Description | Required Parameters | Optional Parameters |
522
+ |-----------|-------------|---------------------|-------------------|
523
+ | `random_scroll` | Perform random scrolling with natural timing | None | None |
524
+
525
+ ### Element Discovery Tools
526
+
527
+ | Tool Name | Description | Required Parameters | Optional Parameters |
528
+ |-----------|-------------|---------------------|-------------------|
529
+ | `find_selector` | Find CSS selector for element containing specific text | `text` | `elementType`, `exact` |
530
+
531
+ ### Content Tools
532
+
533
+ | Tool Name | Description | Required Parameters | Optional Parameters |
534
+ |-----------|-------------|---------------------|-------------------|
535
+ | `save_content_as_markdown` | Extract page content and save it as a formatted markdown file | `filePath` | `contentType`, `selector`, `formatOptions` |
536
+
537
+ ### Anti-Detection Tools
538
+
539
+ | Tool Name | Description | Required Parameters | Optional Parameters |
540
+ |-----------|-------------|---------------------|-------------------|
541
+ | `solve_captcha` | Attempt to solve captchas | `type` | None |
542
+
543
+ ## Advanced Features
544
+
545
+ ### Dynamic Selector Discovery
546
+
547
+ The server includes intelligent element discovery capabilities through the `find_selector` tool:
548
+
549
+ - **Text-based element finding**: Automatically locates elements containing specific text
550
+ - **Smart CSS selector generation**: Creates unique, robust CSS selectors similar to Chrome DevTools
551
+ - **Element type filtering**: Optionally restrict search to specific HTML elements (e.g., buttons, links)
552
+ - **Exact or partial text matching**: Choose between precise text matching or substring searches
553
+ - **Universal compatibility**: Works across any website without hardcoded selectors
554
+
555
+ **Example Usage:**
556
+ ```text
557
+ User: "Find the submit button that says 'Sign Up'"
558
+ AI: I'll locate that button for you.
559
+ [Uses find_selector with text: "Sign Up", elementType: "button"]
560
+
561
+ AI: Found button at selector: "form > button.btn-primary:nth-of-type(2)"
562
+ ```
563
+
564
+ This approach eliminates the need for manually crafted selectors and makes automation more reliable across different websites.
565
+
566
+ ### Natural Interactions
567
+
568
+ The server includes tools designed for natural browsing behavior:
569
+
570
+ - **Random scrolling**: Performs scrolling with natural timing and variable distances
571
+
572
+ This feature helps avoid detection by sophisticated bot-detection systems
573
+ that analyze user behavior patterns.
574
+
575
+ ### Captcha Handling
576
+
577
+ The server includes basic support for solving common captcha types:
578
+
579
+ - reCAPTCHA
580
+ - hCaptcha
581
+ - Cloudflare Turnstile
582
+
583
+ Note that captcha solving capabilities depend on the underlying
584
+ puppeteer-real-browser implementation.
585
+
586
+ ## Configuration
587
+
588
+ ### Automatic Chrome Path Detection (Enhanced in v1.3.0)
589
+
590
+ The server automatically detects Chrome installation paths across different operating systems with significantly improved Windows support:
591
+
592
+ - **Windows (v1.3.0+)**:
593
+ - Registry-based detection for installed Chrome versions
594
+ - Searches 15+ common installation directories including Program Files, user-specific locations, and portable installations
595
+ - Support for Chrome Canary fallback
596
+ - Environment variable detection (`CHROME_PATH`, `PUPPETEER_EXECUTABLE_PATH`)
597
+ - Detailed troubleshooting guidance when Chrome is not found
598
+
599
+ - **macOS**: Looks for Chrome in `/Applications/Google Chrome.app/` and Chrome Canary locations
600
+
601
+ - **Linux**: Checks multiple locations including `/usr/bin/google-chrome`, `/usr/bin/chromium-browser`, and snap installations
602
+
603
+ **Windows Registry Detection** (NEW in v1.3.0):
604
+ The server now queries Windows Registry to find Chrome installations, making detection more reliable across different installation types.
605
+
606
+ If Chrome is not found automatically, you can specify a custom path using:
607
+ 1. Environment variable: `set CHROME_PATH="C:\Your\Chrome\Path\chrome.exe"`
608
+ 2. Browser init option: `customConfig.chromePath` when initializing the browser
609
+
610
+ ### Configuring Custom Options (like headless mode)
611
+ 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:
612
+
613
+ When you ask Claude to initialize a browser, you can specify options like:
614
+
615
+ ```
616
+ Please initialize a browser with headless mode enabled and a 30-second timeout
617
+ ```
618
+
619
+ Claude will then use the `browser_init` tool with appropriate parameters:
620
+
621
+ ```json
622
+ {
623
+ "headless": true,
624
+ "connectOption": {
625
+ "timeout": 30000
626
+ }
627
+ }
628
+ ```
629
+
630
+ ### Available Browser Options
631
+ When initializing with `browser_init`, you can configure:
632
+
633
+ - `headless`: true/false (Set to true for headless operation)
634
+ - `disableXvfb`: true/false (Disable X Virtual Framebuffer)
635
+ - `ignoreAllFlags`: true/false (Ignore all Chrome flags)
636
+ - `proxy`: "https://proxy:8080" (Proxy server URL)
637
+ - `plugins`: ["plugin1", "plugin2"] (Array of plugins to load)
638
+ - `connectOption`: Additional connection options like:
639
+ - `slowMo`: 250 (Slow down operations by milliseconds)
640
+ - `timeout`: 60,000 (Connection timeout)
641
+
642
+ The MCP config file only tells Claude where to find the server - all browser-specific options are configured through your conversations with Claude.
643
+
644
+ ### Browser Options Example
645
+
646
+ When initializing the browser with `browser_init`, you can configure:
647
+
648
+ ```json
649
+ {
650
+ "headless": false,
651
+ "disableXvfb": false,
652
+ "ignoreAllFlags": false,
653
+ "proxy": "https://proxy:8080",
654
+ "plugins": ["plugin1", "plugin2"],
655
+ "connectOption": {
656
+ "slowMo": 250,
657
+ "timeout": 60000
658
+ }
659
+ }
660
+ ```
661
+
662
+ ### Advanced Configuration Examples
663
+
664
+ #### Specifying Custom Chrome Path
665
+ ```json
666
+ {
667
+ "customConfig": {
668
+ "chromePath": "C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe"
669
+ }
670
+ }
671
+ ```
672
+
673
+ #### Using a Proxy
674
+ ```json
675
+ {
676
+ "headless": true,
677
+ "proxy": "https://username:password@proxy.example.com:8080"
678
+ }
679
+ ```
680
+
681
+ #### Stealth Mode with Custom Options
682
+ ```json
683
+ {
684
+ "headless": false,
685
+ "ignoreAllFlags": true,
686
+ "disableXvfb": false,
687
+ "connectOption": {
688
+ "slowMo": 100,
689
+ "devtools": false
690
+ }
691
+ }
692
+ ```
693
+
694
+
695
+ ### Server Configuration
696
+
697
+ For advanced users, you can modify the server behavior by editing the source code:
698
+
699
+ - Change default viewport size in the `initializeBrowser` function
700
+ - Adjust timeout values for various operations
701
+ - Enable debug logging
702
+
703
+ ## Troubleshooting
704
+
705
+ ### Major Windows Connection Issues (Fixed in v1.3.0)
706
+
707
+ **🔧 ECONNREFUSED Error Solutions**
708
+
709
+ Version 1.3.0 includes comprehensive fixes for the `connect ECONNREFUSED 127.0.0.1:60725` error commonly experienced on Windows systems:
710
+
711
+ **Enhanced Chrome Path Detection:**
712
+ - Added Windows Registry-based Chrome detection
713
+ - Expanded search to 15+ Windows installation locations including portable installations
714
+ - Added support for Chrome Canary fallback
715
+ - Environment variable support (`CHROME_PATH`, `PUPPETEER_EXECUTABLE_PATH`)
716
+
717
+ **Windows-Specific Launch Optimizations:**
718
+ - 20+ Windows-specific Chrome flags for better compatibility
719
+ - Multiple fallback strategies (5 different connection approaches)
720
+ - Progressive retry logic with exponential backoff
721
+ - Enhanced timeout handling (120s for Windows vs 90s for other platforms)
722
+
723
+ **Connection Resilience Features:**
724
+ - Localhost vs 127.0.0.1 fallback handling (fixes known Puppeteer issue)
725
+ - Port availability checking and automatic port assignment
726
+ - Network connectivity testing before browser launch
727
+ - Enhanced error categorization and automatic fallback strategies
728
+
729
+ **If you're still experiencing ECONNREFUSED errors:**
730
+
731
+ 1. **Environment Variables (Recommended):**
732
+ ```bash
733
+ set CHROME_PATH="C:\Program Files\Google\Chrome\Application\chrome.exe"
734
+ ```
735
+
736
+ 2. **Manual Chrome Path Configuration:**
737
+ ```text
738
+ Ask Claude: "Initialize browser with custom Chrome path at C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe"
739
+ ```
740
+
741
+ 3. **Network Troubleshooting:**
742
+ ```bash
743
+ # Test localhost resolution
744
+ ping localhost
745
+ # Should resolve to 127.0.0.1
746
+
747
+ # Check Windows hosts file
748
+ notepad C:\Windows\System32\drivers\etc\hosts
749
+ # Ensure: 127.0.0.1 localhost
750
+ ```
751
+
752
+ 4. **Chrome Process Management:**
753
+ ```bash
754
+ # Kill existing Chrome processes
755
+ taskkill /f /im chrome.exe
756
+ ```
757
+
758
+ ### Common Issues
759
+
760
+ #### npx-Specific Issues
761
+
762
+ 1. **"spawn npx ENOENT" or "command not found" errors**
763
+ - **Cause:** npx is not in your system PATH or Node.js is not properly installed
764
+ - **Solutions:**
765
+ - Verify Node.js installation: `node --version` and `npm --version`
766
+ - Reinstall Node.js from [nodejs.org](https://nodejs.org/)
767
+ - For NVM users, see the NVM-specific section below
768
+
769
+ 2. **"npx: command not found" in Claude Desktop/Cursor**
770
+ - **Windows:** Make sure to restart your IDE after installing Node.js
771
+ - **Mac/Linux:** Add npm to PATH: `export PATH="$PATH:$(npm bin -g)"`
772
+ - **Alternative:** Use the full path to npx: `/usr/local/bin/npx`
773
+
774
+ 3. **npx hangs or takes too long**
775
+ - npx downloads the package on first run, which can take 30-60 seconds
776
+ - Ensure you have a stable internet connection
777
+ - Try clearing npm cache: `npm cache clean --force`
778
+
779
+ 4. **Using NVM (Node Version Manager)?**
780
+ - Standard npx commands may fail with NVM
781
+ - **Solution 1:** Use absolute paths in your config:
782
+ ```json
783
+ {
784
+ "mcpServers": {
785
+ "brave-real-browser": {
786
+ "command": "/Users/yourname/.nvm/versions/node/v20.0.0/bin/npx",
787
+ "args": ["brave-real-browser-mcp-server@latest"]
788
+ }
789
+ }
790
+ }
791
+ ```
792
+ - **Solution 2:** Set a default Node version: `nvm alias default 20.0.0`
793
+
794
+ 5. **Permission denied errors with npx**
795
+ - **Mac/Linux:** Try with sudo: `sudo npx brave-real-browser-mcp-server@latest`
796
+ - **Better solution:** Fix npm permissions: `npm config set prefix ~/.npm`
797
+
798
+ #### Other Common Issues
799
+
800
+ 1. **"Maximum call stack size exceeded" errors**
801
+ - This was fixed in version 1.2.0 with comprehensive stack overflow protection
802
+ - The server now includes circuit breaker patterns and recursion depth tracking
803
+ - Timeout controls prevent hanging operations that could lead to stack overflow
804
+ - If you encounter this error, ensure you're using the latest version: `npx brave-real-browser-mcp-server@latest`
805
+
806
+ 2. **"command not found" or "syntax error" when using npx**
807
+ - This was fixed in version 1.0.3 with the addition of a proper shebang line
808
+ - Make sure you're using the latest version: `npx brave-real-browser-mcp-server@latest`
809
+ - For global installation: `npm install -g brave-real-browser-mcp-server@latest`
810
+ - If still having issues, install globally: `npm install -g brave-real-browser-mcp-server`
811
+ - Check your PATH includes npm global binaries: `npm config get prefix`
812
+
813
+ 3. **Browser won't start**
814
+ - Check if Chrome/Chromium is installed in standard locations
815
+ - **Windows specific troubleshooting**:
816
+
817
+ **Step 1: Verify Chrome Installation Paths**
818
+ Check these locations in order:
819
+ - `C:\Program Files\Google\Chrome\Application\chrome.exe`
820
+ - `C:\Program Files (x86)\Google\Chrome\Application\chrome.exe`
821
+ - `%LOCALAPPDATA%\Google\Chrome\Application\chrome.exe`
822
+ - `%PROGRAMFILES%\Google\Chrome\Application\chrome.exe`
823
+
824
+ **Step 2: Manual Path Configuration**
825
+ If Chrome is in a different location, specify it manually:
826
+ ```
827
+ Ask Claude: "Initialize browser with custom Chrome path at C:\Your\Chrome\Path\chrome.exe"
828
+ ```
829
+
830
+ **Step 3: Windows Launch Arguments**
831
+ For Windows compatibility, use these launch arguments:
832
+ ```
833
+ Ask Claude: "Initialize browser with args --disable-gpu --disable-setuid-sandbox"
834
+ ```
835
+
836
+ **Step 4: Windows-Specific Solutions**
837
+ - **Run as Administrator**: Try running your IDE/terminal as Administrator
838
+ - **Windows Defender**: Add Chrome and Node.js to Windows Defender exclusions
839
+ - **Antivirus Software**: Temporarily disable antivirus to test if it's blocking Chrome
840
+ - **User Account Control**: Lower UAC settings temporarily for testing
841
+ - **Chrome Processes**: Kill any existing Chrome processes in Task Manager
842
+
843
+ **Step 5: Alternative Chrome Installation**
844
+ If Chrome detection still fails:
845
+ - Download Chrome directly from [google.com/chrome](https://www.google.com/chrome/)
846
+ - Install to default location (`C:\Program Files\Google\Chrome\`)
847
+ - Restart your IDE after installation
848
+
849
+ **Step 6: PowerShell vs Command Prompt**
850
+ Try switching between PowerShell and Command Prompt:
851
+ - Test with `cmd.exe` instead of PowerShell
852
+ - Test with PowerShell instead of Command Prompt
853
+
854
+ **Step 7: Node.js and npm Configuration**
855
+ - Ensure Node.js is added to PATH: `node --version`
856
+ - Clear npm cache: `npm cache clean --force`
857
+ - Reinstall global packages: `npm install -g brave-real-browser-mcp-server@latest`
858
+
859
+ - **Linux**: Install dependencies: `sudo apt-get install -y google-chrome-stable`
860
+ - **macOS**: Ensure Chrome is in `/Applications/`
861
+ - Try with `headless: true` first
862
+ - Check console output for Chrome path detection messages
863
+
864
+ 4. **Claude doesn't see the MCP server**
865
+ - Verify `claude_desktop_config.json` is in the correct location
866
+ - Check JSON syntax is valid (use [jsonlint.com](https://jsonlint.com/))
867
+ - Restart Claude Desktop completely
868
+ - Check for any error messages in Claude Desktop
869
+
870
+ **4a. Claude Code CLI doesn't see the MCP server**
871
+ - **Installation Issues**:
872
+ - Verify `claude mcp add` command was successful
873
+ - Check command syntax: `claude mcp add brave-real-browser -- npx brave-real-browser-mcp-server@latest`
874
+ - Ensure you have the latest Claude Code CLI version
875
+
876
+ - **Scope and Configuration**:
877
+ - Check which scope you used: local (default), project, or user
878
+ - For local scope: ensure you're in the correct project directory
879
+ - For project scope: verify `.mcp.json` exists in project root
880
+ - For user scope: check user config directory
881
+
882
+ - **MCP Server Status**:
883
+ - Use `/mcp` command in Claude Code to check server status
884
+ - Look for the "puppeteer-real-browser" server in the list
885
+ - Check if server status shows "connected" or error messages
886
+
887
+ - **Environment Variables**:
888
+ - If using custom environment variables (Chrome path, proxy), verify they're correctly set
889
+ - Test without environment variables first: `claude mcp add brave-real-browser -- npx brave-real-browser-mcp-server@latest`
890
+
891
+ - **Node.js and npx Issues**:
892
+ - Verify Node.js version 18+: `node --version`
893
+ - Test npx directly: `npx brave-real-browser-mcp-server@latest`
894
+ - Clear npm cache: `npm cache clean --force`
895
+
896
+ - **Protocol Version Issues** (Known Issue):
897
+ - Claude CLI may show protocolVersion validation errors despite correct configuration
898
+ - This is a known issue with internal validation in Claude CLI
899
+ - Server may still work despite validation warnings
900
+
901
+ - **Re-adding Server**:
902
+ ```bash
903
+ # Remove and re-add if issues persist
904
+ claude mcp remove brave-real-browser
905
+ claude mcp add brave-real-browser -- npx brave-real-browser-mcp-server@latest
906
+ ```
907
+
908
+ **4b. Cursor IDE doesn't see the MCP server**
909
+ - **Config File Location Issues**:
910
+ - Verify `mcp.json` is in the correct location:
911
+ - Global: `~/.cursor/mcp.json` (`%USERPROFILE%\.cursor\mcp.json` on Windows)
912
+ - Project: `.cursor/mcp.json` in your project root
913
+ - Ensure filename is exactly `mcp.json` (not `mcp.json.txt`)
914
+ - Check file permissions allow reading
915
+
916
+ - **JSON Syntax Validation**:
917
+ - Use [jsonlint.com](https://jsonlint.com/) to validate JSON syntax
918
+ - Common issues: missing commas, incorrect quotes, trailing commas
919
+ - Ensure proper escaping of Windows paths: `"C:/Program Files/Google/Chrome/Application/chrome.exe"`
920
+
921
+ - **Cursor IDE Restart Process**:
922
+ - Close Cursor IDE completely (check Task Manager on Windows)
923
+ - Wait 5 seconds
924
+ - Restart Cursor IDE
925
+ - Open Command Palette and check MCP servers are listed
926
+
927
+ - **Environment Variables**:
928
+ - Verify Node.js is accessible: `node --version`
929
+ - Check PATH includes npm: `npm --version`
930
+ - Clear any conflicting environment variables
931
+
932
+ - **Cursor IDE Version Compatibility**:
933
+ - Ensure Cursor IDE version supports MCP (latest versions)
934
+ - Update Cursor IDE if using an older version
935
+ - Check Cursor IDE documentation for MCP requirements
936
+
937
+ 5. **Permission denied errors**
938
+ - On Linux/Mac: Try `sudo npm install -g brave-real-browser-mcp-server`
939
+ - Or use nvm to manage Node.js without sudo
940
+ - On Windows: Run command prompt as Administrator
941
+
942
+ 6. **Detection issues**
943
+ - Use appropriate delays between actions for better reliability
944
+ - Add random delays with `random_scroll`
945
+ - Use proxy if needed: `proxy: "http://proxy.example.com:8080"`
946
+
947
+ 7. **Memory leaks**
948
+ - Always close browser instances with `browser_close` when done
949
+ - Don't initialize multiple browsers without closing previous ones
950
+ - Check for uncaught exceptions that might prevent cleanup
951
+
952
+ 8. **Timeout errors**
953
+ - Increase timeout values: `{ "timeout": 60000 }`
954
+ - Use `wait` tool before interacting with elements
955
+ - Check network connectivity and website response times
956
+
957
+ ### Frequently Asked Questions
958
+
959
+ **Q: When should I use npm install vs npx?**
960
+ A:
961
+ - **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.
962
+ - **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.
963
+ - **Never needed:** If you're just a Claude Desktop/Claude Code CLI user following the Quick Start guide - npx handles everything!
964
+
965
+ **Q: Should I use Claude Desktop or Claude Code CLI?**
966
+ A: Both are excellent choices, depending on your needs:
967
+
968
+ **Claude Desktop:**
969
+ - **Best for:** Simple web browsing automation, content extraction, basic form filling
970
+ - **Setup:** Manual JSON config file editing
971
+ - **Sharing:** Individual use only
972
+ - **Interface:** Desktop GUI application
973
+ - **Authentication:** None required
974
+
975
+ **Claude Code CLI:**
976
+ - **Best for:** Development workflows, team collaboration, project-specific automation
977
+ - **Setup:** Simple command-line setup (`claude mcp add`)
978
+ - **Sharing:** Supports team sharing via project scope
979
+ - **Interface:** Command-line integration with IDEs
980
+ - **Authentication:** OAuth support available
981
+ - **Advanced Features:** Environment variables, scope control, server monitoring
982
+
983
+ **Use Claude Code CLI if you:**
984
+ - Work in development teams
985
+ - Need project-specific browser automation
986
+ - Want environment variable configuration
987
+ - Prefer command-line workflows
988
+ - Need server health monitoring
989
+
990
+ **Use Claude Desktop if you:**
991
+ - Want a simple GUI experience
992
+ - Do individual browsing automation
993
+ - Don't need team collaboration features
994
+ - Prefer visual interfaces over command-line
995
+
996
+ **Q: Why do we use @latest in the npx command?**
997
+ 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.
998
+
999
+ **Q: Does this work with headless browsers?**
1000
+ A: Yes, set `headless: true` in browser_init options.
1001
+
1002
+ **Q: Can I use multiple browsers at once?**
1003
+ A: Currently supports one browser instance. Close the current one before starting a new one.
1004
+
1005
+ **Q: What captchas can it solve?**
1006
+ A: Supports reCAPTCHA, hCaptcha, and Cloudflare Turnstile through puppeteer-real-browser.
1007
+
1008
+ **Q: Is this detectable by websites?**
1009
+ A: puppeteer-real-browser includes anti-detection features, but no solution is 100% undetectable.
1010
+
1011
+ **Q: Can I use custom Chrome extensions?**
1012
+ A: Yes, through the `plugins` option in browser_init.
1013
+
1014
+ **Q: Does it work on all operating systems?**
1015
+ A: Yes, tested on Windows, macOS, and Linux. The server automatically detects Chrome installations on all platforms.
1016
+
1017
+ **Q: What's the difference between Claude Desktop, Claude Code CLI, and Cursor IDE configurations?**
1018
+ A: Here's a comparison:
1019
+
1020
+ | Feature | Claude Desktop | Claude Code CLI | Cursor IDE |
1021
+ |---------|---------------|-----------------|------------|
1022
+ | **Setup Method** | Manual JSON editing | Command-line (`claude mcp add`) | One-click install OR manual JSON |
1023
+ | **Config Location** | `claude_desktop_config.json` | `.mcp.json` (scoped) | `.cursor/mcp.json` |
1024
+ | **Team Sharing** | No | Yes (project scope) | Yes |
1025
+ | **Environment Variables** | Limited support | Full support | Full support |
1026
+ | **Scope Control** | No | Yes (local/project/user) | Project/Global |
1027
+ | **Server Monitoring** | No | Yes (`/mcp` command) | Limited |
1028
+ | **Authentication** | None | OAuth available | OAuth available |
1029
+ | **Best For** | Individual GUI use | Development teams | Code-focused workflows |
1030
+
1031
+ **Command Examples:**
1032
+ - **Claude Desktop**: Edit config file with JSON
1033
+ - **Claude Code CLI**: `claude mcp add brave-real-browser -- npx brave-real-browser-mcp-server@latest`
1034
+ - **Cursor IDE**: One-click install or manual JSON config
1035
+
1036
+ **Q: What if Chrome is installed in a non-standard location?**
1037
+ 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:
1038
+ 1. Set environment variable: `set CHROME_PATH="C:\Your\Chrome\Path\chrome.exe"`
1039
+ 2. Use the `customConfig.chromePath` option: `{"customConfig": {"chromePath": "C:\\Custom\\Chrome\\chrome.exe"}}`
1040
+
1041
+ **Q: Why am I getting "Chrome not found" or ECONNREFUSED errors on Windows?**
1042
+ A: Version 1.3.0 includes comprehensive fixes for Windows Chrome detection and connection issues. The server now automatically searches these locations and more:
1043
+ - `C:\Program Files\Google\Chrome\Application\chrome.exe`
1044
+ - `C:\Program Files (x86)\Google\Chrome\Application\chrome.exe`
1045
+ - `%LOCALAPPDATA%\Google\Chrome\Application\chrome.exe`
1046
+ - `%USERPROFILE%\AppData\Local\Google\Chrome\Application\chrome.exe`
1047
+ - Chrome Canary installations
1048
+ - Portable Chrome installations
1049
+ - Registry-detected installations
1050
+
1051
+ 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.
1052
+
1053
+ **Q: I'm still getting ECONNREFUSED errors after upgrading to v1.3.0. What should I do?**
1054
+ A: Try these steps in order:
1055
+ 1. Set the `CHROME_PATH` environment variable to your Chrome location
1056
+ 2. Kill all existing Chrome processes: `taskkill /f /im chrome.exe`
1057
+ 3. Check your Windows hosts file contains: `127.0.0.1 localhost`
1058
+ 4. Try running your IDE as Administrator
1059
+ 5. Add Chrome to Windows Defender exclusions
1060
+ 6. If using a VPN/proxy, try disabling it temporarily
1061
+
1062
+ ### Debug Mode
1063
+
1064
+ To enable debug logging:
1065
+
1066
+ ```bash
1067
+ DEBUG=true npm start
1068
+ ```
1069
+
1070
+ Or when running from source:
1071
+ ```bash
1072
+ DEBUG=true npm run dev
1073
+ ```
1074
+
1075
+ ### Getting Help
1076
+
1077
+ If you're still having issues:
1078
+ 1. Check the [GitHub Issues](https://github.com/withLinda/brave-real-browser-mcp-server/issues)
1079
+ 2. Create a new issue with:
1080
+ - Your operating system
1081
+ - Node.js version (`node --version`)
1082
+ - npm version (`npm --version`)
1083
+ - Full error message
1084
+ - Steps to reproduce the problem
1085
+
1086
+ ## Development
1087
+
1088
+ ### Project Structure
1089
+
1090
+ ```text
1091
+ brave-real-browser-mcp-server/
1092
+ ├── src/
1093
+ │ ├── index.ts # Main server implementation
1094
+ │ └── stealth-actions.ts # Browser interaction functions
1095
+ ├── test/
1096
+ │ └── test-server.ts # Test script
1097
+ ├── package.json
1098
+ └── tsconfig.json
1099
+ ```
1100
+
1101
+ ### Building from Source
1102
+
1103
+ ```bash
1104
+ # Install dependencies
1105
+ npm install
1106
+
1107
+ # Run in development mode
1108
+ npm run dev
1109
+
1110
+ # Build for production
1111
+ npm run build
1112
+
1113
+ # Test the server
1114
+ npm test
1115
+ ```
1116
+
1117
+ ### Adding New Tools
1118
+
1119
+ To add a new tool:
1120
+
1121
+ 1. Add the tool definition to the `TOOLS` array in `src/index.ts`
1122
+ 2. Implement the tool handler in the `CallToolRequestSchema` handler
1123
+ 3. Test the new tool functionality
1124
+
1125
+ ## Testing
1126
+
1127
+ This project includes a comprehensive testing suite with multiple categories optimized for different purposes:
1128
+
1129
+ ### Quick Tests (CI/CD) - ~30 seconds
1130
+ ```bash
1131
+ npm run test:quick # Fast Jest tests for protocol compliance
1132
+ npm test # Alias for test:quick
1133
+ ```
1134
+
1135
+ ### Comprehensive Tests - ~5-10 minutes
1136
+ ```bash
1137
+ npm run test:full # End-to-end MCP client testing
1138
+ ```
1139
+
1140
+ ### Performance Testing - ~2-3 minutes
1141
+ ```bash
1142
+ npm run test:performance # Browser performance benchmarking
1143
+ ```
1144
+
1145
+ Performance tests measure:
1146
+ - Browser initialization timing (5 trials)
1147
+ - Navigation performance across different site types
1148
+ - Concurrent operation handling
1149
+ - Session longevity testing (30+ operations over 30 seconds)
1150
+
1151
+ ### Debug Tools - ~10 seconds
1152
+ ```bash
1153
+ npm run test:debug # Environment diagnostics and troubleshooting
1154
+ ```
1155
+
1156
+ Debug tools provide:
1157
+ - Environment validation (Node.js version, platform, memory)
1158
+ - Chrome installation detection with specific paths
1159
+ - Quick server health check with startup timing
1160
+ - Network connectivity validation
1161
+ - Build status verification
1162
+
1163
+ ### All Tests - ~7-13 minutes
1164
+ ```bash
1165
+ npm run test:all # Runs quick + full + performance tests
1166
+ npm run test:dashboard # Unified test runner with reporting
1167
+ ```
1168
+
1169
+ The test dashboard provides:
1170
+ - Unified execution of multiple test categories
1171
+ - Real-time progress reporting
1172
+ - Performance metrics and timing
1173
+ - Overall test status summary
1174
+ - Recommendations for failed tests
1175
+ - JSON results saved to `test-results/` directory
1176
+
1177
+ ### Integration Testing
1178
+ ```bash
1179
+ npm run test:integration # Claude Code CLI integration testing
1180
+ ```
1181
+
1182
+ For detailed testing information, see [TESTING.md](TESTING.md).
1183
+
1184
+ ## Contributing
1185
+
1186
+ Contributions are welcome! Please feel free to submit a Pull Request.
1187
+
1188
+ 1. Fork the repository
1189
+ 2. Create your feature branch (`git checkout -b feature/amazing-feature`)
1190
+ 3. Commit your changes (`git commit -m 'Add some amazing feature'`)
1191
+ 4. Push to the branch (`git push origin feature/amazing-feature`)
1192
+ 5. Open a Pull Request
1193
+
1194
+ ## License
1195
+
1196
+ This project is licensed under the MIT License - see the LICENSE file for details.
1197
+
1198
+ ## Acknowledgments
1199
+
1200
+ This MCP server is based on the excellent [puppeteer-real-browser](https://github.com/ZFC-Digital/puppeteer-real-browser) library by ZFC-Digital.
1201
+
1202
+ **Thank you** to the puppeteer-real-browser team for creating such a powerful and detection-resistant browser automation solution!
1203
+
1204
+ - GitHub: [https://github.com/ZFC-Digital/puppeteer-real-browser](https://github.com/ZFC-Digital/puppeteer-real-browser)
1205
+ - npm: [https://www.npmjs.com/package/puppeteer-real-browser](https://www.npmjs.com/package/puppeteer-real-browser)