brave-real-browser-mcp-server 2.8.6 → 2.8.7

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.
@@ -88,27 +88,31 @@ export async function handleRESTAPIEndpointFinder(args) {
88
88
  });
89
89
  return apis;
90
90
  });
91
+ let summary = `REST API Discovery Results:\n\nSummary:\n- Total APIs Found: ${apiEndpoints.length + discoveredAPIs.length}\n- Network APIs: ${apiEndpoints.length}\n- Discovered in Content: ${discoveredAPIs.length}`;
92
+ if (apiEndpoints.length > 0) {
93
+ summary += `\n\nNetwork API Endpoints (Top 10):\n${apiEndpoints.slice(0, 10).map((ep, i) => `${i + 1}. ${ep.method} ${ep.url}\n Type: ${ep.resourceType}${ep.hasBody ? ' (with body)' : ''}`).join('\n')}`;
94
+ }
95
+ if (discoveredAPIs.length > 0) {
96
+ summary += `\n\nDiscovered APIs (Top 10):\n${discoveredAPIs.slice(0, 10).map((api, i) => `${i + 1}. ${api.url}\n Source: ${api.source}`).join('\n')}`;
97
+ }
91
98
  return {
92
- success: true,
93
- networkRequests: {
94
- count: apiEndpoints.length,
95
- endpoints: apiEndpoints
96
- },
97
- discoveredInContent: {
98
- count: discoveredAPIs.length,
99
- endpoints: discoveredAPIs.slice(0, 20) // Limit to 20
100
- },
101
- summary: {
102
- totalFound: apiEndpoints.length + discoveredAPIs.length,
103
- uniqueNetworkAPIs: apiEndpoints.length,
104
- discoveredAPIs: discoveredAPIs.length
105
- }
99
+ content: [
100
+ {
101
+ type: "text",
102
+ text: summary
103
+ }
104
+ ]
106
105
  };
107
106
  }
108
107
  catch (error) {
109
108
  return {
110
- success: false,
111
- error: error.message
109
+ content: [
110
+ {
111
+ type: "text",
112
+ text: `REST API Endpoint Finder Error: ${error.message}`
113
+ }
114
+ ],
115
+ isError: true
112
116
  };
113
117
  }
114
118
  }
@@ -138,48 +142,47 @@ export async function handleWebhookSupport(args) {
138
142
  timeout: 10000
139
143
  });
140
144
  return {
141
- success: true,
142
- webhookUrl,
143
- method,
144
- testMode: true,
145
- response: {
146
- status: response.status,
147
- statusText: response.statusText,
148
- headers: response.headers,
149
- data: response.data
150
- }
145
+ content: [
146
+ {
147
+ type: "text",
148
+ text: `Webhook Test Successful:\n- URL: ${webhookUrl}\n- Method: ${method}\n- Status: ${response.status} ${response.statusText}\n- Response Headers: ${JSON.stringify(response.headers, null, 2)}\n- Response Data: ${JSON.stringify(response.data, null, 2)}`
149
+ }
150
+ ]
151
151
  };
152
152
  }
153
153
  catch (webhookError) {
154
154
  return {
155
- success: false,
156
- webhookUrl,
157
- testMode: true,
158
- error: webhookError.message,
159
- details: {
160
- status: webhookError.response?.status,
161
- statusText: webhookError.response?.statusText,
162
- data: webhookError.response?.data
163
- }
155
+ content: [
156
+ {
157
+ type: "text",
158
+ text: `Webhook Test Failed:\n- URL: ${webhookUrl}\n- Error: ${webhookError.message}${webhookError.response ? `\n- Status: ${webhookError.response.status} ${webhookError.response.statusText}\n- Response: ${JSON.stringify(webhookError.response.data, null, 2)}` : ''}`
159
+ }
160
+ ],
161
+ isError: true
164
162
  };
165
163
  }
166
164
  }
167
165
  else {
168
166
  // Production mode - set up webhook listener
169
167
  return {
170
- success: true,
171
- webhookUrl,
172
- method,
173
- testMode: false,
174
- status: 'configured',
175
- note: 'Webhook configured. Send data using separate call or integrate with scraping workflow'
168
+ content: [
169
+ {
170
+ type: "text",
171
+ text: `Webhook Configured:\n- URL: ${webhookUrl}\n- Method: ${method}\n- Test Mode: No\n- Status: Configured\n\nNote: Webhook configured. Send data using separate call or integrate with scraping workflow`
172
+ }
173
+ ]
176
174
  };
177
175
  }
178
176
  }
179
177
  catch (error) {
180
178
  return {
181
- success: false,
182
- error: error.message
179
+ content: [
180
+ {
181
+ type: "text",
182
+ text: `Webhook Support Error: ${error.message}`
183
+ }
184
+ ],
185
+ isError: true
183
186
  };
184
187
  }
185
188
  }
@@ -291,24 +294,41 @@ export async function handleAllWebsiteAPIFinder(args) {
291
294
  }, deepScan, includeExternal);
292
295
  // Deduplicate APIs
293
296
  const uniqueAPIs = [...new Set(apiDiscovery.apis.map((api) => api.url))];
297
+ const restFound = apiDiscovery.rest.filter((r) => r.found).length;
298
+ let summary = `Comprehensive API Discovery:\n\nSummary:\n- Total Unique APIs: ${uniqueAPIs.length}\n- GraphQL Detected: ${apiDiscovery.graphql.length > 0 ? 'Yes' : 'No'}\n- REST Endpoints: ${restFound}\n- WebSockets: ${apiDiscovery.websockets.length}\n- Documentation Links: ${apiDiscovery.documentationLinks?.length || 0}`;
299
+ if (apiDiscovery.graphql.length > 0) {
300
+ summary += `\n\nGraphQL:\n- Indicators Found: ${apiDiscovery.graphql[0].indicators}\n- Possible Endpoints: ${apiDiscovery.graphql[0].possibleEndpoints.join(', ')}`;
301
+ }
302
+ if (uniqueAPIs.length > 0) {
303
+ summary += `\n\nUnique APIs (Top 10):\n${uniqueAPIs.slice(0, 10).map((api, i) => `${i + 1}. ${api}`).join('\n')}`;
304
+ }
305
+ if (apiDiscovery.websockets.length > 0) {
306
+ summary += `\n\nWebSockets:\n${apiDiscovery.websockets.map((ws, i) => `${i + 1}. ${ws.url} (${ws.protocol})`).join('\n')}`;
307
+ }
308
+ if (apiDiscovery.documentationLinks?.length > 0) {
309
+ summary += `\n\nDocumentation Links:\n${apiDiscovery.documentationLinks.slice(0, 5).map((link, i) => `${i + 1}. ${link.text}: ${link.href}`).join('\n')}`;
310
+ }
311
+ if (apiDiscovery.swagger?.length > 0) {
312
+ summary += `\n\nSwagger/OpenAPI:\n${apiDiscovery.swagger.map((s, i) => `${i + 1}. ${s.href}`).join('\n')}`;
313
+ }
294
314
  return {
295
- success: true,
296
- summary: {
297
- totalAPIsFound: uniqueAPIs.length,
298
- graphqlDetected: apiDiscovery.graphql.length > 0,
299
- restEndpointsFound: apiDiscovery.rest.filter((r) => r.found).length,
300
- websocketsFound: apiDiscovery.websockets.length,
301
- documentationLinks: apiDiscovery.documentationLinks?.length || 0
302
- },
303
- details: apiDiscovery,
304
- uniqueAPIs: uniqueAPIs.slice(0, 20),
305
- recommendations: []
315
+ content: [
316
+ {
317
+ type: "text",
318
+ text: summary
319
+ }
320
+ ]
306
321
  };
307
322
  }
308
323
  catch (error) {
309
324
  return {
310
- success: false,
311
- error: error.message
325
+ content: [
326
+ {
327
+ type: "text",
328
+ text: `All Website API Finder Error: ${error.message}`
329
+ }
330
+ ],
331
+ isError: true
312
332
  };
313
333
  }
314
334
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "brave-real-browser-mcp-server",
3
- "version": "2.8.6",
3
+ "version": "2.8.7",
4
4
  "description": "MCP server for brave-real-browser",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",