@softtechai/quickmcp 1.1.5 → 1.1.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.
- package/package.json +1 -1
- package/quickmcp-direct-stdio.js +21 -5
package/package.json
CHANGED
package/quickmcp-direct-stdio.js
CHANGED
|
@@ -4,6 +4,8 @@ const path = require('path');
|
|
|
4
4
|
const fs = require('fs');
|
|
5
5
|
const os = require('os');
|
|
6
6
|
const net = require('net');
|
|
7
|
+
const normalizedScriptDir = String(__dirname || '').split(path.sep).join('/');
|
|
8
|
+
const isNpxRuntime = normalizedScriptDir.includes('/.npm/_npx/');
|
|
7
9
|
let dotenv = null;
|
|
8
10
|
try {
|
|
9
11
|
dotenv = require('dotenv');
|
|
@@ -18,8 +20,6 @@ if (dotenv) {
|
|
|
18
20
|
// 2) If running via npx: only package defaults
|
|
19
21
|
// 3) Otherwise (local/dev): local .env, package .env, then package defaults
|
|
20
22
|
const explicitEnvPath = process.env.DOTENV_CONFIG_PATH || process.env.QUICKMCP_ENV_FILE;
|
|
21
|
-
const normalizedDir = String(__dirname || '').split(path.sep).join('/');
|
|
22
|
-
const isNpxRuntime = normalizedDir.includes('/.npm/_npx/');
|
|
23
23
|
|
|
24
24
|
if (explicitEnvPath) {
|
|
25
25
|
dotenv.config({ path: explicitEnvPath });
|
|
@@ -27,12 +27,10 @@ if (dotenv) {
|
|
|
27
27
|
|
|
28
28
|
if (isNpxRuntime) {
|
|
29
29
|
dotenv.config({ path: path.join(__dirname, '.env.onprem.defaults') });
|
|
30
|
-
//dotenv.config({ path: path.join(__dirname, '.env.defaults') }); // backward-compat fallback
|
|
31
30
|
} else {
|
|
32
31
|
dotenv.config({ path: path.join(process.cwd(), '.env') });
|
|
33
32
|
dotenv.config({ path: path.join(__dirname, '.env') });
|
|
34
|
-
|
|
35
|
-
//dotenv.config({ path: path.join(__dirname, '.env.defaults') }); // backward-compat fallback
|
|
33
|
+
dotenv.config({ path: path.join(__dirname, '.env.onprem.defaults') });
|
|
36
34
|
}
|
|
37
35
|
}
|
|
38
36
|
|
|
@@ -122,6 +120,9 @@ if (dataDirArg) {
|
|
|
122
120
|
const val = dataDirArg.split('=')[1];
|
|
123
121
|
if (val) process.env.QUICKMCP_DATA_DIR = val;
|
|
124
122
|
}
|
|
123
|
+
if (!process.env.QUICKMCP_DATA_DIR && isNpxRuntime) {
|
|
124
|
+
process.env.QUICKMCP_DATA_DIR = path.join(os.homedir() || os.tmpdir(), '.quickmcp', 'data');
|
|
125
|
+
}
|
|
125
126
|
|
|
126
127
|
const dataStore = safeCreateDataStore({ logger: (...args) => logger.error(...args) });
|
|
127
128
|
const executor = new DynamicMCPExecutor();
|
|
@@ -129,6 +130,18 @@ const executor = new DynamicMCPExecutor();
|
|
|
129
130
|
const mcpAuthMode = resolveAuthMode();
|
|
130
131
|
const mcpTokenSecret = process.env.QUICKMCP_TOKEN_SECRET || process.env.AUTH_COOKIE_SECRET || 'change-me';
|
|
131
132
|
const mcpToken = (process.env.QUICKMCP_TOKEN || '').trim();
|
|
133
|
+
const sqlitePath = (() => {
|
|
134
|
+
try {
|
|
135
|
+
if (!dataStore || typeof dataStore !== 'object') return '';
|
|
136
|
+
const directPath = dataStore.dbPath;
|
|
137
|
+
if (typeof directPath === 'string' && directPath.trim()) return directPath.trim();
|
|
138
|
+
const dbNamePath = dataStore.db && typeof dataStore.db.name === 'string' ? dataStore.db.name : '';
|
|
139
|
+
if (dbNamePath && dbNamePath.trim()) return dbNamePath.trim();
|
|
140
|
+
return '';
|
|
141
|
+
} catch (_) {
|
|
142
|
+
return '';
|
|
143
|
+
}
|
|
144
|
+
})();
|
|
132
145
|
let startupAuthError = null;
|
|
133
146
|
let mcpCore;
|
|
134
147
|
try {
|
|
@@ -152,6 +165,9 @@ try {
|
|
|
152
165
|
|
|
153
166
|
logger.error(`[QuickMCP] MCP auth mode: ${mcpAuthMode}`);
|
|
154
167
|
logger.error(`[QuickMCP] MCP token present: ${mcpToken ? 'yes' : 'no'}`);
|
|
168
|
+
if (mcpAuthMode === 'LITE') {
|
|
169
|
+
logger.error(`[QuickMCP] SQLite path: ${sqlitePath || '(unavailable)'}`);
|
|
170
|
+
}
|
|
155
171
|
if (startupAuthError) {
|
|
156
172
|
logger.error('[QuickMCP] Provided MCP token is invalid/revoked/expired for current workspace.');
|
|
157
173
|
}
|