brave-real-browser-mcp-server 2.8.2 → 2.8.3

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.
@@ -62,16 +62,25 @@ export async function handleKeywordSearch(args) {
62
62
  allMatches: allMatches.slice(0, 100) // Limit to first 100
63
63
  };
64
64
  }, keywords, caseSensitive, wholeWord, context);
65
+ const resultText = `✅ Keyword Search Results\n\nTotal Matches: ${results.totalMatches}\n\nKeywords searched: ${Array.isArray(keywords) ? keywords.join(', ') : keywords}\n\nMatches by keyword:\n${JSON.stringify(results.matchesByKeyword, null, 2)}\n\nFirst 100 matches:\n${JSON.stringify(results.allMatches, null, 2)}`;
65
66
  return {
66
- success: true,
67
- keywords,
68
- ...results
67
+ content: [
68
+ {
69
+ type: 'text',
70
+ text: resultText,
71
+ },
72
+ ],
69
73
  };
70
74
  }
71
75
  catch (error) {
72
76
  return {
73
- success: false,
74
- error: error.message
77
+ content: [
78
+ {
79
+ type: 'text',
80
+ text: `❌ Keyword search failed: ${error.message}`,
81
+ },
82
+ ],
83
+ isError: true,
75
84
  };
76
85
  }
77
86
  }
@@ -119,15 +128,25 @@ export async function handleRegexPatternMatcher(args) {
119
128
  flags: flgs
120
129
  };
121
130
  }, pattern, flags, selector || '');
131
+ const resultText = `✅ Regex Pattern Matcher Results\n\nPattern: ${results.pattern}\nFlags: ${results.flags}\nTotal Matches: ${results.totalMatches}\n\nMatches (first 100):\n${JSON.stringify(results.matches, null, 2)}`;
122
132
  return {
123
- success: true,
124
- ...results
133
+ content: [
134
+ {
135
+ type: 'text',
136
+ text: resultText,
137
+ },
138
+ ],
125
139
  };
126
140
  }
127
141
  catch (error) {
128
142
  return {
129
- success: false,
130
- error: error.message
143
+ content: [
144
+ {
145
+ type: 'text',
146
+ text: `❌ Regex pattern matcher failed: ${error.message}`,
147
+ },
148
+ ],
149
+ isError: true,
131
150
  };
132
151
  }
133
152
  }
@@ -37,20 +37,25 @@ export async function handleFullPageScreenshot(args) {
37
37
  const stats = await fs.stat(outputPath);
38
38
  fileSize = stats.size;
39
39
  }
40
+ const resultText = `✅ Screenshot captured successfully\n\nPath: ${outputPath}\nFormat: ${format}\nFull Page: ${fullPage}\nFile Size: ${(fileSize / 1024).toFixed(2)} KB\nTimestamp: ${new Date().toISOString()}`;
40
41
  return {
41
- success: true,
42
- path: outputPath,
43
- format,
44
- fullPage,
45
- fileSize,
46
- fileSizeKB: (fileSize / 1024).toFixed(2),
47
- timestamp: new Date().toISOString()
42
+ content: [
43
+ {
44
+ type: 'text',
45
+ text: resultText,
46
+ },
47
+ ],
48
48
  };
49
49
  }
50
50
  catch (error) {
51
51
  return {
52
- success: false,
53
- error: error.message
52
+ content: [
53
+ {
54
+ type: 'text',
55
+ text: `❌ Screenshot failed: ${error.message}`,
56
+ },
57
+ ],
58
+ isError: true,
54
59
  };
55
60
  }
56
61
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "brave-real-browser-mcp-server",
3
- "version": "2.8.2",
3
+ "version": "2.8.3",
4
4
  "description": "MCP server for brave-real-browser",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",