fix(mcp): bootstrap lsp when cli is unavailable
Keep the built-in lsp MCP registered even when the submodule CLI artifact is missing. The fallback command initializes the lsp-tools-mcp submodule, prefers the source CLI without dirtying the checkout with dist output, and keeps npm build as a last resort when Bun cannot run the source entrypoint. Plan: plans/fix-lsp-mcp-missing-cli.md
This commit is contained in:
@@ -42,6 +42,20 @@ describe("createBuiltinMcps", () => {
|
||||
expect(result.lsp).toBeDefined()
|
||||
})
|
||||
|
||||
test("should keep lsp when it uses a bootstrap command", () => {
|
||||
// given
|
||||
mock.module("../lsp", () => ({
|
||||
createLspMcpConfig: () => ({ type: "local", command: ["node", "-e", "bootstrap", "/repo"], enabled: true }),
|
||||
}))
|
||||
const { createBuiltinMcps } = require("../index") as typeof import("../index")
|
||||
|
||||
// when
|
||||
const result = createBuiltinMcps([])
|
||||
|
||||
// then
|
||||
expect(result.lsp).toBeDefined()
|
||||
})
|
||||
|
||||
test("should return empty array when all MCPs are disabled", () => {
|
||||
// given - disable all known MCPs
|
||||
mock.module("../lsp", () => ({
|
||||
|
||||
Reference in New Issue
Block a user