brave-real-browser-mcp-server 2.35.0 → 2.37.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
@@ -14,7 +14,8 @@ A production-ready MCP (Model Context Protocol) server that combines Puppeteer w
14
14
 
15
15
  | Feature | Description |
16
16
  |---------|-------------|
17
- | MCP Server | Model Context Protocol compatible server |
17
+ | **MCP Server** | Model Context Protocol compatible server with 28 tools |
18
+ | **LSP Server** | Language Server Protocol for IDE code intelligence |
18
19
  | Brave Browser | Uses Brave instead of Chromium for better privacy |
19
20
  | 50+ Stealth Features | Passes all major bot detectors |
20
21
  | Built-in Ad Blocker | uBlock Origin filters with auto-update |
@@ -25,6 +26,7 @@ A production-ready MCP (Model Context Protocol) server that combines Puppeteer w
25
26
  | Auto-Install | Brave auto-installs if missing |
26
27
  | TypeScript Support | Full type definitions included |
27
28
  | ESM + CJS | Dual module support |
29
+ | **Multi-language** | English & Hindi language support |
28
30
  | **Auto-Update** | Daily automatic dependency updates |
29
31
  | **Auto-Publish** | Automatic NPM publishing on updates |
30
32
  | **Monorepo** | npm workspaces with linked packages |
@@ -127,6 +129,113 @@ AI: [Calls file_downloader with url="..."] -> Downloaded to ./downloads/image.pn
127
129
 
128
130
  ---
129
131
 
132
+ ## LSP Server (Language Server Protocol)
133
+
134
+ This package also includes a full-featured **LSP Server** for IDE code intelligence when writing browser automation scripts.
135
+
136
+ ### Quick Start LSP Server
137
+
138
+ ```bash
139
+ # Start the LSP server
140
+ npm run lsp
141
+ ```
142
+
143
+ ### LSP Capabilities
144
+
145
+ | Feature | Description |
146
+ |---------|-------------|
147
+ | **Autocomplete** | Tool names, parameters, and enum values |
148
+ | **Hover** | Full documentation on hover |
149
+ | **Diagnostics** | Error & warning detection (missing browser_init, etc.) |
150
+ | **Snippets** | Code templates for common workflows |
151
+ | **Refactoring** | Quick fixes (add browser_init, try-catch, etc.) |
152
+ | **Simulation** | Workflow simulation in IDE |
153
+ | **Multi-language** | English & Hindi support |
154
+
155
+ ### VS Code Setup
156
+
157
+ Create `.vscode/settings.json` in your project:
158
+
159
+ ```json
160
+ {
161
+ "braveRealBrowser.language": "en",
162
+ "braveRealBrowser.maxDiagnostics": 100,
163
+ "braveRealBrowser.enableSnippets": true,
164
+ "braveRealBrowser.enableSimulation": true,
165
+ "braveRealBrowser.enableRefactoring": true
166
+ }
167
+ ```
168
+
169
+ ### Diagnostic Features
170
+
171
+ The LSP detects common issues:
172
+
173
+ - Missing `browser_init()` before page operations
174
+ - Missing `navigate()` before content extraction
175
+ - Invalid selectors and URLs
176
+ - Missing required parameters
177
+ - Unclosed browser sessions
178
+ - Security issues (eval usage, etc.)
179
+
180
+ ### Quick Fixes
181
+
182
+ When diagnostics are detected, quick fixes are offered:
183
+
184
+ - Add `browser_init()` at start
185
+ - Add `navigate()` before page tools
186
+ - Add `browser_close()` at end
187
+ - Wrap in try-catch
188
+ - Extract to function
189
+
190
+ ---
191
+
192
+ ## Unified Architecture
193
+
194
+ Both MCP and LSP servers share the same tool definitions:
195
+
196
+ ```
197
+ src/
198
+ ├── shared/
199
+ │ └── tools.js # Single source of truth (28 tools)
200
+ ├── mcp/
201
+ │ ├── server.js # MCP server for AI agents
202
+ │ └── handlers.js # Tool implementations
203
+ ├── lsp/
204
+ │ ├── server.js # LSP server for IDEs
205
+ │ └── capabilities/ # Autocomplete, hover, diagnostics, etc.
206
+ └── index.js # Unified entry point
207
+ ```
208
+
209
+ ### Unified CLI
210
+
211
+ ```bash
212
+ # List all tools
213
+ node src/index.js --list
214
+
215
+ # Start MCP server (default)
216
+ node src/index.js mcp
217
+
218
+ # Start LSP server
219
+ node src/index.js lsp
220
+
221
+ # Show help
222
+ node src/index.js --help
223
+ ```
224
+
225
+ ### Tool Categories
226
+
227
+ | Category | Tools | Description |
228
+ |----------|-------|-------------|
229
+ | **Browser** | 3 | Browser lifecycle (init, close, cookies) |
230
+ | **Navigation** | 1 | Page navigation |
231
+ | **Interaction** | 8 | User actions (click, type, scroll, etc.) |
232
+ | **Extraction** | 10 | Content scraping (HTML, JSON, links, etc.) |
233
+ | **Network** | 3 | Network operations (recorder, download, trace) |
234
+ | **Analysis** | 1 | Page analysis (SEO, performance, etc.) |
235
+ | **Utility** | 2 | Helpers (wait, progress tracker) |
236
+
237
+ ---
238
+
130
239
  ## Monorepo Ecosystem
131
240
 
132
241
  ```
@@ -398,9 +507,12 @@ console.log(blocker === sameBlocker); // true
398
507
 
399
508
  | Command | Description |
400
509
  |---------|-------------|
510
+ | `npm start` | Start unified server (MCP by default) |
401
511
  | `npm run dev` | Start MCP server |
402
512
  | `npm run mcp` | Start MCP server (alias) |
403
513
  | `npm run mcp:verbose` | Start MCP server with tool details |
514
+ | `npm run lsp` | Start LSP server for IDE intelligence |
515
+ | `npm run list` | List all 28 tools with categories |
404
516
  | `npm install` | Install all dependencies with workspace linking |
405
517
  | `npm test` | Run all tests (CJS + ESM) |
406
518
  | `npm run cjs_test` | Run CommonJS tests only |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "brave-real-browser-mcp-server",
3
- "version": "2.35.0",
3
+ "version": "2.37.0",
4
4
  "description": "MCP Server for Brave Real Browser - Puppeteer with Brave Browser, Stealth Mode, Ad Blocker, and Turnstile Auto-Solver for undetectable web automation.",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/esm/index.mjs",
@@ -22,14 +22,18 @@
22
22
  "node": ">=18.0.0"
23
23
  },
24
24
  "bin": {
25
+ "brave": "./src/index.js",
25
26
  "brave-mcp": "./dist/index.js",
26
27
  "brave-lsp": "./src/lsp/index.js"
27
28
  },
28
29
  "scripts": {
29
- "dev": "node src/mcp/index.js",
30
- "mcp": "node src/mcp/index.js",
31
- "mcp:verbose": "node src/mcp/index.js --verbose",
32
- "lsp": "node src/lsp/index.js",
30
+ "start": "node src/index.js",
31
+ "dev": "node src/index.js",
32
+ "mcp": "node src/index.js mcp",
33
+ "mcp:verbose": "node src/index.js mcp --verbose",
34
+ "lsp": "node src/index.js lsp",
35
+ "lsp:tcp": "node src/lsp/server.js --tcp",
36
+ "list": "node src/index.js --list",
33
37
  "build": "echo 'Root package uses pre-built lib/ - no build needed'",
34
38
  "build:self": "echo 'Root package uses pre-built lib/ - no build needed'",
35
39
  "test": "npm run cjs_test && npm run esm_test",
@@ -67,7 +71,7 @@
67
71
  "license": "ISC",
68
72
  "dependencies": {
69
73
  "@modelcontextprotocol/sdk": "^1.25.3",
70
- "brave-real-puppeteer-core": "^24.50.0",
74
+ "brave-real-puppeteer-core": "^24.52.0",
71
75
  "ghost-cursor": "^1.4.2",
72
76
  "puppeteer-extra": "^3.3.6",
73
77
  "puppeteer-extra-plugin-stealth": "^2.11.2",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "brave-real-blocker",
3
- "version": "1.11.0",
3
+ "version": "1.13.0",
4
4
  "description": "Advanced uBlock Origin management and stealth features for Brave Real Browser",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -63,7 +63,7 @@
63
63
  "@types/adm-zip": "^0.5.5",
64
64
  "@types/fs-extra": "^11.0.4",
65
65
  "@types/node": "^20.0.0",
66
- "brave-real-puppeteer-core": "^24.50.0",
66
+ "brave-real-puppeteer-core": "^24.52.0",
67
67
  "mocha": "^10.4.0",
68
68
  "puppeteer-core": "^24.35.0",
69
69
  "sinon": "^17.0.1",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "brave-real-launcher",
3
- "version": "1.17.0",
3
+ "version": "1.19.0",
4
4
  "description": "Launch Brave Browser with ease from node. Based on chrome-launcher with Brave-specific support.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -54,7 +54,7 @@
54
54
  "typescript": "^5.0.0"
55
55
  },
56
56
  "dependencies": {
57
- "brave-real-blocker": "^1.11.0",
57
+ "brave-real-blocker": "^1.13.0",
58
58
  "escape-string-regexp": "^4.0.0",
59
59
  "is-wsl": "^2.2.0",
60
60
  "which": "^4.0.0"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "brave-real-puppeteer-core",
3
- "version": "24.50.0",
3
+ "version": "24.52.0",
4
4
  "description": "🦁 Brave Real-World Optimized Puppeteer & Playwright Core with 1-5ms ultra-fast timing, 50+ professional stealth features, intelligent browser auto-detection, and 100% bot detection bypass. Features cross-platform Brave browser integration, comprehensive anti-detection, and breakthrough performance improvements.",
5
5
  "keywords": [
6
6
  "automation",
@@ -132,7 +132,7 @@
132
132
  "test-version": "node ./scripts/test-version-management.js"
133
133
  },
134
134
  "dependencies": {
135
- "brave-real-launcher": "^1.17.0",
135
+ "brave-real-launcher": "^1.19.0",
136
136
  "get-east-asian-width": "^1.4.0",
137
137
  "yargs": "^18.0.0"
138
138
  },
package/src/index.js ADDED
@@ -0,0 +1,182 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Brave Real Browser - Unified Entry Point
4
+ *
5
+ * Usage:
6
+ * node src/index.js - Start both MCP + LSP together (default)
7
+ * node src/index.js mcp - Start MCP Server only
8
+ * node src/index.js lsp - Start LSP Server only (STDIO)
9
+ * node src/index.js --help - Show help
10
+ *
11
+ * npm scripts:
12
+ * npm run dev - Start MCP + LSP together
13
+ * npm run mcp - Start MCP server only
14
+ * npm run lsp - Start LSP server only
15
+ *
16
+ * Architecture:
17
+ * MCP Server → STDIO transport (for AI agents: Claude, Cursor, Copilot)
18
+ * LSP Server → TCP :7777 (for IDEs: VS Code, Neovim)
19
+ */
20
+
21
+ const { TOOLS, TOOL_DISPLAY, CATEGORIES } = require('./shared/tools.js');
22
+
23
+ // ANSI colors for terminal
24
+ const colors = {
25
+ reset: '\x1b[0m',
26
+ bright: '\x1b[1m',
27
+ dim: '\x1b[2m',
28
+ green: '\x1b[32m',
29
+ yellow: '\x1b[33m',
30
+ blue: '\x1b[34m',
31
+ magenta: '\x1b[35m',
32
+ cyan: '\x1b[36m',
33
+ red: '\x1b[31m',
34
+ };
35
+
36
+ /**
37
+ * Display help message
38
+ */
39
+ function showHelp() {
40
+ console.log(`
41
+ ${colors.bright}${colors.cyan}🦁 Brave Real Browser - Unified Server${colors.reset}
42
+
43
+ ${colors.bright}USAGE:${colors.reset}
44
+ node src/index.js [mode] [options]
45
+
46
+ ${colors.bright}MODES:${colors.reset}
47
+ ${colors.green}(default)${colors.reset} Start both MCP + LSP servers together
48
+ ${colors.green}mcp${colors.reset} Start MCP Server only (for AI agents)
49
+ ${colors.green}lsp${colors.reset} Start LSP Server only (for IDEs)
50
+
51
+ ${colors.bright}OPTIONS:${colors.reset}
52
+ ${colors.yellow}--help, -h${colors.reset} Show this help message
53
+ ${colors.yellow}--verbose, -v${colors.reset} Show detailed tool information
54
+ ${colors.yellow}--list${colors.reset} List all available tools
55
+
56
+ ${colors.bright}EXAMPLES:${colors.reset}
57
+ node src/index.js # Start MCP + LSP together
58
+ node src/index.js mcp # Start MCP server only
59
+ node src/index.js lsp # Start LSP server only
60
+ node src/index.js --list # List all tools
61
+
62
+ ${colors.bright}NPM SCRIPTS:${colors.reset}
63
+ npm run dev # Start MCP + LSP together
64
+ npm run mcp # Start MCP server only
65
+ npm run lsp # Start LSP server only (STDIO)
66
+
67
+ ${colors.bright}ARCHITECTURE:${colors.reset}
68
+ ${colors.cyan}MCP Server${colors.reset} → STDIO transport → AI Agents (Claude, Cursor, Copilot)
69
+ ${colors.cyan}LSP Server${colors.reset} → TCP :7777 → IDEs (VS Code, Neovim)
70
+
71
+ ${colors.bright}TOOL CATEGORIES (${TOOLS.length} tools):${colors.reset}
72
+ ${Object.entries(CATEGORIES).map(([key, cat]) => {
73
+ const count = TOOLS.filter(t => t.category === key).length;
74
+ return ` ${cat.emoji} ${colors.yellow}${cat.name.padEnd(15)}${colors.reset} ${colors.dim}(${count} tools)${colors.reset}`;
75
+ }).join('\n')}
76
+ `);
77
+ }
78
+
79
+ /**
80
+ * List all available tools
81
+ */
82
+ function listTools() {
83
+ console.log(`\n${colors.bright}${colors.cyan}🦁 Available Tools (${TOOLS.length}):${colors.reset}\n`);
84
+
85
+ for (const [key, cat] of Object.entries(CATEGORIES)) {
86
+ const tools = TOOLS.filter(t => t.category === key);
87
+ if (tools.length === 0) continue;
88
+
89
+ console.log(`${colors.bright}${cat.emoji} ${cat.name}${colors.reset} ${colors.dim}(${tools.length})${colors.reset}`);
90
+ console.log(`${colors.dim}${'─'.repeat(50)}${colors.reset}`);
91
+
92
+ for (const tool of tools) {
93
+ console.log(` ${tool.emoji} ${colors.yellow}${tool.name.padEnd(25)}${colors.reset} ${colors.dim}${tool.description.substring(0, 40)}${colors.reset}`);
94
+ }
95
+ console.log('');
96
+ }
97
+ }
98
+
99
+ /**
100
+ * Start both MCP and LSP servers together
101
+ */
102
+ async function startBothServers() {
103
+ console.error('');
104
+ console.error(`${colors.bright}${colors.cyan}╔════════════════════════════════════════════════════════════╗${colors.reset}`);
105
+ console.error(`${colors.bright}${colors.cyan}║${colors.reset} ${colors.bright}${colors.magenta}🦁 Brave Real Browser - Unified Server${colors.reset} ${colors.cyan}║${colors.reset}`);
106
+ console.error(`${colors.bright}${colors.cyan}║${colors.reset} ${colors.dim}MCP (AI Agents) + LSP (IDE Intelligence)${colors.reset} ${colors.cyan}║${colors.reset}`);
107
+ console.error(`${colors.bright}${colors.cyan}╚════════════════════════════════════════════════════════════╝${colors.reset}`);
108
+ console.error('');
109
+
110
+ // Start LSP Server on TCP first (background)
111
+ console.error(`${colors.bright}${colors.blue}📡 Starting LSP Server...${colors.reset}`);
112
+
113
+ try {
114
+ const { startTcpServer, LSP_PORT } = require('./lsp/server.js');
115
+ const { port } = await startTcpServer();
116
+ console.error(`${colors.bright}${colors.green}✅ LSP Server running on TCP :${port}${colors.reset}`);
117
+ console.error(`${colors.dim} IDEs can connect to: 127.0.0.1:${port}${colors.reset}`);
118
+ } catch (err) {
119
+ console.error(`${colors.yellow}⚠️ LSP Server failed: ${err.message}${colors.reset}`);
120
+ console.error(`${colors.dim} Continuing with MCP only...${colors.reset}`);
121
+ }
122
+
123
+ console.error('');
124
+
125
+ // Start MCP Server on STDIO (foreground)
126
+ console.error(`${colors.bright}${colors.blue}🚀 Starting MCP Server...${colors.reset}`);
127
+
128
+ // Import and run MCP server
129
+ require('./mcp/index.js');
130
+ }
131
+
132
+ /**
133
+ * Main entry point
134
+ */
135
+ async function main() {
136
+ const args = process.argv.slice(2);
137
+
138
+ // Parse arguments
139
+ const hasHelp = args.includes('--help') || args.includes('-h');
140
+ const hasList = args.includes('--list');
141
+ const mode = args.find(a => ['mcp', 'lsp'].includes(a.toLowerCase()));
142
+
143
+ if (hasHelp) {
144
+ showHelp();
145
+ process.exit(0);
146
+ }
147
+
148
+ if (hasList) {
149
+ listTools();
150
+ process.exit(0);
151
+ }
152
+
153
+ // Start appropriate server(s)
154
+ if (mode?.toLowerCase() === 'lsp') {
155
+ // Start LSP Server only (STDIO mode)
156
+ require('./lsp/index.js');
157
+ } else if (mode?.toLowerCase() === 'mcp') {
158
+ // Start MCP Server only
159
+ require('./mcp/index.js');
160
+ } else {
161
+ // Default: Start both servers together
162
+ await startBothServers();
163
+ }
164
+ }
165
+
166
+ // Export for programmatic use
167
+ module.exports = {
168
+ TOOLS,
169
+ TOOL_DISPLAY,
170
+ CATEGORIES,
171
+ startMCP: () => require('./mcp/index.js'),
172
+ startLSP: () => require('./lsp/index.js'),
173
+ startBoth: startBothServers,
174
+ };
175
+
176
+ // Run if called directly
177
+ if (require.main === module) {
178
+ main().catch(error => {
179
+ console.error(`${colors.red}❌ Fatal error:${colors.reset}`, error.message);
180
+ process.exit(1);
181
+ });
182
+ }