@softtechai/quickmcp 1.1.3 → 1.1.6
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/.env.onprem.defaults +5 -0
- package/package.json +2 -1
- package/quickmcp-direct-stdio.js +38 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@softtechai/quickmcp",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.6",
|
|
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": {
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
"files": [
|
|
22
22
|
"dist",
|
|
23
23
|
"quickmcp-direct-stdio.js",
|
|
24
|
+
".env.onprem.defaults",
|
|
24
25
|
"src/web/public",
|
|
25
26
|
"README.md",
|
|
26
27
|
"LICENSE"
|
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');
|
|
@@ -12,10 +14,24 @@ try {
|
|
|
12
14
|
}
|
|
13
15
|
|
|
14
16
|
if (dotenv) {
|
|
15
|
-
//
|
|
16
|
-
//
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
// `dotenv` does not override existing process.env values.
|
|
18
|
+
// Priority:
|
|
19
|
+
// 1) Explicit path (DOTENV_CONFIG_PATH / QUICKMCP_ENV_FILE)
|
|
20
|
+
// 2) If running via npx: only package defaults
|
|
21
|
+
// 3) Otherwise (local/dev): local .env, package .env, then package defaults
|
|
22
|
+
const explicitEnvPath = process.env.DOTENV_CONFIG_PATH || process.env.QUICKMCP_ENV_FILE;
|
|
23
|
+
|
|
24
|
+
if (explicitEnvPath) {
|
|
25
|
+
dotenv.config({ path: explicitEnvPath });
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
if (isNpxRuntime) {
|
|
29
|
+
dotenv.config({ path: path.join(__dirname, '.env.onprem.defaults') });
|
|
30
|
+
} else {
|
|
31
|
+
dotenv.config({ path: path.join(process.cwd(), '.env') });
|
|
32
|
+
dotenv.config({ path: path.join(__dirname, '.env') });
|
|
33
|
+
dotenv.config({ path: path.join(__dirname, '.env.onprem.defaults') });
|
|
34
|
+
}
|
|
19
35
|
}
|
|
20
36
|
|
|
21
37
|
let logger;
|
|
@@ -104,6 +120,9 @@ if (dataDirArg) {
|
|
|
104
120
|
const val = dataDirArg.split('=')[1];
|
|
105
121
|
if (val) process.env.QUICKMCP_DATA_DIR = val;
|
|
106
122
|
}
|
|
123
|
+
if (!process.env.QUICKMCP_DATA_DIR && isNpxRuntime) {
|
|
124
|
+
process.env.QUICKMCP_DATA_DIR = path.join(os.homedir() || os.tmpdir(), '.quickmcp', 'data');
|
|
125
|
+
}
|
|
107
126
|
|
|
108
127
|
const dataStore = safeCreateDataStore({ logger: (...args) => logger.error(...args) });
|
|
109
128
|
const executor = new DynamicMCPExecutor();
|
|
@@ -111,6 +130,18 @@ const executor = new DynamicMCPExecutor();
|
|
|
111
130
|
const mcpAuthMode = resolveAuthMode();
|
|
112
131
|
const mcpTokenSecret = process.env.QUICKMCP_TOKEN_SECRET || process.env.AUTH_COOKIE_SECRET || 'change-me';
|
|
113
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
|
+
})();
|
|
114
145
|
let startupAuthError = null;
|
|
115
146
|
let mcpCore;
|
|
116
147
|
try {
|
|
@@ -134,6 +165,9 @@ try {
|
|
|
134
165
|
|
|
135
166
|
logger.error(`[QuickMCP] MCP auth mode: ${mcpAuthMode}`);
|
|
136
167
|
logger.error(`[QuickMCP] MCP token present: ${mcpToken ? 'yes' : 'no'}`);
|
|
168
|
+
if (mcpAuthMode === 'LITE') {
|
|
169
|
+
logger.error(`[QuickMCP] SQLite path: ${sqlitePath || '(unavailable)'}`);
|
|
170
|
+
}
|
|
137
171
|
if (startupAuthError) {
|
|
138
172
|
logger.error('[QuickMCP] Provided MCP token is invalid/revoked/expired for current workspace.');
|
|
139
173
|
}
|