mcp-web-engine 1.0.0 → 1.0.1

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.
Files changed (2) hide show
  1. package/bin/cli.js +16 -2
  2. package/package.json +1 -1
package/bin/cli.js CHANGED
@@ -1,10 +1,24 @@
1
1
  #!/usr/bin/env node
2
- const { spawn } = require('child_process');
2
+ const { spawn, execSync } = require('child_process');
3
3
  const path = require('path');
4
4
 
5
5
  const mainPy = path.join(__dirname, '..', 'main.py');
6
+ const reqTxt = path.join(__dirname, '..', 'requirements.txt');
6
7
 
7
- const child = spawn('python3', [mainPy, ...process.argv.slice(2)], {
8
+ let pythonCmd = 'python3';
9
+
10
+ try {
11
+ execSync(`${pythonCmd} -c "import fastapi"`, { stdio: 'ignore' });
12
+ } catch (e) {
13
+ try {
14
+ console.log('[mcp-web-engine] Installing Python dependencies (fastapi, uvicorn, etc.)...');
15
+ execSync(`${pythonCmd} -m pip install -r "${reqTxt}" --break-system-packages`, { stdio: 'inherit' });
16
+ } catch (err) {
17
+ // Fallback gracefully
18
+ }
19
+ }
20
+
21
+ const child = spawn(pythonCmd, [mainPy, ...process.argv.slice(2)], {
8
22
  stdio: 'inherit',
9
23
  env: process.env
10
24
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mcp-web-engine",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Privacy-First, Self-Hostable & SSRF-Hardened MCP Server & Web Engine for AI Agents",
5
5
  "main": "bin/cli.js",
6
6
  "bin": {