@softtechai/quickmcp 1.0.9 → 1.0.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@softtechai/quickmcp",
3
- "version": "1.0.9",
3
+ "version": "1.0.11",
4
4
  "description": "An application to generate MCP servers from various data sources and test them",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -1,6 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  const path = require('path');
4
+ const fs = require('fs');
5
+ const os = require('os');
4
6
 
5
7
  // Use the current working directory provided by the caller.
6
8
  // Do not change directories; keep paths relative to this script.
@@ -41,6 +43,21 @@ const sqliteManager = new SQLiteManager();
41
43
  if (process.env.QUICKMCP_ENABLE_WEB === '1') {
42
44
  try {
43
45
  console.error('[QuickMCP] QUICKMCP_ENABLE_WEB=1 -> starting Web UI server...');
46
+ // Ensure we run from a writable directory when invoked via npx (CWD may be '/')
47
+ const canWrite = (dir) => {
48
+ try { fs.accessSync(dir, fs.constants.W_OK); return true; } catch { return false; }
49
+ };
50
+ let runDir = process.cwd();
51
+ if (runDir === '/' || !canWrite(runDir)) {
52
+ const home = os.homedir() || os.tmpdir();
53
+ runDir = path.join(home, '.quickmcp');
54
+ try { fs.mkdirSync(runDir, { recursive: true }); } catch {}
55
+ try { process.chdir(runDir); } catch {}
56
+ }
57
+ // Prepare uploads directory and expose as env for newer builds
58
+ const uploadsDir = path.join(runDir, 'uploads');
59
+ try { fs.mkdirSync(uploadsDir, { recursive: true }); } catch {}
60
+ if (!process.env.QUICKMCP_UPLOAD_DIR) process.env.QUICKMCP_UPLOAD_DIR = uploadsDir;
44
61
  // This require starts the Express app and integrated MCP sidecar
45
62
  require('./dist/web/server.js');
46
63
  } catch (e) {