brave-real-browser-mcp-server 2.14.9 → 2.14.11
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 +5 -2
- package/dist/handlers/advanced-scraping-handlers.js +58 -0
- package/dist/handlers/advanced-video-media-handlers.js +134 -1246
- package/dist/handlers/ai-powered-handlers.js +113 -17
- package/dist/handlers/data-quality-handlers.js +74 -0
- package/dist/handlers/data-transform-handlers.js +66 -0
- package/dist/handlers/dom-handlers.js +206 -0
- package/dist/handlers/network-handlers.js +111 -0
- package/dist/handlers/search-filter-handlers.js +15 -71
- package/dist/mcp-server.js +133 -0
- package/dist/tool-definitions.js +129 -14
- package/package.json +1 -1
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
1
|
import { getPageInstance } from '../browser-manager.js';
|
|
3
2
|
/**
|
|
4
3
|
* Keyword Search - Advanced keyword search in page content
|
|
@@ -19,7 +18,7 @@ export async function handleKeywordSearch(args) {
|
|
|
19
18
|
keywordList.forEach(keyword => {
|
|
20
19
|
const flags = caseSens ? 'g' : 'gi';
|
|
21
20
|
const pattern = whole ? `\\b${keyword}\\b` : keyword;
|
|
22
|
-
const regex = new RegExp(pattern, flags);
|
|
21
|
+
//const regex = new RegExp(pattern, flags);
|
|
23
22
|
const walker = document.createTreeWalker(document.body, NodeFilter.SHOW_TEXT, null);
|
|
24
23
|
let node;
|
|
25
24
|
while (node = walker.nextNode()) {
|
|
@@ -61,7 +60,7 @@ export async function handleKeywordSearch(args) {
|
|
|
61
60
|
matchesByKeyword: grouped,
|
|
62
61
|
allMatches: allMatches.slice(0, 100) // Limit to first 100
|
|
63
62
|
};
|
|
64
|
-
}, keywords, caseSensitive, wholeWord, context);
|
|
63
|
+
}, Array.isArray(keywords) ? keywords : [keywords], caseSensitive, wholeWord, context);
|
|
65
64
|
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)}`;
|
|
66
65
|
return {
|
|
67
66
|
content: [
|
|
@@ -74,12 +73,7 @@ export async function handleKeywordSearch(args) {
|
|
|
74
73
|
}
|
|
75
74
|
catch (error) {
|
|
76
75
|
return {
|
|
77
|
-
content: [
|
|
78
|
-
{
|
|
79
|
-
type: 'text',
|
|
80
|
-
text: `❌ Keyword search failed: ${error.message}`,
|
|
81
|
-
},
|
|
82
|
-
],
|
|
76
|
+
content: [{ type: 'text', text: `❌ Keyword search failed: ${error.message}` }],
|
|
83
77
|
isError: true,
|
|
84
78
|
};
|
|
85
79
|
}
|
|
@@ -109,14 +103,16 @@ export async function handleRegexPatternMatcher(args) {
|
|
|
109
103
|
const regex = new RegExp(pat, flgs);
|
|
110
104
|
const matches = [];
|
|
111
105
|
let match;
|
|
112
|
-
|
|
106
|
+
// Safety check for infinite loop
|
|
107
|
+
let count = 0;
|
|
108
|
+
while ((match = regex.exec(content)) !== null && count < 1000) {
|
|
109
|
+
count++;
|
|
113
110
|
matches.push({
|
|
114
111
|
match: match[0],
|
|
115
112
|
index: match.index,
|
|
116
113
|
groups: match.slice(1),
|
|
117
114
|
context: content.substring(Math.max(0, match.index - 50), Math.min(content.length, match.index + match[0].length + 50))
|
|
118
115
|
});
|
|
119
|
-
// Prevent infinite loop for zero-width matches
|
|
120
116
|
if (match.index === regex.lastIndex) {
|
|
121
117
|
regex.lastIndex++;
|
|
122
118
|
}
|
|
@@ -130,24 +126,11 @@ export async function handleRegexPatternMatcher(args) {
|
|
|
130
126
|
}, pattern, flags, selector || '');
|
|
131
127
|
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)}`;
|
|
132
128
|
return {
|
|
133
|
-
content: [
|
|
134
|
-
{
|
|
135
|
-
type: 'text',
|
|
136
|
-
text: resultText,
|
|
137
|
-
},
|
|
138
|
-
],
|
|
129
|
+
content: [{ type: 'text', text: resultText }],
|
|
139
130
|
};
|
|
140
131
|
}
|
|
141
132
|
catch (error) {
|
|
142
|
-
return {
|
|
143
|
-
content: [
|
|
144
|
-
{
|
|
145
|
-
type: 'text',
|
|
146
|
-
text: `❌ Regex pattern matcher failed: ${error.message}`,
|
|
147
|
-
},
|
|
148
|
-
],
|
|
149
|
-
isError: true,
|
|
150
|
-
};
|
|
133
|
+
return { content: [{ type: 'text', text: `❌ Regex pattern matcher failed: ${error.message}` }], isError: true };
|
|
151
134
|
}
|
|
152
135
|
}
|
|
153
136
|
/**
|
|
@@ -205,24 +188,11 @@ export async function handleXPathSupport(args) {
|
|
|
205
188
|
}, xpath, returnType);
|
|
206
189
|
const resultText = `✅ XPath Query Results\n\nXPath: ${xpath}\nElements Found: ${results.count}\n\nElements:\n${JSON.stringify(results.elements, null, 2)}`;
|
|
207
190
|
return {
|
|
208
|
-
content: [
|
|
209
|
-
{
|
|
210
|
-
type: 'text',
|
|
211
|
-
text: resultText,
|
|
212
|
-
},
|
|
213
|
-
],
|
|
191
|
+
content: [{ type: 'text', text: resultText }],
|
|
214
192
|
};
|
|
215
193
|
}
|
|
216
194
|
catch (error) {
|
|
217
|
-
return {
|
|
218
|
-
content: [
|
|
219
|
-
{
|
|
220
|
-
type: 'text',
|
|
221
|
-
text: `❌ XPath query failed: ${error.message}`,
|
|
222
|
-
},
|
|
223
|
-
],
|
|
224
|
-
isError: true,
|
|
225
|
-
};
|
|
195
|
+
return { content: [{ type: 'text', text: `❌ XPath query failed: ${error.message}` }], isError: true };
|
|
226
196
|
}
|
|
227
197
|
}
|
|
228
198
|
/**
|
|
@@ -285,24 +255,11 @@ export async function handleAdvancedCSSSelectors(args) {
|
|
|
285
255
|
}, selector, operation, returnType);
|
|
286
256
|
const resultText = `✅ Advanced CSS Selector Results\n\nSelector: ${selector}\nOperation: ${operation}\nElements Found: ${results.count}\n\nElements (first 10):\n${JSON.stringify(results.elements.slice(0, 10), null, 2)}`;
|
|
287
257
|
return {
|
|
288
|
-
content: [
|
|
289
|
-
{
|
|
290
|
-
type: 'text',
|
|
291
|
-
text: resultText,
|
|
292
|
-
},
|
|
293
|
-
],
|
|
258
|
+
content: [{ type: 'text', text: resultText }],
|
|
294
259
|
};
|
|
295
260
|
}
|
|
296
261
|
catch (error) {
|
|
297
|
-
return {
|
|
298
|
-
content: [
|
|
299
|
-
{
|
|
300
|
-
type: 'text',
|
|
301
|
-
text: `❌ CSS selector query failed: ${error.message}`,
|
|
302
|
-
},
|
|
303
|
-
],
|
|
304
|
-
isError: true,
|
|
305
|
-
};
|
|
262
|
+
return { content: [{ type: 'text', text: `❌ CSS selector query failed: ${error.message}` }], isError: true };
|
|
306
263
|
}
|
|
307
264
|
}
|
|
308
265
|
/**
|
|
@@ -419,23 +376,10 @@ export async function handleVisualElementFinder(args) {
|
|
|
419
376
|
}, criteria);
|
|
420
377
|
const resultText = `✅ Visual Element Finder Results\n\nCriteria: ${JSON.stringify(criteria, null, 2)}\nTotal Matches: ${results.totalMatches}\n\nTop Matches:\n${JSON.stringify(results.topMatches, null, 2)}`;
|
|
421
378
|
return {
|
|
422
|
-
content: [
|
|
423
|
-
{
|
|
424
|
-
type: 'text',
|
|
425
|
-
text: resultText,
|
|
426
|
-
},
|
|
427
|
-
],
|
|
379
|
+
content: [{ type: 'text', text: resultText }],
|
|
428
380
|
};
|
|
429
381
|
}
|
|
430
382
|
catch (error) {
|
|
431
|
-
return {
|
|
432
|
-
content: [
|
|
433
|
-
{
|
|
434
|
-
type: 'text',
|
|
435
|
-
text: `❌ Visual element finder failed: ${error.message}`,
|
|
436
|
-
},
|
|
437
|
-
],
|
|
438
|
-
isError: true,
|
|
439
|
-
};
|
|
383
|
+
return { content: [{ type: 'text', text: `❌ Visual element finder failed: ${error.message}` }], isError: true };
|
|
440
384
|
}
|
|
441
385
|
}
|
package/dist/mcp-server.js
CHANGED
|
@@ -10,6 +10,16 @@ import { handleGetContent, handleFindSelector } from './handlers/content-handler
|
|
|
10
10
|
import { handleSaveContentAsMarkdown } from './handlers/file-handlers.js';
|
|
11
11
|
import { handleExtractList, handleExtractJSON, handleScrapeMetaTags, handleExtractSchema } from './handlers/data-extraction-handlers.js';
|
|
12
12
|
import { handleBatchElementScraper, handleNestedDataExtraction, handleAttributeHarvester, handleLinkHarvester, handleMediaExtractor, } from './handlers/multi-element-handlers.js';
|
|
13
|
+
import { handleMultiPageScraper, handleBreadcrumbNavigator } from './handlers/advanced-scraping-handlers.js';
|
|
14
|
+
import { handleHtmlElementsExtractor, handleTagsFinder, handleLinksFinder, handleXpathLinks, handleShadowDomExtractor, handleIframeExtractor, handleEmbedPageExtractor } from './handlers/dom-handlers.js';
|
|
15
|
+
import { handleNetworkRecorder, handleAjaxExtractor, handleFetchXhr, handleApiFinder } from './handlers/network-handlers.js';
|
|
16
|
+
import { handleHtmlToText, handleDuplicateRemover } from './handlers/data-transform-handlers.js';
|
|
17
|
+
import { handleConsistencyChecker } from './handlers/data-quality-handlers.js';
|
|
18
|
+
import { handleSmartSelectorGenerator, handleContentClassification, handleSentimentAnalysis, handleSummaryGenerator, handleTranslationSupport } from './handlers/ai-powered-handlers.js';
|
|
19
|
+
import { handleKeywordSearch, handleRegexPatternMatcher, handleXPathSupport, handleAdvancedCSSSelectors, handleVisualElementFinder } from './handlers/search-filter-handlers.js';
|
|
20
|
+
import { handleVideoSourceExtractor, handleVideoPlayerFinder, handleStreamDetector, handleRedirectTracer, handleVideoDownloadLinkFinder } from './handlers/advanced-video-media-handlers.js';
|
|
21
|
+
import { handleOCREngine, handleAudioCaptchaSolver, handlePuzzleCaptchaHandler } from './handlers/captcha-handlers.js';
|
|
22
|
+
import { handleAdvancedVideoExtraction, handleDeobfuscateJS, handleMultiLayerRedirectTrace, handleAdProtectionDetector } from './handlers/advanced-extraction-handlers.js';
|
|
13
23
|
export async function createMcpServer() {
|
|
14
24
|
const server = new Server(SERVER_INFO, { capabilities: CAPABILITIES });
|
|
15
25
|
// Register initialize handler
|
|
@@ -105,6 +115,129 @@ export async function createMcpServer() {
|
|
|
105
115
|
case TOOL_NAMES.MEDIA_EXTRACTOR:
|
|
106
116
|
result = await handleMediaExtractor(args || {});
|
|
107
117
|
break;
|
|
118
|
+
// Phase 1: Pagination & Navigation
|
|
119
|
+
case TOOL_NAMES.MULTI_PAGE_SCRAPER:
|
|
120
|
+
result = await handleMultiPageScraper(args);
|
|
121
|
+
break;
|
|
122
|
+
case TOOL_NAMES.BREADCRUMB_NAVIGATOR:
|
|
123
|
+
result = await handleBreadcrumbNavigator(args);
|
|
124
|
+
break;
|
|
125
|
+
// Phase 1: DOM & HTML
|
|
126
|
+
case TOOL_NAMES.HTML_ELEMENTS_EXTRACTOR:
|
|
127
|
+
result = await handleHtmlElementsExtractor(args);
|
|
128
|
+
break;
|
|
129
|
+
case TOOL_NAMES.TAGS_FINDER:
|
|
130
|
+
result = await handleTagsFinder(args);
|
|
131
|
+
break;
|
|
132
|
+
case TOOL_NAMES.LINKS_FINDER:
|
|
133
|
+
result = await handleLinksFinder(args);
|
|
134
|
+
break;
|
|
135
|
+
case TOOL_NAMES.XPATH_LINKS:
|
|
136
|
+
result = await handleXpathLinks(args);
|
|
137
|
+
break;
|
|
138
|
+
case TOOL_NAMES.SHADOW_DOM_EXTRACTOR:
|
|
139
|
+
result = await handleShadowDomExtractor(args);
|
|
140
|
+
break;
|
|
141
|
+
case TOOL_NAMES.IFRAME_EXTRACTOR:
|
|
142
|
+
result = await handleIframeExtractor();
|
|
143
|
+
break;
|
|
144
|
+
case TOOL_NAMES.EMBED_PAGE_EXTRACTOR:
|
|
145
|
+
result = await handleEmbedPageExtractor();
|
|
146
|
+
break;
|
|
147
|
+
// Phase 1: Network Tools
|
|
148
|
+
case TOOL_NAMES.NETWORK_RECORDER:
|
|
149
|
+
result = await handleNetworkRecorder(args);
|
|
150
|
+
break;
|
|
151
|
+
case TOOL_NAMES.AJAX_EXTRACTOR:
|
|
152
|
+
result = await handleAjaxExtractor(args);
|
|
153
|
+
break;
|
|
154
|
+
case TOOL_NAMES.FETCH_XHR:
|
|
155
|
+
result = await handleFetchXhr(args);
|
|
156
|
+
break;
|
|
157
|
+
case TOOL_NAMES.API_FINDER:
|
|
158
|
+
result = await handleApiFinder(args);
|
|
159
|
+
break;
|
|
160
|
+
// Phase 1: Data Transform
|
|
161
|
+
case TOOL_NAMES.HTML_TO_TEXT:
|
|
162
|
+
result = await handleHtmlToText(args);
|
|
163
|
+
break;
|
|
164
|
+
case TOOL_NAMES.DUPLICATE_REMOVER:
|
|
165
|
+
result = await handleDuplicateRemover(args);
|
|
166
|
+
break;
|
|
167
|
+
// Phase 2: AI & Smart Features
|
|
168
|
+
case TOOL_NAMES.SMART_SELECTOR_GENERATOR:
|
|
169
|
+
result = await handleSmartSelectorGenerator(args);
|
|
170
|
+
break;
|
|
171
|
+
case TOOL_NAMES.CONTENT_CLASSIFICATION:
|
|
172
|
+
result = await handleContentClassification(args);
|
|
173
|
+
break;
|
|
174
|
+
case TOOL_NAMES.SENTIMENT_ANALYSIS:
|
|
175
|
+
result = await handleSentimentAnalysis(args);
|
|
176
|
+
break;
|
|
177
|
+
case TOOL_NAMES.SUMMARY_GENERATOR:
|
|
178
|
+
result = await handleSummaryGenerator(args);
|
|
179
|
+
break;
|
|
180
|
+
case TOOL_NAMES.TRANSLATION_SUPPORT:
|
|
181
|
+
result = await handleTranslationSupport(args);
|
|
182
|
+
break;
|
|
183
|
+
// Phase 2: Search & Filter
|
|
184
|
+
case TOOL_NAMES.KEYWORD_SEARCH:
|
|
185
|
+
result = await handleKeywordSearch(args);
|
|
186
|
+
break;
|
|
187
|
+
case TOOL_NAMES.REGEX_PATTERN_MATCHER:
|
|
188
|
+
result = await handleRegexPatternMatcher(args);
|
|
189
|
+
break;
|
|
190
|
+
case TOOL_NAMES.XPATH_SUPPORT:
|
|
191
|
+
result = await handleXPathSupport(args);
|
|
192
|
+
break;
|
|
193
|
+
case TOOL_NAMES.ADVANCED_CSS_SELECTORS:
|
|
194
|
+
result = await handleAdvancedCSSSelectors(args);
|
|
195
|
+
break;
|
|
196
|
+
case TOOL_NAMES.VISUAL_ELEMENT_FINDER:
|
|
197
|
+
result = await handleVisualElementFinder(args);
|
|
198
|
+
break;
|
|
199
|
+
// Phase 3: Media & Video
|
|
200
|
+
case TOOL_NAMES.VIDEO_SOURCE_EXTRACTOR:
|
|
201
|
+
result = await handleVideoSourceExtractor(args);
|
|
202
|
+
break;
|
|
203
|
+
case TOOL_NAMES.VIDEO_PLAYER_FINDER:
|
|
204
|
+
result = await handleVideoPlayerFinder(args);
|
|
205
|
+
break;
|
|
206
|
+
case TOOL_NAMES.STREAM_DETECTOR:
|
|
207
|
+
result = await handleStreamDetector(args);
|
|
208
|
+
break;
|
|
209
|
+
case TOOL_NAMES.REDIRECT_TRACER:
|
|
210
|
+
result = await handleRedirectTracer(args);
|
|
211
|
+
break;
|
|
212
|
+
case TOOL_NAMES.VIDEO_DOWNLOAD_LINK_FINDER:
|
|
213
|
+
result = await handleVideoDownloadLinkFinder(args);
|
|
214
|
+
break;
|
|
215
|
+
// Phase 4: Captcha & Security
|
|
216
|
+
case TOOL_NAMES.OCR_ENGINE:
|
|
217
|
+
result = await handleOCREngine(args);
|
|
218
|
+
break;
|
|
219
|
+
case TOOL_NAMES.AUDIO_CAPTCHA_SOLVER:
|
|
220
|
+
result = await handleAudioCaptchaSolver(args);
|
|
221
|
+
break;
|
|
222
|
+
case TOOL_NAMES.PUZZLE_CAPTCHA_HANDLER:
|
|
223
|
+
result = await handlePuzzleCaptchaHandler(args);
|
|
224
|
+
break;
|
|
225
|
+
// Advanced Extraction (Security/Bypass)
|
|
226
|
+
case "advanced_video_extraction":
|
|
227
|
+
result = await handleAdvancedVideoExtraction(args);
|
|
228
|
+
break;
|
|
229
|
+
case "deobfuscate_js":
|
|
230
|
+
result = await handleDeobfuscateJS(args);
|
|
231
|
+
break;
|
|
232
|
+
case "multi_layer_redirect_trace":
|
|
233
|
+
result = await handleMultiLayerRedirectTrace(args);
|
|
234
|
+
break;
|
|
235
|
+
case "ad_protection_detector":
|
|
236
|
+
result = await handleAdProtectionDetector(args);
|
|
237
|
+
break;
|
|
238
|
+
case "consistency_checker":
|
|
239
|
+
result = await handleConsistencyChecker(args);
|
|
240
|
+
break;
|
|
108
241
|
default:
|
|
109
242
|
throw new Error(`Unknown tool: ${name}`);
|
|
110
243
|
}
|
package/dist/tool-definitions.js
CHANGED
|
@@ -333,7 +333,7 @@ export const TOOLS = [
|
|
|
333
333
|
// Smart Data Extractors
|
|
334
334
|
{
|
|
335
335
|
name: 'extract_list',
|
|
336
|
-
description: '
|
|
336
|
+
description: 'Extract data from bullet lists and numbered lists',
|
|
337
337
|
inputSchema: {
|
|
338
338
|
type: 'object',
|
|
339
339
|
properties: {
|
|
@@ -345,7 +345,7 @@ export const TOOLS = [
|
|
|
345
345
|
},
|
|
346
346
|
{
|
|
347
347
|
name: 'extract_json',
|
|
348
|
-
description: '
|
|
348
|
+
description: 'Extract embedded JSON/API data from the page',
|
|
349
349
|
inputSchema: {
|
|
350
350
|
type: 'object',
|
|
351
351
|
properties: {
|
|
@@ -357,7 +357,7 @@ export const TOOLS = [
|
|
|
357
357
|
},
|
|
358
358
|
{
|
|
359
359
|
name: 'scrape_meta_tags',
|
|
360
|
-
description: 'SEO meta tags
|
|
360
|
+
description: 'Extract SEO meta tags and Open Graph data',
|
|
361
361
|
inputSchema: {
|
|
362
362
|
type: 'object',
|
|
363
363
|
properties: {
|
|
@@ -369,7 +369,7 @@ export const TOOLS = [
|
|
|
369
369
|
},
|
|
370
370
|
{
|
|
371
371
|
name: 'extract_schema',
|
|
372
|
-
description: 'Schema.org structured data (JSON-LD, Microdata)
|
|
372
|
+
description: 'Extract Schema.org structured data (JSON-LD, Microdata)',
|
|
373
373
|
inputSchema: {
|
|
374
374
|
type: 'object',
|
|
375
375
|
properties: {
|
|
@@ -381,7 +381,7 @@ export const TOOLS = [
|
|
|
381
381
|
// Multi-Element Extractors
|
|
382
382
|
{
|
|
383
383
|
name: 'batch_element_scraper',
|
|
384
|
-
description: '
|
|
384
|
+
description: 'Scrape multiple similar elements in a batch',
|
|
385
385
|
inputSchema: {
|
|
386
386
|
type: 'object',
|
|
387
387
|
properties: {
|
|
@@ -395,7 +395,7 @@ export const TOOLS = [
|
|
|
395
395
|
},
|
|
396
396
|
{
|
|
397
397
|
name: 'nested_data_extraction',
|
|
398
|
-
description: '
|
|
398
|
+
description: 'Extract data maintaining parent-child relationships',
|
|
399
399
|
inputSchema: {
|
|
400
400
|
type: 'object',
|
|
401
401
|
properties: {
|
|
@@ -408,7 +408,7 @@ export const TOOLS = [
|
|
|
408
408
|
},
|
|
409
409
|
{
|
|
410
410
|
name: 'attribute_harvester',
|
|
411
|
-
description: '
|
|
411
|
+
description: 'Collect attributes (href, src, data-*) from elements',
|
|
412
412
|
inputSchema: {
|
|
413
413
|
type: 'object',
|
|
414
414
|
properties: {
|
|
@@ -422,7 +422,7 @@ export const TOOLS = [
|
|
|
422
422
|
// Content Type Specific Extractors
|
|
423
423
|
{
|
|
424
424
|
name: 'link_harvester',
|
|
425
|
-
description: '
|
|
425
|
+
description: 'Collect internal/external links with classification',
|
|
426
426
|
inputSchema: {
|
|
427
427
|
type: 'object',
|
|
428
428
|
properties: {
|
|
@@ -434,7 +434,7 @@ export const TOOLS = [
|
|
|
434
434
|
},
|
|
435
435
|
{
|
|
436
436
|
name: 'media_extractor',
|
|
437
|
-
description: '
|
|
437
|
+
description: 'Extract URLs and metadata for videos, audio, and iframes',
|
|
438
438
|
inputSchema: {
|
|
439
439
|
type: 'object',
|
|
440
440
|
properties: {
|
|
@@ -446,7 +446,7 @@ export const TOOLS = [
|
|
|
446
446
|
// Pagination Tools
|
|
447
447
|
{
|
|
448
448
|
name: 'multi_page_scraper',
|
|
449
|
-
description: '
|
|
449
|
+
description: 'Collect and merge data from multiple pages',
|
|
450
450
|
inputSchema: {
|
|
451
451
|
type: 'object',
|
|
452
452
|
properties: {
|
|
@@ -459,7 +459,7 @@ export const TOOLS = [
|
|
|
459
459
|
},
|
|
460
460
|
{
|
|
461
461
|
name: 'breadcrumb_navigator',
|
|
462
|
-
description: '
|
|
462
|
+
description: 'Extract navigation path by following site structure',
|
|
463
463
|
inputSchema: {
|
|
464
464
|
type: 'object',
|
|
465
465
|
properties: {
|
|
@@ -471,7 +471,7 @@ export const TOOLS = [
|
|
|
471
471
|
// Data Processing Tools
|
|
472
472
|
{
|
|
473
473
|
name: 'html_to_text',
|
|
474
|
-
description: 'HTML
|
|
474
|
+
description: 'Convert HTML content to clean text',
|
|
475
475
|
inputSchema: {
|
|
476
476
|
type: 'object',
|
|
477
477
|
properties: {
|
|
@@ -485,7 +485,7 @@ export const TOOLS = [
|
|
|
485
485
|
// Data Validation Tools
|
|
486
486
|
{
|
|
487
487
|
name: 'duplicate_remover',
|
|
488
|
-
description: '
|
|
488
|
+
description: 'Remove duplicate items from an array',
|
|
489
489
|
inputSchema: {
|
|
490
490
|
type: 'object',
|
|
491
491
|
properties: {
|
|
@@ -1161,9 +1161,102 @@ export const TOOLS = [
|
|
|
1161
1161
|
description: 'Detect ad-protection mechanisms including ad-block detection, anti-debugger code, popup layers, and hidden elements.',
|
|
1162
1162
|
inputSchema: {
|
|
1163
1163
|
type: 'object',
|
|
1164
|
-
properties: {
|
|
1164
|
+
properties: {
|
|
1165
|
+
url: { type: 'string', description: 'URL of the page to analyze (optional)' },
|
|
1166
|
+
selector: { type: 'string', description: 'CSS selector for content to analyze (optional)' },
|
|
1167
|
+
text: { type: 'string', description: 'Direct text to analyze (optional)' },
|
|
1168
|
+
criteria: { type: 'object', description: 'Visual criteria (visible, color, size, etc.)' },
|
|
1169
|
+
},
|
|
1165
1170
|
},
|
|
1166
1171
|
},
|
|
1172
|
+
{
|
|
1173
|
+
name: 'sentiment_analysis',
|
|
1174
|
+
description: 'Analyze the sentiment of text or page content',
|
|
1175
|
+
inputSchema: {
|
|
1176
|
+
type: 'object',
|
|
1177
|
+
properties: {
|
|
1178
|
+
text: { type: 'string', description: 'Text to analyze' },
|
|
1179
|
+
url: { type: 'string', description: 'URL to analyze' },
|
|
1180
|
+
selector: { type: 'string', description: 'Selector to extract text from' }
|
|
1181
|
+
}
|
|
1182
|
+
}
|
|
1183
|
+
},
|
|
1184
|
+
{
|
|
1185
|
+
name: 'summary_generator',
|
|
1186
|
+
description: 'Generate a summary of text or page content',
|
|
1187
|
+
inputSchema: {
|
|
1188
|
+
type: 'object',
|
|
1189
|
+
properties: {
|
|
1190
|
+
text: { type: 'string', description: 'Text to summarize' },
|
|
1191
|
+
url: { type: 'string', description: 'URL to summarize' },
|
|
1192
|
+
selector: { type: 'string', description: 'Selector to extract text from' },
|
|
1193
|
+
maxLength: { type: 'number', description: 'Maximum length of summary' }
|
|
1194
|
+
}
|
|
1195
|
+
}
|
|
1196
|
+
},
|
|
1197
|
+
{
|
|
1198
|
+
name: 'translation_support',
|
|
1199
|
+
description: 'Detect language and translate text',
|
|
1200
|
+
inputSchema: {
|
|
1201
|
+
type: 'object',
|
|
1202
|
+
properties: {
|
|
1203
|
+
text: { type: 'string', description: 'Text to translate' },
|
|
1204
|
+
url: { type: 'string', description: 'URL to translate content from' },
|
|
1205
|
+
targetLanguage: { type: 'string', description: 'Target language code (e.g. "es", "fr")' }
|
|
1206
|
+
}
|
|
1207
|
+
}
|
|
1208
|
+
},
|
|
1209
|
+
// Phase 3: Media & Video Tools
|
|
1210
|
+
{
|
|
1211
|
+
name: 'video_source_extractor',
|
|
1212
|
+
description: 'Extract raw video sources from video tags and sources',
|
|
1213
|
+
inputSchema: {
|
|
1214
|
+
type: 'object',
|
|
1215
|
+
properties: {
|
|
1216
|
+
url: { type: 'string' }
|
|
1217
|
+
}
|
|
1218
|
+
}
|
|
1219
|
+
},
|
|
1220
|
+
{
|
|
1221
|
+
name: 'video_player_finder',
|
|
1222
|
+
description: 'Identify video players (JWPlayer, VideoJS, etc) and extract config',
|
|
1223
|
+
inputSchema: {
|
|
1224
|
+
type: 'object',
|
|
1225
|
+
properties: {
|
|
1226
|
+
url: { type: 'string' }
|
|
1227
|
+
}
|
|
1228
|
+
}
|
|
1229
|
+
},
|
|
1230
|
+
{
|
|
1231
|
+
name: 'stream_detector',
|
|
1232
|
+
description: 'Detects HLS (m3u8) and DASH (mpd) streams from network traffic',
|
|
1233
|
+
inputSchema: {
|
|
1234
|
+
type: 'object',
|
|
1235
|
+
properties: {
|
|
1236
|
+
duration: { type: 'number', description: 'Monitoring duration in ms' }
|
|
1237
|
+
}
|
|
1238
|
+
}
|
|
1239
|
+
},
|
|
1240
|
+
{
|
|
1241
|
+
name: 'redirect_tracer',
|
|
1242
|
+
description: 'Trace URL redirects to find final destination',
|
|
1243
|
+
inputSchema: {
|
|
1244
|
+
type: 'object',
|
|
1245
|
+
properties: {
|
|
1246
|
+
url: { type: 'string' }
|
|
1247
|
+
}
|
|
1248
|
+
}
|
|
1249
|
+
},
|
|
1250
|
+
{
|
|
1251
|
+
name: 'video_download_link_finder',
|
|
1252
|
+
description: 'Find direct download links for video files',
|
|
1253
|
+
inputSchema: {
|
|
1254
|
+
type: 'object',
|
|
1255
|
+
properties: {
|
|
1256
|
+
extensions: { type: 'array', items: { type: 'string' } }
|
|
1257
|
+
}
|
|
1258
|
+
}
|
|
1259
|
+
}
|
|
1167
1260
|
];
|
|
1168
1261
|
// Tool name constants for type safety
|
|
1169
1262
|
export const TOOL_NAMES = {
|
|
@@ -1191,6 +1284,19 @@ export const TOOL_NAMES = {
|
|
|
1191
1284
|
// Content Type Specific
|
|
1192
1285
|
LINK_HARVESTER: 'link_harvester',
|
|
1193
1286
|
MEDIA_EXTRACTOR: 'media_extractor',
|
|
1287
|
+
// DOM & HTML Extraction (Phase 1)
|
|
1288
|
+
HTML_ELEMENTS_EXTRACTOR: 'html_elements_extractor',
|
|
1289
|
+
TAGS_FINDER: 'tags_finder',
|
|
1290
|
+
LINKS_FINDER: 'links_finder',
|
|
1291
|
+
XPATH_LINKS: 'xpath_links',
|
|
1292
|
+
SHADOW_DOM_EXTRACTOR: 'shadow_dom_extractor',
|
|
1293
|
+
IFRAME_EXTRACTOR: 'iframe_extractor',
|
|
1294
|
+
EMBED_PAGE_EXTRACTOR: 'embed_page_extractor',
|
|
1295
|
+
// Network Tools (Phase 1)
|
|
1296
|
+
AJAX_EXTRACTOR: 'ajax_extractor',
|
|
1297
|
+
FETCH_XHR: 'fetch_xhr',
|
|
1298
|
+
NETWORK_RECORDER: 'network_recorder',
|
|
1299
|
+
API_FINDER: 'api_finder',
|
|
1194
1300
|
// Pagination Tools
|
|
1195
1301
|
MULTI_PAGE_SCRAPER: 'multi_page_scraper',
|
|
1196
1302
|
BREADCRUMB_NAVIGATOR: 'breadcrumb_navigator',
|
|
@@ -1200,6 +1306,15 @@ export const TOOL_NAMES = {
|
|
|
1200
1306
|
// AI-Powered Features
|
|
1201
1307
|
SMART_SELECTOR_GENERATOR: 'smart_selector_generator',
|
|
1202
1308
|
CONTENT_CLASSIFICATION: 'content_classification',
|
|
1309
|
+
SENTIMENT_ANALYSIS: 'sentiment_analysis',
|
|
1310
|
+
SUMMARY_GENERATOR: 'summary_generator',
|
|
1311
|
+
TRANSLATION_SUPPORT: 'translation_support',
|
|
1312
|
+
// Phase 3: Media & Video
|
|
1313
|
+
VIDEO_SOURCE_EXTRACTOR: 'video_source_extractor',
|
|
1314
|
+
VIDEO_PLAYER_FINDER: 'video_player_finder',
|
|
1315
|
+
STREAM_DETECTOR: 'stream_detector',
|
|
1316
|
+
REDIRECT_TRACER: 'redirect_tracer',
|
|
1317
|
+
VIDEO_DOWNLOAD_LINK_FINDER: 'video_download_link_finder',
|
|
1203
1318
|
// Search & Filter Tools
|
|
1204
1319
|
KEYWORD_SEARCH: 'keyword_search',
|
|
1205
1320
|
REGEX_PATTERN_MATCHER: 'regex_pattern_matcher',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "brave-real-browser-mcp-server",
|
|
3
|
-
"version": "2.14.
|
|
3
|
+
"version": "2.14.11",
|
|
4
4
|
"description": "Universal AI IDE MCP Server - Auto-detects and supports all AI IDEs (Claude Desktop, Cursor, Windsurf, Cline, Zed, VSCode, Qoder AI, etc.) with Brave browser automation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|