Skip to content

Commit de522c1

Browse files
committed
LSP resolution: existing repo first for sysmledgraph-mcp
- Resolve order: SYSMLLSP_SERVER_PATH, then cwd/repo, then package node_modules - docs/MCP-AND-KUZU.md: document resolution order - chore: release v0.4.0 Made-with: Cursor
1 parent 2d127a9 commit de522c1

4 files changed

Lines changed: 9 additions & 5 deletions

File tree

docs/MCP-AND-KUZU.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ That was **path resolution**: the sysmledgraph CLI (or MCP) was only looking in
3333

3434
**Fixes:**
3535

36-
- Resolver now also checks **repo root** (and parent directories) for `node_modules/sysml-v2-lsp/dist/server/server.js`, so when sysmledgraph runs from a subfolder (e.g. `tools/sysmledgraph`), it can find the LSP at the repo root.
36+
- Resolver looks for the LSP in this order: **SYSMLLSP_SERVER_PATH** (if set), then the **existing repo** (walk up from the current working directory), then sysmledgraph’s own `node_modules`. So when the MCP runs with cwd = workspace root, the repo’s sysml-v2-lsp is used first.
3737
- You can always set **SYSMLLSP_SERVER_PATH** to the absolute path of your built `dist/server/server.js` if you want to point at a specific LSP install.
3838

3939
The sysml-v2 MCP runs from repo root and uses `mcpServer.js`; it doesn’t depend on this resolver and doesn’t block it.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sysmledgraph",
3-
"version": "0.3.0",
3+
"version": "0.4.0",
44
"description": "Path-only SysML indexer: knowledge graph (Kuzu), MCP server (query, context, impact, rename, cypher), CLI (analyze, list, clean)",
55
"type": "module",
66
"main": "dist/src/index.js",

release-notes-v0.4.0.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
## Changes
2+
3+
- **LSP resolution: existing repo first** — sysmledgraph-mcp now looks for sysml-v2-lsp in this order: `SYSMLLSP_SERVER_PATH` (if set), then the **current workspace/repo** (walk up from cwd), then sysmledgraph’s own `node_modules`. When the MCP runs with cwd = workspace root, the repo’s LSP is used first.
4+
- **Docs** — MCP-AND-KUZU.md updated to describe the resolution order.

src/parser/lsp-client.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* sysml-v2-lsp integration: stdio LSP client.
33
* Spawns the LSP server (dist/server/server.js). Uses LSP message framing (Content-Length).
4-
* Server path: SYSMLLSP_SERVER_PATH, or local node_modules, or walk up from cwd (e.g. repo root).
4+
* Server path: SYSMLLSP_SERVER_PATH, or existing repo (walk up from cwd) first, then sysmledgraph's node_modules.
55
*/
66

77
import { spawn } from 'child_process';
@@ -39,11 +39,11 @@ async function resolveServerPath(): Promise<string | null> {
3939
if (process.env.SYSMLLSP_SERVER_PATH) {
4040
return process.env.SYSMLLSP_SERVER_PATH;
4141
}
42+
const fromRepo = findLspInNodeModules(process.cwd());
43+
if (fromRepo) return fromRepo;
4244
const packageRoot = join(__dirname, '..', '..', '..');
4345
const local = join(packageRoot, 'node_modules', LSP_REL_PATH);
4446
if (existsSync(local)) return local;
45-
const fromCwd = findLspInNodeModules(process.cwd());
46-
if (fromCwd) return fromCwd;
4747
return null;
4848
}
4949

0 commit comments

Comments
 (0)