vplex-memory 2.4.0 → 2.4.2
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/README.md +5 -5
- package/package.json +1 -1
- package/vplex-mcp-server.mjs +47 -4
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@ Works with Claude Code, Cursor, VS Code Copilot, Windsurf, Codex, and any MCP-co
|
|
|
11
11
|
"mcpServers": {
|
|
12
12
|
"vplex-memory": {
|
|
13
13
|
"command": "npx",
|
|
14
|
-
"args": ["-y", "vplex-memory@2.
|
|
14
|
+
"args": ["-y", "vplex-memory@2.4.1"]
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
}
|
|
@@ -30,7 +30,7 @@ Add to `.mcp.json` in your project root or `~/.claude/settings.json` globally:
|
|
|
30
30
|
"mcpServers": {
|
|
31
31
|
"vplex-memory": {
|
|
32
32
|
"command": "npx",
|
|
33
|
-
"args": ["-y", "vplex-memory@2.
|
|
33
|
+
"args": ["-y", "vplex-memory@2.4.1"]
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
}
|
|
@@ -46,7 +46,7 @@ Add to `.cursor/mcp.json`:
|
|
|
46
46
|
"vplex-memory": {
|
|
47
47
|
"type": "stdio",
|
|
48
48
|
"command": "npx",
|
|
49
|
-
"args": ["-y", "vplex-memory@2.
|
|
49
|
+
"args": ["-y", "vplex-memory@2.4.1"]
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
}
|
|
@@ -62,7 +62,7 @@ Add to `.vscode/mcp.json`:
|
|
|
62
62
|
"vplex-memory": {
|
|
63
63
|
"type": "stdio",
|
|
64
64
|
"command": "npx",
|
|
65
|
-
"args": ["-y", "vplex-memory@2.
|
|
65
|
+
"args": ["-y", "vplex-memory@2.4.1"]
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
}
|
|
@@ -78,7 +78,7 @@ Add to `~/.windsurf/mcp.json`:
|
|
|
78
78
|
"vplex-memory": {
|
|
79
79
|
"type": "stdio",
|
|
80
80
|
"command": "npx",
|
|
81
|
-
"args": ["-y", "vplex-memory@2.
|
|
81
|
+
"args": ["-y", "vplex-memory@2.4.1"]
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
}
|
package/package.json
CHANGED
package/vplex-mcp-server.mjs
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
|
|
20
20
|
import { readFileSync, writeFileSync, statSync, mkdirSync, realpathSync, unlinkSync } from "fs";
|
|
21
21
|
import { homedir, platform } from "os";
|
|
22
|
-
import { join, resolve, relative } from "path";
|
|
22
|
+
import { join, resolve, relative, dirname, parse } from "path";
|
|
23
23
|
import { createInterface } from "readline";
|
|
24
24
|
|
|
25
25
|
const API_URL = "https://termplex-api.vercel.app";
|
|
@@ -411,9 +411,34 @@ function hashString(str) {
|
|
|
411
411
|
return Math.abs(hash).toString(36);
|
|
412
412
|
}
|
|
413
413
|
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
414
|
+
// Detect project root: env override > .git traversal > cwd fallback
|
|
415
|
+
function detectProjectRoot() {
|
|
416
|
+
// Explicit override via env (set in MCP config)
|
|
417
|
+
const envPath = process.env.VPLEX_PROJECT_PATH || process.env.PROJECT_CWD;
|
|
418
|
+
if (envPath) {
|
|
419
|
+
try { statSync(envPath); return envPath; } catch { /* fall through */ }
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
// Walk up from cwd looking for .git (standard project root marker)
|
|
423
|
+
let dir = process.cwd();
|
|
424
|
+
const root = parse(dir).root;
|
|
425
|
+
while (dir !== root) {
|
|
426
|
+
try {
|
|
427
|
+
statSync(join(dir, ".git"));
|
|
428
|
+
return dir; // Found .git — this is the project root
|
|
429
|
+
} catch { /* continue */ }
|
|
430
|
+
const parent = dirname(dir);
|
|
431
|
+
if (parent === dir) break;
|
|
432
|
+
dir = parent;
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
return process.cwd();
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
const detectedRoot = detectProjectRoot();
|
|
439
|
+
const projectHash = hashString(detectedRoot);
|
|
440
|
+
const projectName = detectedRoot.replace(/\\/g, "/").split("/").pop() || detectedRoot;
|
|
441
|
+
const projectPath = detectedRoot;
|
|
417
442
|
|
|
418
443
|
// ── HTTP Helper ─────────────────────────────────────────────────────
|
|
419
444
|
|
|
@@ -657,6 +682,11 @@ const TOOLS = [
|
|
|
657
682
|
description: "Check authentication status: whether logged in, token expiry, and user info.",
|
|
658
683
|
inputSchema: { type: "object", properties: {} },
|
|
659
684
|
},
|
|
685
|
+
{
|
|
686
|
+
name: "memory_signin",
|
|
687
|
+
description: "Sign in to VPLEX Memory. Starts the browser-based auth flow and returns a URL + code to enter.",
|
|
688
|
+
inputSchema: { type: "object", properties: {} },
|
|
689
|
+
},
|
|
660
690
|
{
|
|
661
691
|
name: "memory_logout",
|
|
662
692
|
description: "Log out by deleting the cached session. Next tool call will require re-authentication.",
|
|
@@ -1122,6 +1152,19 @@ async function handleToolCall(name, args) {
|
|
|
1122
1152
|
};
|
|
1123
1153
|
}
|
|
1124
1154
|
|
|
1155
|
+
case "memory_signin": {
|
|
1156
|
+
// Check if already authenticated
|
|
1157
|
+
const existingToken = await getToken();
|
|
1158
|
+
if (existingToken) {
|
|
1159
|
+
const session = readSession();
|
|
1160
|
+
const user = session?.user?.email || session?.user?.name || "unknown";
|
|
1161
|
+
return { content: [{ type: "text", text: `Already signed in as ${user}. Use memory_logout first to switch accounts.` }] };
|
|
1162
|
+
}
|
|
1163
|
+
// Start the CLI auth flow
|
|
1164
|
+
const authMessage = await startCliAuthFlow();
|
|
1165
|
+
return { content: [{ type: "text", text: authMessage }] };
|
|
1166
|
+
}
|
|
1167
|
+
|
|
1125
1168
|
case "memory_auth_status": {
|
|
1126
1169
|
const session = readSession();
|
|
1127
1170
|
if (!session?.token) {
|