@intangle/mcp-server 1.0.5 → 1.0.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/dist/index.js +37 -1
- package/index.ts +40 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -20,6 +20,36 @@ if (!MCP_API_KEY) {
|
|
|
20
20
|
process.exit(1);
|
|
21
21
|
}
|
|
22
22
|
console.log("Intangle MCP Server starting - connecting to", API_BASE_URL);
|
|
23
|
+
// Version checking
|
|
24
|
+
// IMPORTANT: Update BOTH package.json version AND this constant when bumping version
|
|
25
|
+
const CURRENT_VERSION = "1.0.6";
|
|
26
|
+
let latestVersion = null;
|
|
27
|
+
let versionCheckDone = false;
|
|
28
|
+
async function checkVersion() {
|
|
29
|
+
if (versionCheckDone)
|
|
30
|
+
return;
|
|
31
|
+
try {
|
|
32
|
+
const response = await fetch("https://registry.npmjs.org/@intangle/mcp-server/latest");
|
|
33
|
+
const data = await response.json();
|
|
34
|
+
latestVersion = data.version;
|
|
35
|
+
versionCheckDone = true;
|
|
36
|
+
if (latestVersion && latestVersion !== CURRENT_VERSION) {
|
|
37
|
+
console.warn("\n⚠️ UPDATE AVAILABLE ⚠️");
|
|
38
|
+
console.warn(`Current version: ${CURRENT_VERSION}`);
|
|
39
|
+
console.warn(`Latest version: ${latestVersion}`);
|
|
40
|
+
console.warn("Update with: npx @intangle/mcp-server@latest\n");
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
console.log(`✓ Running latest version (${CURRENT_VERSION})`);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
// Silently fail version check - don't block startup
|
|
48
|
+
versionCheckDone = true;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
// Check version on startup (non-blocking)
|
|
52
|
+
checkVersion();
|
|
23
53
|
async function makeApiCall(endpoint, data) {
|
|
24
54
|
const response = await fetch(`${API_BASE_URL}/api/mcp/${endpoint}`, {
|
|
25
55
|
method: "POST",
|
|
@@ -452,8 +482,14 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
452
482
|
default:
|
|
453
483
|
throw new McpError(ErrorCode.MethodNotFound, `Unknown tool: ${name}`);
|
|
454
484
|
}
|
|
485
|
+
// Add version warning to response if outdated
|
|
486
|
+
let responseText = JSON.stringify(result, null, 2);
|
|
487
|
+
if (latestVersion && latestVersion !== CURRENT_VERSION) {
|
|
488
|
+
const warning = `\n\n⚠️ UPDATE AVAILABLE: MCP Server v${latestVersion} is available (you're on v${CURRENT_VERSION}). Update with: npx @intangle/mcp-server@latest`;
|
|
489
|
+
responseText += warning;
|
|
490
|
+
}
|
|
455
491
|
return {
|
|
456
|
-
content: [{ type: "text", text:
|
|
492
|
+
content: [{ type: "text", text: responseText }],
|
|
457
493
|
};
|
|
458
494
|
}
|
|
459
495
|
catch (error) {
|
package/index.ts
CHANGED
|
@@ -33,6 +33,38 @@ if (!MCP_API_KEY) {
|
|
|
33
33
|
|
|
34
34
|
console.log("Intangle MCP Server starting - connecting to", API_BASE_URL);
|
|
35
35
|
|
|
36
|
+
// Version checking
|
|
37
|
+
// IMPORTANT: Update BOTH package.json version AND this constant when bumping version
|
|
38
|
+
const CURRENT_VERSION = "1.0.6";
|
|
39
|
+
let latestVersion: string | null = null;
|
|
40
|
+
let versionCheckDone = false;
|
|
41
|
+
|
|
42
|
+
async function checkVersion() {
|
|
43
|
+
if (versionCheckDone) return;
|
|
44
|
+
|
|
45
|
+
try {
|
|
46
|
+
const response = await fetch("https://registry.npmjs.org/@intangle/mcp-server/latest");
|
|
47
|
+
const data = await response.json() as { version: string };
|
|
48
|
+
latestVersion = data.version;
|
|
49
|
+
versionCheckDone = true;
|
|
50
|
+
|
|
51
|
+
if (latestVersion && latestVersion !== CURRENT_VERSION) {
|
|
52
|
+
console.warn("\n⚠️ UPDATE AVAILABLE ⚠️");
|
|
53
|
+
console.warn(`Current version: ${CURRENT_VERSION}`);
|
|
54
|
+
console.warn(`Latest version: ${latestVersion}`);
|
|
55
|
+
console.warn("Update with: npx @intangle/mcp-server@latest\n");
|
|
56
|
+
} else {
|
|
57
|
+
console.log(`✓ Running latest version (${CURRENT_VERSION})`);
|
|
58
|
+
}
|
|
59
|
+
} catch (error) {
|
|
60
|
+
// Silently fail version check - don't block startup
|
|
61
|
+
versionCheckDone = true;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// Check version on startup (non-blocking)
|
|
66
|
+
checkVersion();
|
|
67
|
+
|
|
36
68
|
async function makeApiCall(endpoint: string, data: any) {
|
|
37
69
|
const response = await fetch(`${API_BASE_URL}/api/mcp/${endpoint}`, {
|
|
38
70
|
method: "POST",
|
|
@@ -543,8 +575,15 @@ server.setRequestHandler(CallToolRequestSchema, async (request: any) => {
|
|
|
543
575
|
throw new McpError(ErrorCode.MethodNotFound, `Unknown tool: ${name}`);
|
|
544
576
|
}
|
|
545
577
|
|
|
578
|
+
// Add version warning to response if outdated
|
|
579
|
+
let responseText = JSON.stringify(result, null, 2);
|
|
580
|
+
if (latestVersion && latestVersion !== CURRENT_VERSION) {
|
|
581
|
+
const warning = `\n\n⚠️ UPDATE AVAILABLE: MCP Server v${latestVersion} is available (you're on v${CURRENT_VERSION}). Update with: npx @intangle/mcp-server@latest`;
|
|
582
|
+
responseText += warning;
|
|
583
|
+
}
|
|
584
|
+
|
|
546
585
|
return {
|
|
547
|
-
content: [{ type: "text", text:
|
|
586
|
+
content: [{ type: "text", text: responseText }],
|
|
548
587
|
};
|
|
549
588
|
} catch (error) {
|
|
550
589
|
throw new McpError(
|