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:
YeonGyu-Kim
2026-05-18 20:18:51 +09:00
parent f6fba0b154
commit 6fe2f72c76
5 changed files with 114 additions and 36 deletions
@@ -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", () => ({