brave-real-browser-mcp-server 2.27.21 → 2.27.22
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.
|
@@ -11,6 +11,10 @@ import { getProgressNotifier } from '../transport/progress-notifier.js';
|
|
|
11
11
|
* Navigate using site breadcrumbs
|
|
12
12
|
*/
|
|
13
13
|
export async function handleBreadcrumbNavigator(page, args) {
|
|
14
|
+
// Progress tracking
|
|
15
|
+
const progressNotifier = getProgressNotifier();
|
|
16
|
+
const tracker = progressNotifier.createTracker(`breadcrumb-${Date.now()}`);
|
|
17
|
+
tracker.start(100, '🍞 Finding breadcrumbs...');
|
|
14
18
|
const breadcrumbSelectors = [
|
|
15
19
|
'nav[aria-label*="breadcrumb"]',
|
|
16
20
|
'.breadcrumb',
|
|
@@ -19,13 +23,17 @@ export async function handleBreadcrumbNavigator(page, args) {
|
|
|
19
23
|
'ol.breadcrumb',
|
|
20
24
|
'ul.breadcrumb',
|
|
21
25
|
];
|
|
26
|
+
tracker.setProgress(20, '🔍 Searching for breadcrumb container...');
|
|
22
27
|
let breadcrumbContainer = null;
|
|
23
28
|
for (const selector of breadcrumbSelectors) {
|
|
24
29
|
breadcrumbContainer = await page.$(selector);
|
|
25
|
-
if (breadcrumbContainer)
|
|
30
|
+
if (breadcrumbContainer) {
|
|
31
|
+
tracker.setProgress(40, `✅ Found breadcrumb: ${selector}`);
|
|
26
32
|
break;
|
|
33
|
+
}
|
|
27
34
|
}
|
|
28
35
|
if (!breadcrumbContainer) {
|
|
36
|
+
tracker.fail('No breadcrumbs found');
|
|
29
37
|
return { success: false, breadcrumbs: [] };
|
|
30
38
|
}
|
|
31
39
|
const breadcrumbs = await page.evaluate((container) => {
|
|
@@ -190,13 +198,19 @@ export async function handleMultiLayerRedirectTrace(page, args) {
|
|
|
190
198
|
* Search text or regex patterns in page content
|
|
191
199
|
*/
|
|
192
200
|
export async function handleSearchContent(page, args) {
|
|
201
|
+
// Progress tracking
|
|
202
|
+
const progressNotifier = getProgressNotifier();
|
|
203
|
+
const tracker = progressNotifier.createTracker(`search-${Date.now()}`);
|
|
204
|
+
tracker.start(100, `🔎 Searching for: "${args.pattern}"...`);
|
|
193
205
|
// Wait for body to be available
|
|
194
206
|
try {
|
|
207
|
+
tracker.setProgress(10, '⏳ Waiting for page content...');
|
|
195
208
|
await page.waitForSelector('body', { timeout: 5000 });
|
|
196
209
|
}
|
|
197
210
|
catch {
|
|
198
211
|
// Continue anyway
|
|
199
212
|
}
|
|
213
|
+
tracker.setProgress(30, '📄 Extracting page content...');
|
|
200
214
|
let content = '';
|
|
201
215
|
if (args.selector) {
|
|
202
216
|
try {
|
|
@@ -211,8 +225,10 @@ export async function handleSearchContent(page, args) {
|
|
|
211
225
|
}
|
|
212
226
|
const matches = [];
|
|
213
227
|
if (!content || content.length === 0) {
|
|
228
|
+
tracker.fail('No content to search');
|
|
214
229
|
return { found: false, matches: [], count: 0 };
|
|
215
230
|
}
|
|
231
|
+
tracker.setProgress(50, '🔍 Running pattern match...');
|
|
216
232
|
let regex;
|
|
217
233
|
if (args.isRegex) {
|
|
218
234
|
regex = new RegExp(args.pattern, args.caseSensitive ? 'g' : 'gi');
|
|
@@ -232,6 +248,7 @@ export async function handleSearchContent(page, args) {
|
|
|
232
248
|
if (matches.length >= 100)
|
|
233
249
|
break; // Limit matches
|
|
234
250
|
}
|
|
251
|
+
tracker.complete(`🎉 Found ${matches.length} matches`);
|
|
235
252
|
return {
|
|
236
253
|
found: matches.length > 0,
|
|
237
254
|
matches,
|
|
@@ -1033,9 +1050,14 @@ export async function handleProgressTracker(_page, args) {
|
|
|
1033
1050
|
* Uses response events instead of request interception to avoid crashes
|
|
1034
1051
|
*/
|
|
1035
1052
|
export async function handleDeepAnalysis(page, args) {
|
|
1053
|
+
// Progress tracking
|
|
1054
|
+
const progressNotifier = getProgressNotifier();
|
|
1055
|
+
const tracker = progressNotifier.createTracker(`deep-analysis-${Date.now()}`);
|
|
1056
|
+
tracker.start(100, '🔬 Starting deep analysis...');
|
|
1036
1057
|
const consoleLogs = [];
|
|
1037
1058
|
const networkRequests = [];
|
|
1038
1059
|
const duration = args.duration || 5000;
|
|
1060
|
+
tracker.setProgress(10, `⏱️ Recording for ${duration}ms...`);
|
|
1039
1061
|
// Console log handler
|
|
1040
1062
|
const consoleHandler = (msg) => {
|
|
1041
1063
|
try {
|
|
@@ -1061,10 +1083,12 @@ export async function handleDeepAnalysis(page, args) {
|
|
|
1061
1083
|
try {
|
|
1062
1084
|
// Collect console logs
|
|
1063
1085
|
if (args.includeConsole !== false) {
|
|
1086
|
+
tracker.setProgress(20, '📝 Monitoring console logs...');
|
|
1064
1087
|
page.on('console', consoleHandler);
|
|
1065
1088
|
}
|
|
1066
1089
|
// Collect network using response events (safer than request interception)
|
|
1067
1090
|
if (args.includeNetwork !== false) {
|
|
1091
|
+
tracker.setProgress(30, '🌐 Recording network traffic...');
|
|
1068
1092
|
page.on('response', responseHandler);
|
|
1069
1093
|
}
|
|
1070
1094
|
// Wait for specified duration
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "brave-real-browser-mcp-server",
|
|
3
|
-
"version": "2.27.
|
|
3
|
+
"version": "2.27.22",
|
|
4
4
|
"description": "🦁 MCP server for Brave Real Browser - NPM Workspaces Monorepo with anti-detection features, SSE streaming, and LSP compatibility",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@modelcontextprotocol/sdk": "latest",
|
|
52
52
|
"@types/turndown": "latest",
|
|
53
|
-
"brave-real-browser": "^2.8.
|
|
53
|
+
"brave-real-browser": "^2.8.22",
|
|
54
54
|
"puppeteer-core": "^24.35.0",
|
|
55
55
|
"turndown": "latest",
|
|
56
56
|
"vscode-languageserver": "^9.0.1",
|