@aleph-alpha/lib-mcp 1.3.0 → 1.4.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.
Files changed (2) hide show
  1. package/dist/cli.js +21 -8
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -6838,8 +6838,15 @@ function findMatchingBrace(text2, openingBraceIndex, openChar = "{", closeChar =
6838
6838
  var __filename = fileURLToPath(import.meta.url);
6839
6839
  var __dirname = path.dirname(__filename);
6840
6840
  var IDE_CONFIG = {
6841
- claude: { dir: null, file: ".mcp.json", name: "Claude Code" },
6842
- cursor: { dir: ".cursor", file: "mcp.json", name: "Cursor" }
6841
+ claude: { dir: null, file: ".mcp.json", name: "Claude Code", rootKey: "mcpServers" },
6842
+ cursor: { dir: ".cursor", file: "mcp.json", name: "Cursor", rootKey: "mcpServers" },
6843
+ vscode: {
6844
+ dir: ".vscode",
6845
+ file: "mcp.json",
6846
+ name: "VS Code",
6847
+ rootKey: "servers",
6848
+ extraFields: { type: "stdio" }
6849
+ }
6843
6850
  };
6844
6851
  function getProjectRoot() {
6845
6852
  let dir = process.cwd();
@@ -6858,15 +6865,16 @@ function getMcpServerPath(projectRoot) {
6858
6865
  throw new Error("Could not find lib-mcp. Make sure @aleph-alpha/lib-mcp is installed.");
6859
6866
  }
6860
6867
  function configureIDE(ide, projectRoot, mcpPath) {
6861
- const { dir, file, name } = IDE_CONFIG[ide];
6868
+ const { dir, file, name, rootKey, extraFields } = IDE_CONFIG[ide];
6862
6869
  const settingsDir = dir ? path.join(projectRoot, dir) : projectRoot;
6863
6870
  const settingsFile = path.join(settingsDir, file);
6864
6871
  if (dir && !fs2.existsSync(settingsDir)) {
6865
6872
  fs2.mkdirSync(settingsDir, { recursive: true });
6866
6873
  }
6867
6874
  const settings = readJsonFile(settingsFile) ?? {};
6868
- settings.mcpServers ??= {};
6869
- settings.mcpServers["ui-library"] = { command: "node", args: [mcpPath, "serve"] };
6875
+ const servers = settings[rootKey] ?? {};
6876
+ servers["ui-library"] = { command: "node", args: [mcpPath, "serve"], ...extraFields };
6877
+ settings[rootKey] = servers;
6870
6878
  const tempFile = `${settingsFile}.tmp`;
6871
6879
  try {
6872
6880
  fs2.writeFileSync(tempFile, JSON.stringify(settings, null, 2) + "\n");
@@ -6885,10 +6893,11 @@ function configureIDE(ide, projectRoot, mcpPath) {
6885
6893
  function runInstall(args) {
6886
6894
  if (args.includes("--help") || args.includes("-h")) {
6887
6895
  console.log(`
6888
- Usage: npx @aleph-alpha/lib-mcp mcp-install [--cursor]
6896
+ Usage: npx @aleph-alpha/lib-mcp mcp-install [--cursor] [--vscode]
6889
6897
 
6890
6898
  Options:
6891
6899
  --cursor Also configure for Cursor IDE
6900
+ --vscode Also configure for VS Code
6892
6901
  --help Show this help message
6893
6902
  `);
6894
6903
  return;
@@ -6903,6 +6912,9 @@ Installing UI Library MCP Server...
6903
6912
  if (args.includes("--cursor")) {
6904
6913
  configureIDE("cursor", projectRoot, mcpPath);
6905
6914
  }
6915
+ if (args.includes("--vscode")) {
6916
+ configureIDE("vscode", projectRoot, mcpPath);
6917
+ }
6906
6918
  console.log(`
6907
6919
  \u2705 Done! Restart your IDE to use these tools:
6908
6920
  - list_components
@@ -21556,12 +21568,13 @@ Usage:
21556
21568
  npx @aleph-alpha/lib-mcp <command> [options]
21557
21569
 
21558
21570
  Commands:
21559
- mcp-install [--cursor] Configure MCP server for Claude Code (and optionally Cursor)
21560
- serve Start the MCP server (used internally by IDE)
21571
+ mcp-install [--cursor] [--vscode] Configure MCP server for Claude Code (and optionally Cursor/VS Code)
21572
+ serve Start the MCP server (used internally by IDE)
21561
21573
 
21562
21574
  Examples:
21563
21575
  npx @aleph-alpha/lib-mcp mcp-install
21564
21576
  npx @aleph-alpha/lib-mcp mcp-install --cursor
21577
+ npx @aleph-alpha/lib-mcp mcp-install --vscode
21565
21578
 
21566
21579
  After installation, restart your IDE to use these MCP tools:
21567
21580
  - list_components: Browse all UI components (optionally filter by name/category/description)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aleph-alpha/lib-mcp",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "main": "dist/server.js",