@mixio-pro/kalaasetu-mcp 2.2.10-exp → 2.2.13-exp
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/src/index.ts +1 -1
- package/src/utils/remote-config.ts +18 -9
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -98,7 +98,7 @@ async function main() {
|
|
|
98
98
|
|
|
99
99
|
// 6. Add Version Tool
|
|
100
100
|
server.addTool({
|
|
101
|
-
name: "
|
|
101
|
+
name: "get_version_" + process.env.CLIENT_ID,
|
|
102
102
|
description: "Get the current version of the Kalaasetu MCP server",
|
|
103
103
|
parameters: z.object({}),
|
|
104
104
|
execute: async () => {
|
|
@@ -20,6 +20,14 @@ function decodeJwt(token: string): any {
|
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
+
/**
|
|
24
|
+
* Strips surrounding quotes from string values properly.
|
|
25
|
+
*/
|
|
26
|
+
function cleanEnvVar(val: string | undefined): string | undefined {
|
|
27
|
+
if (!val) return val;
|
|
28
|
+
return val.trim().replace(/^(['"])(.*)\1$/, "$2");
|
|
29
|
+
}
|
|
30
|
+
|
|
23
31
|
/**
|
|
24
32
|
* Loads remote configuration from config.mixio.pro and injects into process.env
|
|
25
33
|
*/
|
|
@@ -28,11 +36,11 @@ export async function loadRemoteConfig() {
|
|
|
28
36
|
logger.info("📡 Checking for remote config...");
|
|
29
37
|
|
|
30
38
|
// 1. Get JWT and Scoping from environment or .env.local in VSCODE_CWD
|
|
31
|
-
let token = (
|
|
32
|
-
process.env.MIXIO_TOKEN || process.env.MIXIO_CONFIG_JWT
|
|
33
|
-
)
|
|
34
|
-
let clientId = process.env.CLIENT_ID
|
|
35
|
-
let projectId = process.env.PROJECT_ID
|
|
39
|
+
let token = cleanEnvVar(
|
|
40
|
+
process.env.MIXIO_TOKEN || process.env.MIXIO_CONFIG_JWT,
|
|
41
|
+
);
|
|
42
|
+
let clientId = cleanEnvVar(process.env.CLIENT_ID);
|
|
43
|
+
let projectId = cleanEnvVar(process.env.PROJECT_ID);
|
|
36
44
|
|
|
37
45
|
const cwd = process.env.VSCODE_CWD || process.cwd();
|
|
38
46
|
if (cwd) {
|
|
@@ -51,10 +59,11 @@ export async function loadRemoteConfig() {
|
|
|
51
59
|
|
|
52
60
|
// Re-evaluate variables after loading from file
|
|
53
61
|
token =
|
|
54
|
-
(
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
62
|
+
cleanEnvVar(
|
|
63
|
+
process.env.MIXIO_TOKEN || process.env.MIXIO_CONFIG_JWT,
|
|
64
|
+
) || token;
|
|
65
|
+
clientId = cleanEnvVar(process.env.CLIENT_ID) || clientId;
|
|
66
|
+
projectId = cleanEnvVar(process.env.PROJECT_ID) || projectId;
|
|
58
67
|
|
|
59
68
|
logger.info(`🔑 Loaded environment details from ${targetPath}`);
|
|
60
69
|
} catch (err) {
|