@softtechai/quickmcp 1.0.12 → 1.0.14
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/package.json +1 -1
- package/quickmcp-direct-stdio.js +2 -39
package/package.json
CHANGED
package/quickmcp-direct-stdio.js
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
const path = require('path');
|
|
4
|
-
const fs = require('fs');
|
|
5
|
-
const os = require('os');
|
|
6
|
-
const net = require('net');
|
|
7
4
|
|
|
8
5
|
// Use the current working directory provided by the caller.
|
|
9
6
|
// Do not change directories; keep paths relative to this script.
|
|
@@ -44,42 +41,8 @@ const sqliteManager = new SQLiteManager();
|
|
|
44
41
|
if (process.env.QUICKMCP_ENABLE_WEB === '1') {
|
|
45
42
|
try {
|
|
46
43
|
console.error('[QuickMCP] QUICKMCP_ENABLE_WEB=1 -> starting Web UI server...');
|
|
47
|
-
//
|
|
48
|
-
|
|
49
|
-
try { fs.accessSync(dir, fs.constants.W_OK); return true; } catch { return false; }
|
|
50
|
-
};
|
|
51
|
-
let runDir = process.cwd();
|
|
52
|
-
if (runDir === '/' || !canWrite(runDir)) {
|
|
53
|
-
const home = os.homedir() || os.tmpdir();
|
|
54
|
-
runDir = path.join(home, '.quickmcp');
|
|
55
|
-
try { fs.mkdirSync(runDir, { recursive: true }); } catch {}
|
|
56
|
-
try { process.chdir(runDir); } catch {}
|
|
57
|
-
}
|
|
58
|
-
// Prepare uploads directory and expose as env for newer builds
|
|
59
|
-
const uploadsDir = path.join(runDir, 'uploads');
|
|
60
|
-
try { fs.mkdirSync(uploadsDir, { recursive: true }); } catch {}
|
|
61
|
-
if (!process.env.QUICKMCP_UPLOAD_DIR) process.env.QUICKMCP_UPLOAD_DIR = uploadsDir;
|
|
62
|
-
// Only start Web UI if preferred port is actually free.
|
|
63
|
-
const preferredPort = parseInt(process.env.PORT || '3000', 10);
|
|
64
|
-
const probe = net.createServer();
|
|
65
|
-
probe.once('error', (err) => {
|
|
66
|
-
if (err && (err.code === 'EADDRINUSE' || err.code === 'EACCES')) {
|
|
67
|
-
// Port is busy or not permitted; skip starting Web UI to avoid crashing Claude session
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
// For other errors, still try starting server; better to attempt than silently skip for unknown cases
|
|
71
|
-
try { require('./dist/web/server.js'); } catch (e) { console.error('[QuickMCP] Failed to start Web UI:', e && e.message); }
|
|
72
|
-
});
|
|
73
|
-
probe.once('listening', () => {
|
|
74
|
-
probe.close(() => {
|
|
75
|
-
try { require('./dist/web/server.js'); } catch (e) { console.error('[QuickMCP] Failed to start Web UI:', e && e.message); }
|
|
76
|
-
});
|
|
77
|
-
});
|
|
78
|
-
try {
|
|
79
|
-
probe.listen(preferredPort, '127.0.0.1');
|
|
80
|
-
} catch (_e) {
|
|
81
|
-
// If probing throws synchronously (rare), just skip UI
|
|
82
|
-
}
|
|
44
|
+
// This require starts the Express app and integrated MCP sidecar
|
|
45
|
+
require('./dist/web/server.js');
|
|
83
46
|
} catch (e) {
|
|
84
47
|
console.error('[QuickMCP] Failed to start Web UI:', e && e.message);
|
|
85
48
|
}
|