@treedy/lsp-mcp 0.1.4 → 0.1.5

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/dist/index.js CHANGED
@@ -19845,6 +19845,7 @@ function loadConfig() {
19845
19845
  const typescriptEnabled = getEnvBool("LSP_MCP_TYPESCRIPT_ENABLED", true);
19846
19846
  const vueEnabled = getEnvBool("LSP_MCP_VUE_ENABLED", true);
19847
19847
  const autoUpdate = getEnvBool("LSP_MCP_AUTO_UPDATE", true);
19848
+ const eagerStart = getEnvBool("LSP_MCP_EAGER_START", false);
19848
19849
  return {
19849
19850
  python: {
19850
19851
  enabled: pythonEnabled,
@@ -19856,7 +19857,8 @@ function loadConfig() {
19856
19857
  vue: {
19857
19858
  enabled: vueEnabled
19858
19859
  },
19859
- autoUpdate
19860
+ autoUpdate,
19861
+ eagerStart
19860
19862
  };
19861
19863
  }
19862
19864
  function getEnvBool(name, defaultValue) {
@@ -21661,6 +21663,7 @@ function registerBackendTools(language, tools) {
21661
21663
  console.error(`[lsp-mcp] Registered ${namespacedName}`);
21662
21664
  count++;
21663
21665
  }
21666
+ server.sendToolListChanged();
21664
21667
  return count;
21665
21668
  }
21666
21669
  async function startAndRegisterBackend(language) {
@@ -21731,15 +21734,42 @@ async function main() {
21731
21734
  console.error(` Version: ${packageJson.version}`);
21732
21735
  console.error(" Python:", config2.python.enabled ? `enabled (${config2.python.provider})` : "disabled");
21733
21736
  console.error(" TypeScript:", config2.typescript.enabled ? "enabled" : "disabled");
21734
- console.error("");
21735
- console.error("Backends are loaded on-demand. Use these tools to get started:");
21736
- console.error(" - list_backends: See available backends and their status");
21737
- console.error(" - start_backend: Install and start a backend (e.g., start_backend language=python)");
21738
- console.error("");
21739
- console.error("Prompts available: code-navigation, refactoring, code-analysis, lsp-rules, lsp-quick-start");
21737
+ console.error(" Vue:", config2.vue.enabled ? "enabled" : "disabled");
21738
+ console.error(" Eager Start:", config2.eagerStart ? "enabled" : "disabled");
21740
21739
  console.error("");
21741
21740
  const transport = new StdioServerTransport;
21742
21741
  await server.connect(transport);
21742
+ if (config2.eagerStart) {
21743
+ console.error("Starting all enabled backends...");
21744
+ const languages = [];
21745
+ if (config2.python.enabled)
21746
+ languages.push("python");
21747
+ if (config2.typescript.enabled)
21748
+ languages.push("typescript");
21749
+ if (config2.vue.enabled)
21750
+ languages.push("vue");
21751
+ const results = await Promise.allSettled(languages.map(async (lang) => {
21752
+ try {
21753
+ const count = await startAndRegisterBackend(lang);
21754
+ return { lang, count };
21755
+ } catch (error2) {
21756
+ console.error(`[lsp-mcp] Failed to start ${lang}:`, error2);
21757
+ return { lang, error: error2 };
21758
+ }
21759
+ }));
21760
+ for (const result of results) {
21761
+ if (result.status === "fulfilled" && "count" in result.value) {
21762
+ console.error(` ${result.value.lang}: ${result.value.count} tools registered`);
21763
+ } else if (result.status === "fulfilled" && "error" in result.value) {
21764
+ console.error(` ${result.value.lang}: failed to start`);
21765
+ }
21766
+ }
21767
+ } else {
21768
+ console.error("Backends are loaded on-demand. Use these tools to get started:");
21769
+ console.error(" - list_backends: See available backends and their status");
21770
+ console.error(" - start_backend: Install and start a backend (e.g., start_backend language=python)");
21771
+ }
21772
+ console.error("");
21743
21773
  console.error("Ready");
21744
21774
  }
21745
21775
  main().catch((error2) => {
@@ -21747,4 +21777,4 @@ main().catch((error2) => {
21747
21777
  process.exit(1);
21748
21778
  });
21749
21779
 
21750
- //# debugId=0931320CB6D5336A64756E2164756E21
21780
+ //# debugId=93725E95ED75445864756E2164756E21