brave-real-browser-mcp-server 2.19.6 → 2.19.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.
@@ -1,8 +1,41 @@
1
1
  import { connect } from 'brave-real-browser';
2
2
  import * as net from 'net';
3
- import * as dotenv from 'dotenv';
4
- // Load environment variables from .env file
5
- dotenv.config();
3
+ import * as fs from 'fs';
4
+ import * as path from 'path';
5
+ import { fileURLToPath } from 'url';
6
+ // ESM compatibility
7
+ const __filename = fileURLToPath(import.meta.url);
8
+ const __dirname = path.dirname(__filename);
9
+ // Load environment variables from .env file (manually, completely silent)
10
+ function loadEnvFile() {
11
+ const envPaths = [
12
+ path.join(process.cwd(), '.env'),
13
+ path.join(__dirname, '..', '.env'),
14
+ path.join(__dirname, '.env')
15
+ ];
16
+ for (const envPath of envPaths) {
17
+ try {
18
+ if (fs.existsSync(envPath)) {
19
+ const envContent = fs.readFileSync(envPath, 'utf-8');
20
+ envContent.split('\n').forEach(line => {
21
+ const trimmed = line.trim();
22
+ if (trimmed && !trimmed.startsWith('#')) {
23
+ const [key, ...valueParts] = trimmed.split('=');
24
+ const value = valueParts.join('=').replace(/^["']|["']$/g, '');
25
+ if (key && !process.env[key]) {
26
+ process.env[key] = value;
27
+ }
28
+ }
29
+ });
30
+ break;
31
+ }
32
+ }
33
+ catch (error) {
34
+ // Silently ignore .env loading errors
35
+ }
36
+ }
37
+ }
38
+ loadEnvFile();
6
39
  // Browser error categorization
7
40
  export var BrowserErrorType;
8
41
  (function (BrowserErrorType) {
package/dist/index.js CHANGED
@@ -277,11 +277,11 @@ async function main() {
277
277
  debug('Attempting to connect server to transport...');
278
278
  await server.connect(transport);
279
279
  debug('Server connected to transport successfully');
280
- // Startup messages - only in debug mode to avoid MCP protocol interference
281
- debug('🚀 Brave Real Browser MCP Server started successfully');
282
- debug('📋 Available tools:', TOOLS.map(t => t.name).join(', '));
283
- debug('🔧 Workflow validation: Active');
284
- debug('💡 Content priority mode: Enabled (use get_content for better reliability)');
280
+ // Startup messages - visible to user via stderr (MCP protocol allows stderr for logs)
281
+ console.error('🚀 Brave Real Browser MCP Server started successfully');
282
+ console.error('📋 Available tools:', TOOLS.map(t => t.name).join(', '));
283
+ console.error('🔧 Workflow validation: Active');
284
+ console.error('💡 Content priority mode: Enabled (use get_content for better reliability)');
285
285
  debug('Server is now ready and waiting for requests...');
286
286
  // Keep the process alive by maintaining the connection
287
287
  debug('Maintaining process alive - server will wait for requests');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "brave-real-browser-mcp-server",
3
- "version": "2.19.6",
3
+ "version": "2.19.7",
4
4
  "description": "🦁 MCP server for Brave Real Browser - NPM Workspaces Monorepo with anti-detection features",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -39,8 +39,7 @@
39
39
  "dependencies": {
40
40
  "@modelcontextprotocol/sdk": "latest",
41
41
  "@types/turndown": "latest",
42
- "brave-real-browser": "^2.1.6",
43
- "dotenv": "latest",
42
+ "brave-real-browser": "^2.1.7",
44
43
  "turndown": "latest"
45
44
  },
46
45
  "peerDependencies": {