@smartergpt/lex-mcp 2.5.2 → 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.
- package/README.md +17 -4
- package/index.mjs +10 -21
- package/package.json +8 -2
package/README.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# @smartergpt/lex-mcp
|
|
2
2
|
|
|
3
|
-
MCP
|
|
3
|
+
Thin MCP stdio wrapper for [@smartergpt/lex](https://github.com/Guffawaffle/lex) episodic memory.
|
|
4
|
+
|
|
5
|
+
Lex owns all capabilities. This package owns delivery over [Model Context Protocol](https://modelcontextprotocol.io/).
|
|
4
6
|
|
|
5
7
|
## Quick Start
|
|
6
8
|
|
|
@@ -43,13 +45,24 @@ Add to `claude_desktop_config.json`:
|
|
|
43
45
|
}
|
|
44
46
|
```
|
|
45
47
|
|
|
48
|
+
### Quick Smoke Test
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
echo '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}' | npx @smartergpt/lex-mcp
|
|
52
|
+
```
|
|
53
|
+
|
|
46
54
|
## Environment Variables
|
|
47
55
|
|
|
48
56
|
| Variable | Description | Default |
|
|
49
57
|
|----------|-------------|---------|
|
|
50
|
-
| `LEX_WORKSPACE_ROOT` |
|
|
51
|
-
| `
|
|
52
|
-
| `
|
|
58
|
+
| `LEX_WORKSPACE_ROOT` | Project root directory (compat env var name) | Current directory |
|
|
59
|
+
| `LEX_DB_PATH` | SQLite database path (canonical) | `.smartergpt/lex/memory.db` |
|
|
60
|
+
| `LEX_MEMORY_DB` | Alias for `LEX_DB_PATH` (compat only) | — |
|
|
61
|
+
| `LEX_DEBUG` | Enable debug logging to stderr | Off |
|
|
62
|
+
|
|
63
|
+
When both `LEX_DB_PATH` and `LEX_MEMORY_DB` are set, `LEX_DB_PATH` wins.
|
|
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.
|
|
53
66
|
|
|
54
67
|
## Tools
|
|
55
68
|
|
package/index.mjs
CHANGED
|
@@ -9,41 +9,30 @@
|
|
|
9
9
|
* npx @smartergpt/lex-mcp
|
|
10
10
|
*
|
|
11
11
|
* Environment Variables:
|
|
12
|
-
* LEX_WORKSPACE_ROOT -
|
|
13
|
-
*
|
|
12
|
+
* LEX_WORKSPACE_ROOT - Project root directory (compat env var name, default: cwd)
|
|
13
|
+
* LEX_DB_PATH - SQLite database path (default: .smartergpt/lex/memory.db)
|
|
14
|
+
* LEX_MEMORY_DB - Alias for LEX_DB_PATH (for backwards compatibility)
|
|
14
15
|
* LEX_DEBUG - Enable debug logging to stderr
|
|
15
16
|
*/
|
|
16
17
|
|
|
17
18
|
import { MCPServer } from "@smartergpt/lex/mcp-server";
|
|
18
|
-
import { join, dirname } from "path";
|
|
19
|
-
import { mkdirSync } from "fs";
|
|
20
19
|
|
|
21
|
-
//
|
|
22
|
-
const
|
|
20
|
+
// Project root defaults to current working directory.
|
|
21
|
+
const projectRoot = process.env.LEX_WORKSPACE_ROOT || process.cwd();
|
|
23
22
|
|
|
24
23
|
// Set LEX_WORKSPACE_ROOT for modules that need it
|
|
25
24
|
if (!process.env.LEX_WORKSPACE_ROOT) {
|
|
26
|
-
process.env.LEX_WORKSPACE_ROOT =
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
// Database path defaults to .smartergpt/lex/lex.db in workspace root
|
|
30
|
-
const dbPath =
|
|
31
|
-
process.env.LEX_MEMORY_DB || join(repoRoot, ".smartergpt", "lex", "lex.db");
|
|
32
|
-
|
|
33
|
-
// Ensure the database directory exists (first-time setup)
|
|
34
|
-
try {
|
|
35
|
-
mkdirSync(dirname(dbPath), { recursive: true });
|
|
36
|
-
} catch {
|
|
37
|
-
// Ignore — directory may already exist or be read-only
|
|
25
|
+
process.env.LEX_WORKSPACE_ROOT = projectRoot;
|
|
38
26
|
}
|
|
39
27
|
|
|
40
28
|
// Initialize MCP server
|
|
41
29
|
let mcpServer;
|
|
42
30
|
try {
|
|
43
|
-
|
|
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 });
|
|
44
34
|
if (process.env.LEX_DEBUG) {
|
|
45
|
-
console.error(`[LEX-MCP]
|
|
46
|
-
console.error(`[LEX-MCP] Workspace root: ${repoRoot}`);
|
|
35
|
+
console.error(`[LEX-MCP] Project root: ${projectRoot}`);
|
|
47
36
|
}
|
|
48
37
|
} catch (error) {
|
|
49
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.
|
|
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",
|
|
@@ -10,13 +10,19 @@
|
|
|
10
10
|
"README.md"
|
|
11
11
|
],
|
|
12
12
|
"scripts": {
|
|
13
|
+
"test": "node test-contract.mjs && node test-mcp-server.mjs --local --clean",
|
|
14
|
+
"test:contract": "node test-contract.mjs",
|
|
15
|
+
"test:contract:verbose": "node test-contract.mjs --verbose",
|
|
13
16
|
"test:mcp": "node test-mcp-server.mjs --local --clean",
|
|
14
17
|
"test:mcp:verbose": "node test-mcp-server.mjs --local --clean --verbose",
|
|
18
|
+
"test:pack": "node test-pack-smoke.mjs",
|
|
19
|
+
"test:pack:verbose": "node test-pack-smoke.mjs --verbose",
|
|
20
|
+
"test:pack:keep": "node test-pack-smoke.mjs --keep",
|
|
15
21
|
"test:published": "node test-mcp-server.mjs --clean",
|
|
16
22
|
"link:local": "rm -rf node_modules/@smartergpt/lex && mkdir -p node_modules/@smartergpt && ln -s /srv/lex-mcp/lex node_modules/@smartergpt/lex"
|
|
17
23
|
},
|
|
18
24
|
"dependencies": {
|
|
19
|
-
"@smartergpt/lex": "^2.
|
|
25
|
+
"@smartergpt/lex": "^2.8.0"
|
|
20
26
|
},
|
|
21
27
|
"publishConfig": {
|
|
22
28
|
"access": "public",
|