@smartergpt/lex-mcp 2.7.0 → 2.8.0

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.
Files changed (3) hide show
  1. package/README.md +3 -1
  2. package/index.mjs +8 -23
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -55,13 +55,15 @@ echo '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}' | npx @smarter
55
55
 
56
56
  | Variable | Description | Default |
57
57
  |----------|-------------|---------|
58
- | `LEX_WORKSPACE_ROOT` | Workspace root directory | Current directory |
58
+ | `LEX_WORKSPACE_ROOT` | Project root directory (compat env var name) | Current directory |
59
59
  | `LEX_DB_PATH` | SQLite database path (canonical) | `.smartergpt/lex/memory.db` |
60
60
  | `LEX_MEMORY_DB` | Alias for `LEX_DB_PATH` (compat only) | — |
61
61
  | `LEX_DEBUG` | Enable debug logging to stderr | Off |
62
62
 
63
63
  When both `LEX_DB_PATH` and `LEX_MEMORY_DB` are set, `LEX_DB_PATH` wins.
64
64
 
65
+ For multi-root workspaces, set the same absolute `LEX_DB_PATH` for direct Lex, this MCP wrapper, and AXF-routed Lex. The wrapper delegates `.lex.config.json`, environment, and default-store resolution to Lex core, so installed launches now honor caller-project config files. Use `system_introspect` to compare canonical store paths and `path-v1` identities across launch paths.
66
+
65
67
  ## Tools
66
68
 
67
69
  This MCP server provides 14 tools for episodic memory management:
package/index.mjs CHANGED
@@ -9,45 +9,30 @@
9
9
  * npx @smartergpt/lex-mcp
10
10
  *
11
11
  * Environment Variables:
12
- * LEX_WORKSPACE_ROOT - Workspace root directory (default: cwd)
12
+ * LEX_WORKSPACE_ROOT - Project root directory (compat env var name, default: cwd)
13
13
  * LEX_DB_PATH - SQLite database path (default: .smartergpt/lex/memory.db)
14
14
  * LEX_MEMORY_DB - Alias for LEX_DB_PATH (for backwards compatibility)
15
15
  * LEX_DEBUG - Enable debug logging to stderr
16
16
  */
17
17
 
18
18
  import { MCPServer } from "@smartergpt/lex/mcp-server";
19
- import { join, dirname } from "path";
20
- import { mkdirSync } from "fs";
21
19
 
22
- // Workspace root defaults to current working directory
23
- const repoRoot = process.env.LEX_WORKSPACE_ROOT || process.cwd();
20
+ // Project root defaults to current working directory.
21
+ const projectRoot = process.env.LEX_WORKSPACE_ROOT || process.cwd();
24
22
 
25
23
  // Set LEX_WORKSPACE_ROOT for modules that need it
26
24
  if (!process.env.LEX_WORKSPACE_ROOT) {
27
- process.env.LEX_WORKSPACE_ROOT = repoRoot;
28
- }
29
-
30
- // Database path: LEX_DB_PATH (canonical) > LEX_MEMORY_DB (compat alias) > default
31
- // Default matches Lex core: .smartergpt/lex/memory.db
32
- const dbPath =
33
- process.env.LEX_DB_PATH ||
34
- process.env.LEX_MEMORY_DB ||
35
- join(repoRoot, ".smartergpt", "lex", "memory.db");
36
-
37
- // Ensure the database directory exists (first-time setup)
38
- try {
39
- mkdirSync(dirname(dbPath), { recursive: true });
40
- } catch {
41
- // Ignore — directory may already exist or be read-only
25
+ process.env.LEX_WORKSPACE_ROOT = projectRoot;
42
26
  }
43
27
 
44
28
  // Initialize MCP server
45
29
  let mcpServer;
46
30
  try {
47
- mcpServer = new MCPServer(dbPath, repoRoot);
31
+ // Lex core owns env, .lex.config.json, and default-path precedence. Passing
32
+ // only the caller root prevents the delivery wrapper from masking config.
33
+ mcpServer = new MCPServer({ repoRoot: projectRoot });
48
34
  if (process.env.LEX_DEBUG) {
49
- console.error(`[LEX-MCP] Server initialized: ${dbPath}`);
50
- console.error(`[LEX-MCP] Workspace root: ${repoRoot}`);
35
+ console.error(`[LEX-MCP] Project root: ${projectRoot}`);
51
36
  }
52
37
  } catch (error) {
53
38
  console.error(`[LEX-MCP] Failed to initialize: ${error.message}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smartergpt/lex-mcp",
3
- "version": "2.7.0",
3
+ "version": "2.8.0",
4
4
  "description": "MCP server for Lex episodic memory - stdio transport wrapper",
5
5
  "mcpName": "dev.smartergpt/lex",
6
6
  "type": "module",
@@ -22,7 +22,7 @@
22
22
  "link:local": "rm -rf node_modules/@smartergpt/lex && mkdir -p node_modules/@smartergpt && ln -s /srv/lex-mcp/lex node_modules/@smartergpt/lex"
23
23
  },
24
24
  "dependencies": {
25
- "@smartergpt/lex": "^2.7.0"
25
+ "@smartergpt/lex": "^2.8.0"
26
26
  },
27
27
  "publishConfig": {
28
28
  "access": "public",