brave-real-browser-mcp-server 2.27.21 → 2.27.23

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,
@@ -987,9 +1004,15 @@ export async function handleScrapeMetaTags(page, args) {
987
1004
  * Simulate keyboard key presses
988
1005
  */
989
1006
  export async function handlePressKey(page, args) {
1007
+ // Progress tracking
1008
+ const progressNotifier = getProgressNotifier();
1009
+ const tracker = progressNotifier.createTracker(`press-key-${Date.now()}`);
1010
+ tracker.start(100, `⌨️ Pressing key: ${args.key}...`);
990
1011
  const count = args.count || 1;
991
1012
  const delay = args.delay || 100;
992
1013
  const modifiers = args.modifiers || [];
1014
+ const keyCombo = modifiers.length > 0 ? `${modifiers.join('+')}+${args.key}` : args.key;
1015
+ tracker.setProgress(20, `🎹 Pressing ${keyCombo} (${count}x)`);
993
1016
  for (let i = 0; i < count; i++) {
994
1017
  // Hold modifiers
995
1018
  for (const mod of modifiers) {
@@ -1003,10 +1026,16 @@ export async function handlePressKey(page, args) {
1003
1026
  if (i < count - 1) {
1004
1027
  await new Promise((r) => setTimeout(r, delay));
1005
1028
  }
1029
+ // Update progress for multiple presses
1030
+ if (count > 1) {
1031
+ const progress = 20 + Math.round(((i + 1) / count) * 70);
1032
+ tracker.setProgress(progress, `⌨️ Pressed ${i + 1}/${count}`);
1033
+ }
1006
1034
  }
1035
+ tracker.complete(`🎉 Key pressed: ${keyCombo}`);
1007
1036
  return {
1008
1037
  success: true,
1009
- key: modifiers.length > 0 ? `${modifiers.join('+')}+${args.key}` : args.key,
1038
+ key: keyCombo,
1010
1039
  count,
1011
1040
  };
1012
1041
  }
@@ -1033,9 +1062,14 @@ export async function handleProgressTracker(_page, args) {
1033
1062
  * Uses response events instead of request interception to avoid crashes
1034
1063
  */
1035
1064
  export async function handleDeepAnalysis(page, args) {
1065
+ // Progress tracking
1066
+ const progressNotifier = getProgressNotifier();
1067
+ const tracker = progressNotifier.createTracker(`deep-analysis-${Date.now()}`);
1068
+ tracker.start(100, '🔬 Starting deep analysis...');
1036
1069
  const consoleLogs = [];
1037
1070
  const networkRequests = [];
1038
1071
  const duration = args.duration || 5000;
1072
+ tracker.setProgress(10, `⏱️ Recording for ${duration}ms...`);
1039
1073
  // Console log handler
1040
1074
  const consoleHandler = (msg) => {
1041
1075
  try {
@@ -1061,10 +1095,12 @@ export async function handleDeepAnalysis(page, args) {
1061
1095
  try {
1062
1096
  // Collect console logs
1063
1097
  if (args.includeConsole !== false) {
1098
+ tracker.setProgress(20, '📝 Monitoring console logs...');
1064
1099
  page.on('console', consoleHandler);
1065
1100
  }
1066
1101
  // Collect network using response events (safer than request interception)
1067
1102
  if (args.includeNetwork !== false) {
1103
+ tracker.setProgress(30, '🌐 Recording network traffic...');
1068
1104
  page.on('response', responseHandler);
1069
1105
  }
1070
1106
  // Wait for specified duration
@@ -1124,6 +1160,10 @@ export async function handleDeepAnalysis(page, args) {
1124
1160
  * ULTRA POWERFUL: API detection, media URLs, smart categorization
1125
1161
  */
1126
1162
  export async function handleNetworkRecorder(page, args) {
1163
+ // Progress tracking
1164
+ const progressNotifier = getProgressNotifier();
1165
+ const tracker = progressNotifier.createTracker(`network-recorder-${Date.now()}`);
1166
+ tracker.start(100, '🌐 Starting network recording...');
1127
1167
  const requests = [];
1128
1168
  const duration = args.duration || 10000;
1129
1169
  let totalSize = 0;
@@ -1131,6 +1171,7 @@ export async function handleNetworkRecorder(page, args) {
1131
1171
  const apis = [];
1132
1172
  const mediaUrls = [];
1133
1173
  const seen = new Set();
1174
+ tracker.setProgress(10, `⏱️ Recording for ${duration}ms...`);
1134
1175
  // ============================================================
1135
1176
  // SMART CATEGORIZATION HELPER
1136
1177
  // ============================================================
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "brave-real-browser-mcp-server",
3
- "version": "2.27.21",
3
+ "version": "2.27.23",
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.21",
53
+ "brave-real-browser": "^2.8.23",
54
54
  "puppeteer-core": "^24.35.0",
55
55
  "turndown": "latest",
56
56
  "vscode-languageserver": "^9.0.1",