brave-real-browser-mcp-server 2.43.24 โ 2.43.26
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/package.json +2 -2
- package/packages/brave-real-blocker/package.json +2 -2
- package/packages/brave-real-launcher/package.json +2 -2
- package/packages/brave-real-playwright-core/package.json +1 -1
- package/packages/brave-real-puppeteer-core/package.json +2 -2
- package/src/mcp/index.js +30 -25
- package/src/mcp/server.js +9 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "brave-real-browser-mcp-server",
|
|
3
|
-
"version": "2.43.
|
|
3
|
+
"version": "2.43.26",
|
|
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",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"license": "ISC",
|
|
75
75
|
"dependencies": {
|
|
76
76
|
"@modelcontextprotocol/sdk": "^1.25.3",
|
|
77
|
-
"brave-real-puppeteer-core": "^24.37.3-brave.
|
|
77
|
+
"brave-real-puppeteer-core": "^24.37.3-brave.10",
|
|
78
78
|
"ghost-cursor": "^1.4.2",
|
|
79
79
|
"puppeteer-extra": "^3.3.6",
|
|
80
80
|
"puppeteer-extra-plugin-stealth": "^2.11.2",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "brave-real-blocker",
|
|
3
|
-
"version": "1.19.
|
|
3
|
+
"version": "1.19.27",
|
|
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",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"@cliqz/adblocker-puppeteer": "^1.34.0",
|
|
57
57
|
"@ghostery/adblocker-puppeteer": "^2.14.1",
|
|
58
58
|
"adm-zip": "^0.5.10",
|
|
59
|
-
"brave-real-puppeteer-core": "^24.37.3-brave.
|
|
59
|
+
"brave-real-puppeteer-core": "^24.37.3-brave.10",
|
|
60
60
|
"cross-fetch": "^4.1.0",
|
|
61
61
|
"fs-extra": "^11.3.3",
|
|
62
62
|
"got": "^13.0.0"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "brave-real-launcher",
|
|
3
|
-
"version": "1.25.
|
|
3
|
+
"version": "1.25.26",
|
|
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.19.
|
|
57
|
+
"brave-real-blocker": "^1.19.27",
|
|
58
58
|
"escape-string-regexp": "^5.0.0",
|
|
59
59
|
"is-wsl": "^3.1.1",
|
|
60
60
|
"which": "^6.0.1"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "brave-real-puppeteer-core",
|
|
3
|
-
"version": "24.37.3-brave.
|
|
3
|
+
"version": "24.37.3-brave.10",
|
|
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",
|
|
@@ -135,7 +135,7 @@
|
|
|
135
135
|
},
|
|
136
136
|
"dependencies": {
|
|
137
137
|
"@puppeteer/browsers": "2.12.1",
|
|
138
|
-
"brave-real-launcher": "^1.25.
|
|
138
|
+
"brave-real-launcher": "^1.25.26",
|
|
139
139
|
"chromium-bidi": "14.0.0",
|
|
140
140
|
"debug": "^4.4.3",
|
|
141
141
|
"devtools-protocol": "0.0.1566079",
|
package/src/mcp/index.js
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
// CRITICAL: Redirect ALL console.log to STDERR BEFORE any imports.
|
|
3
|
+
// MCP uses STDIO transport โ STDOUT must contain ONLY JSON-RPC messages.
|
|
4
|
+
// Any console.log from ANY dependency will corrupt the JSON-RPC stream.
|
|
5
|
+
console.log = function (...args) { console.error(...args); };
|
|
6
|
+
|
|
2
7
|
/**
|
|
3
8
|
* Brave Real Browser MCP Server - Entry Point
|
|
4
9
|
*
|
|
@@ -37,27 +42,27 @@ function displayStartupBanner() {
|
|
|
37
42
|
console.error(`${colors.bright}${colors.cyan}โ${colors.reset} ${colors.dim}Puppeteer + Brave + Stealth + Turnstile${colors.reset} ${colors.cyan}โ${colors.reset}`);
|
|
38
43
|
console.error(`${colors.bright}${colors.cyan}โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ${colors.reset}`);
|
|
39
44
|
console.error('');
|
|
40
|
-
|
|
45
|
+
|
|
41
46
|
console.error(`${colors.bright}${colors.green}๐ฆ Available Tools (${TOOL_DISPLAY.length}):${colors.reset}`);
|
|
42
47
|
console.error(`${colors.dim}${'โ'.repeat(60)}${colors.reset}`);
|
|
43
|
-
|
|
48
|
+
|
|
44
49
|
// Display tools in 2 columns
|
|
45
50
|
const half = Math.ceil(TOOL_DISPLAY.length / 2);
|
|
46
|
-
|
|
51
|
+
|
|
47
52
|
for (let i = 0; i < half; i++) {
|
|
48
53
|
const left = TOOL_DISPLAY[i];
|
|
49
54
|
const right = TOOL_DISPLAY[i + half];
|
|
50
|
-
|
|
51
|
-
const leftStr = left
|
|
55
|
+
|
|
56
|
+
const leftStr = left
|
|
52
57
|
? `${left.emoji} ${colors.yellow}${left.name.padEnd(22)}${colors.reset}`
|
|
53
58
|
: '';
|
|
54
|
-
const rightStr = right
|
|
59
|
+
const rightStr = right
|
|
55
60
|
? `${right.emoji} ${colors.yellow}${right.name}${colors.reset}`
|
|
56
61
|
: '';
|
|
57
|
-
|
|
62
|
+
|
|
58
63
|
console.error(` ${leftStr}${rightStr}`);
|
|
59
64
|
}
|
|
60
|
-
|
|
65
|
+
|
|
61
66
|
console.error(`${colors.dim}${'โ'.repeat(60)}${colors.reset}`);
|
|
62
67
|
console.error('');
|
|
63
68
|
console.error(`${colors.bright}${colors.blue}๐ Transport:${colors.reset} STDIO (for MCP clients)`);
|
|
@@ -73,7 +78,7 @@ function displayStartupBanner() {
|
|
|
73
78
|
function displayToolDetails() {
|
|
74
79
|
console.error(`${colors.bright}${colors.green}๐ Tool Details:${colors.reset}`);
|
|
75
80
|
console.error('');
|
|
76
|
-
|
|
81
|
+
|
|
77
82
|
for (const tool of TOOL_DISPLAY) {
|
|
78
83
|
console.error(` ${tool.emoji} ${colors.bright}${colors.yellow}${tool.name}${colors.reset}`);
|
|
79
84
|
console.error(` ${colors.dim}${tool.description}${colors.reset}`);
|
|
@@ -89,45 +94,45 @@ function displayToolDetails() {
|
|
|
89
94
|
*/
|
|
90
95
|
function setupShutdownHandlers(server) {
|
|
91
96
|
let isShuttingDown = false;
|
|
92
|
-
|
|
97
|
+
|
|
93
98
|
const gracefulShutdown = async (signal) => {
|
|
94
99
|
if (isShuttingDown) return;
|
|
95
100
|
isShuttingDown = true;
|
|
96
|
-
|
|
101
|
+
|
|
97
102
|
console.error('');
|
|
98
103
|
console.error(`${colors.bright}${colors.yellow}๐งน Cleanup in progress...${colors.reset}`);
|
|
99
|
-
|
|
104
|
+
|
|
100
105
|
try {
|
|
101
106
|
await cleanup();
|
|
102
107
|
console.error(`${colors.bright}${colors.green}โ
Browser closed${colors.reset}`);
|
|
103
108
|
} catch (e) {
|
|
104
109
|
console.error(`${colors.dim}Browser already closed${colors.reset}`);
|
|
105
110
|
}
|
|
106
|
-
|
|
111
|
+
|
|
107
112
|
try {
|
|
108
113
|
await shutdownServer(server);
|
|
109
114
|
console.error(`${colors.bright}${colors.green}โ
MCP Server stopped${colors.reset}`);
|
|
110
115
|
} catch (e) {
|
|
111
116
|
// Server may already be closed
|
|
112
117
|
}
|
|
113
|
-
|
|
118
|
+
|
|
114
119
|
console.error(`${colors.bright}${colors.magenta}๐ Goodbye!${colors.reset}`);
|
|
115
120
|
console.error('');
|
|
116
|
-
|
|
121
|
+
|
|
117
122
|
process.exit(0);
|
|
118
123
|
};
|
|
119
|
-
|
|
124
|
+
|
|
120
125
|
// Handle various termination signals
|
|
121
126
|
process.on('SIGINT', () => gracefulShutdown('SIGINT'));
|
|
122
127
|
process.on('SIGTERM', () => gracefulShutdown('SIGTERM'));
|
|
123
128
|
process.on('SIGHUP', () => gracefulShutdown('SIGHUP'));
|
|
124
|
-
|
|
129
|
+
|
|
125
130
|
// Handle uncaught errors
|
|
126
131
|
process.on('uncaughtException', async (error) => {
|
|
127
132
|
console.error(`${colors.bright}${colors.red}โ Uncaught Exception:${colors.reset}`, error.message);
|
|
128
133
|
await gracefulShutdown('error');
|
|
129
134
|
});
|
|
130
|
-
|
|
135
|
+
|
|
131
136
|
process.on('unhandledRejection', async (reason) => {
|
|
132
137
|
console.error(`${colors.bright}${colors.red}โ Unhandled Rejection:${colors.reset}`, reason);
|
|
133
138
|
await gracefulShutdown('error');
|
|
@@ -140,27 +145,27 @@ function setupShutdownHandlers(server) {
|
|
|
140
145
|
async function main() {
|
|
141
146
|
// Check for verbose flag
|
|
142
147
|
const verbose = process.argv.includes('--verbose') || process.argv.includes('-v');
|
|
143
|
-
|
|
148
|
+
|
|
144
149
|
// Display startup info
|
|
145
150
|
displayStartupBanner();
|
|
146
|
-
|
|
151
|
+
|
|
147
152
|
if (verbose) {
|
|
148
153
|
displayToolDetails();
|
|
149
154
|
}
|
|
150
|
-
|
|
155
|
+
|
|
151
156
|
try {
|
|
152
157
|
// Start MCP server
|
|
153
158
|
console.error(`${colors.bright}${colors.green}๐ Starting MCP Server...${colors.reset}`);
|
|
154
|
-
|
|
159
|
+
|
|
155
160
|
const { server } = await startServer();
|
|
156
|
-
|
|
161
|
+
|
|
157
162
|
console.error(`${colors.bright}${colors.green}โ
MCP Server running${colors.reset}`);
|
|
158
163
|
console.error(`${colors.dim}Waiting for client connections via STDIO...${colors.reset}`);
|
|
159
164
|
console.error('');
|
|
160
|
-
|
|
165
|
+
|
|
161
166
|
// Setup shutdown handlers
|
|
162
167
|
setupShutdownHandlers(server);
|
|
163
|
-
|
|
168
|
+
|
|
164
169
|
} catch (error) {
|
|
165
170
|
console.error(`${colors.bright}${colors.red}โ Failed to start server:${colors.reset}`, error.message);
|
|
166
171
|
process.exit(1);
|
package/src/mcp/server.js
CHANGED
|
@@ -5,6 +5,15 @@
|
|
|
5
5
|
* Supports: Claude, Cursor, Copilot, and other MCP-compatible AI assistants
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
+
// CRITICAL: Redirect ALL console.log to STDERR before ANY imports
|
|
9
|
+
// MCP uses STDIO transport โ STDOUT must contain ONLY JSON-RPC messages.
|
|
10
|
+
// Any console.log from this code or ANY dependency (puppeteer, blocker, etc.)
|
|
11
|
+
// will corrupt the JSON-RPC stream and cause parsing errors.
|
|
12
|
+
const _originalConsoleLog = console.log;
|
|
13
|
+
console.log = function (...args) {
|
|
14
|
+
console.error(...args);
|
|
15
|
+
};
|
|
16
|
+
|
|
8
17
|
const { Server } = require('@modelcontextprotocol/sdk/server/index.js');
|
|
9
18
|
const { StdioServerTransport } = require('@modelcontextprotocol/sdk/server/stdio.js');
|
|
10
19
|
const {
|