@aleph-alpha/lib-mcp 1.3.0 → 1.5.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.
- package/components-meta.json +2 -1
- package/dist/cli.js +68 -21
- package/dist/server.js +47 -13
- package/package.json +2 -2
package/components-meta.json
CHANGED
package/dist/cli.js
CHANGED
|
@@ -3222,8 +3222,8 @@ var require_utils = __commonJS({
|
|
|
3222
3222
|
}
|
|
3223
3223
|
return ind;
|
|
3224
3224
|
}
|
|
3225
|
-
function removeDotSegments(
|
|
3226
|
-
let input =
|
|
3225
|
+
function removeDotSegments(path9) {
|
|
3226
|
+
let input = path9;
|
|
3227
3227
|
const output = [];
|
|
3228
3228
|
let nextSlash = -1;
|
|
3229
3229
|
let len = 0;
|
|
@@ -3422,8 +3422,8 @@ var require_schemes = __commonJS({
|
|
|
3422
3422
|
wsComponent.secure = void 0;
|
|
3423
3423
|
}
|
|
3424
3424
|
if (wsComponent.resourceName) {
|
|
3425
|
-
const [
|
|
3426
|
-
wsComponent.path =
|
|
3425
|
+
const [path9, query] = wsComponent.resourceName.split("?");
|
|
3426
|
+
wsComponent.path = path9 && path9 !== "/" ? path9 : void 0;
|
|
3427
3427
|
wsComponent.query = query;
|
|
3428
3428
|
wsComponent.resourceName = void 0;
|
|
3429
3429
|
}
|
|
@@ -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
|
|
6869
|
-
|
|
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
|
|
@@ -7392,8 +7404,8 @@ function getErrorMap() {
|
|
|
7392
7404
|
|
|
7393
7405
|
// ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.js
|
|
7394
7406
|
var makeIssue = (params) => {
|
|
7395
|
-
const { data, path:
|
|
7396
|
-
const fullPath = [...
|
|
7407
|
+
const { data, path: path9, errorMaps, issueData } = params;
|
|
7408
|
+
const fullPath = [...path9, ...issueData.path || []];
|
|
7397
7409
|
const fullIssue = {
|
|
7398
7410
|
...issueData,
|
|
7399
7411
|
path: fullPath
|
|
@@ -7509,11 +7521,11 @@ var errorUtil;
|
|
|
7509
7521
|
|
|
7510
7522
|
// ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.js
|
|
7511
7523
|
var ParseInputLazyPath = class {
|
|
7512
|
-
constructor(parent, value,
|
|
7524
|
+
constructor(parent, value, path9, key) {
|
|
7513
7525
|
this._cachedPath = [];
|
|
7514
7526
|
this.parent = parent;
|
|
7515
7527
|
this.data = value;
|
|
7516
|
-
this._path =
|
|
7528
|
+
this._path = path9;
|
|
7517
7529
|
this._key = key;
|
|
7518
7530
|
}
|
|
7519
7531
|
get path() {
|
|
@@ -11151,10 +11163,10 @@ function assignProp(target, prop, value) {
|
|
|
11151
11163
|
configurable: true
|
|
11152
11164
|
});
|
|
11153
11165
|
}
|
|
11154
|
-
function getElementAtPath(obj,
|
|
11155
|
-
if (!
|
|
11166
|
+
function getElementAtPath(obj, path9) {
|
|
11167
|
+
if (!path9)
|
|
11156
11168
|
return obj;
|
|
11157
|
-
return
|
|
11169
|
+
return path9.reduce((acc, key) => acc?.[key], obj);
|
|
11158
11170
|
}
|
|
11159
11171
|
function promiseAllObject(promisesObj) {
|
|
11160
11172
|
const keys = Object.keys(promisesObj);
|
|
@@ -11474,11 +11486,11 @@ function aborted(x, startIndex = 0) {
|
|
|
11474
11486
|
}
|
|
11475
11487
|
return false;
|
|
11476
11488
|
}
|
|
11477
|
-
function prefixIssues(
|
|
11489
|
+
function prefixIssues(path9, issues) {
|
|
11478
11490
|
return issues.map((iss) => {
|
|
11479
11491
|
var _a;
|
|
11480
11492
|
(_a = iss).path ?? (_a.path = []);
|
|
11481
|
-
iss.path.unshift(
|
|
11493
|
+
iss.path.unshift(path9);
|
|
11482
11494
|
return iss;
|
|
11483
11495
|
});
|
|
11484
11496
|
}
|
|
@@ -21102,6 +21114,9 @@ function findUiLibraryRoot() {
|
|
|
21102
21114
|
}
|
|
21103
21115
|
throw new Error("Could not find @aleph-alpha/ui-library. Is it installed?");
|
|
21104
21116
|
}
|
|
21117
|
+
function getLibraryRootPath() {
|
|
21118
|
+
return findUiLibraryRoot();
|
|
21119
|
+
}
|
|
21105
21120
|
function getLibrarySourcePath() {
|
|
21106
21121
|
const uiLibraryRoot = findUiLibraryRoot();
|
|
21107
21122
|
const srcPath = path3.join(uiLibraryRoot, "src");
|
|
@@ -21446,6 +21461,23 @@ function getComponentDocs(componentName) {
|
|
|
21446
21461
|
};
|
|
21447
21462
|
}
|
|
21448
21463
|
|
|
21464
|
+
// src/tools/get-setup.ts
|
|
21465
|
+
import * as path8 from "node:path";
|
|
21466
|
+
function getSetupGuide() {
|
|
21467
|
+
const libraryRoot = getLibraryRootPath();
|
|
21468
|
+
const quickStartPath = path8.join(libraryRoot, "docs", "public-docs", "quick-start.md");
|
|
21469
|
+
const quickStart = readTextFile(quickStartPath);
|
|
21470
|
+
if (quickStart) {
|
|
21471
|
+
return quickStart;
|
|
21472
|
+
}
|
|
21473
|
+
const readmePath = path8.join(libraryRoot, "README.md");
|
|
21474
|
+
const readme = readTextFile(readmePath);
|
|
21475
|
+
if (readme) {
|
|
21476
|
+
return readme;
|
|
21477
|
+
}
|
|
21478
|
+
return null;
|
|
21479
|
+
}
|
|
21480
|
+
|
|
21449
21481
|
// src/server.ts
|
|
21450
21482
|
var text = (t) => ({ content: [{ type: "text", text: t }] });
|
|
21451
21483
|
var error2 = (msg) => ({ ...text(msg), isError: true });
|
|
@@ -21542,6 +21574,20 @@ async function startServer() {
|
|
|
21542
21574
|
}
|
|
21543
21575
|
}
|
|
21544
21576
|
);
|
|
21577
|
+
server.tool(
|
|
21578
|
+
"get_setup_guide",
|
|
21579
|
+
"Get the setup and installation guide for integrating the UI library into a project. Returns UnoCSS config, Vite config, required dependencies, and MCP setup instructions.",
|
|
21580
|
+
{},
|
|
21581
|
+
async () => {
|
|
21582
|
+
try {
|
|
21583
|
+
const guide = getSetupGuide();
|
|
21584
|
+
if (!guide) return error2("Setup guide not found. Is @aleph-alpha/ui-library installed?");
|
|
21585
|
+
return text(guide);
|
|
21586
|
+
} catch (e) {
|
|
21587
|
+
return handleError(e);
|
|
21588
|
+
}
|
|
21589
|
+
}
|
|
21590
|
+
);
|
|
21545
21591
|
const transport = new StdioServerTransport();
|
|
21546
21592
|
await server.connect(transport);
|
|
21547
21593
|
console.error("UI Library MCP Server running");
|
|
@@ -21556,12 +21602,13 @@ Usage:
|
|
|
21556
21602
|
npx @aleph-alpha/lib-mcp <command> [options]
|
|
21557
21603
|
|
|
21558
21604
|
Commands:
|
|
21559
|
-
mcp-install [--cursor]
|
|
21560
|
-
serve
|
|
21605
|
+
mcp-install [--cursor] [--vscode] Configure MCP server for Claude Code (and optionally Cursor/VS Code)
|
|
21606
|
+
serve Start the MCP server (used internally by IDE)
|
|
21561
21607
|
|
|
21562
21608
|
Examples:
|
|
21563
21609
|
npx @aleph-alpha/lib-mcp mcp-install
|
|
21564
21610
|
npx @aleph-alpha/lib-mcp mcp-install --cursor
|
|
21611
|
+
npx @aleph-alpha/lib-mcp mcp-install --vscode
|
|
21565
21612
|
|
|
21566
21613
|
After installation, restart your IDE to use these MCP tools:
|
|
21567
21614
|
- list_components: Browse all UI components (optionally filter by name/category/description)
|
package/dist/server.js
CHANGED
|
@@ -3221,8 +3221,8 @@ var require_utils = __commonJS({
|
|
|
3221
3221
|
}
|
|
3222
3222
|
return ind;
|
|
3223
3223
|
}
|
|
3224
|
-
function removeDotSegments(
|
|
3225
|
-
let input =
|
|
3224
|
+
function removeDotSegments(path8) {
|
|
3225
|
+
let input = path8;
|
|
3226
3226
|
const output = [];
|
|
3227
3227
|
let nextSlash = -1;
|
|
3228
3228
|
let len = 0;
|
|
@@ -3421,8 +3421,8 @@ var require_schemes = __commonJS({
|
|
|
3421
3421
|
wsComponent.secure = void 0;
|
|
3422
3422
|
}
|
|
3423
3423
|
if (wsComponent.resourceName) {
|
|
3424
|
-
const [
|
|
3425
|
-
wsComponent.path =
|
|
3424
|
+
const [path8, query] = wsComponent.resourceName.split("?");
|
|
3425
|
+
wsComponent.path = path8 && path8 !== "/" ? path8 : void 0;
|
|
3426
3426
|
wsComponent.query = query;
|
|
3427
3427
|
wsComponent.resourceName = void 0;
|
|
3428
3428
|
}
|
|
@@ -7266,8 +7266,8 @@ function getErrorMap() {
|
|
|
7266
7266
|
|
|
7267
7267
|
// ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.js
|
|
7268
7268
|
var makeIssue = (params) => {
|
|
7269
|
-
const { data, path:
|
|
7270
|
-
const fullPath = [...
|
|
7269
|
+
const { data, path: path8, errorMaps, issueData } = params;
|
|
7270
|
+
const fullPath = [...path8, ...issueData.path || []];
|
|
7271
7271
|
const fullIssue = {
|
|
7272
7272
|
...issueData,
|
|
7273
7273
|
path: fullPath
|
|
@@ -7383,11 +7383,11 @@ var errorUtil;
|
|
|
7383
7383
|
|
|
7384
7384
|
// ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.js
|
|
7385
7385
|
var ParseInputLazyPath = class {
|
|
7386
|
-
constructor(parent, value,
|
|
7386
|
+
constructor(parent, value, path8, key) {
|
|
7387
7387
|
this._cachedPath = [];
|
|
7388
7388
|
this.parent = parent;
|
|
7389
7389
|
this.data = value;
|
|
7390
|
-
this._path =
|
|
7390
|
+
this._path = path8;
|
|
7391
7391
|
this._key = key;
|
|
7392
7392
|
}
|
|
7393
7393
|
get path() {
|
|
@@ -11025,10 +11025,10 @@ function assignProp(target, prop, value) {
|
|
|
11025
11025
|
configurable: true
|
|
11026
11026
|
});
|
|
11027
11027
|
}
|
|
11028
|
-
function getElementAtPath(obj,
|
|
11029
|
-
if (!
|
|
11028
|
+
function getElementAtPath(obj, path8) {
|
|
11029
|
+
if (!path8)
|
|
11030
11030
|
return obj;
|
|
11031
|
-
return
|
|
11031
|
+
return path8.reduce((acc, key) => acc?.[key], obj);
|
|
11032
11032
|
}
|
|
11033
11033
|
function promiseAllObject(promisesObj) {
|
|
11034
11034
|
const keys = Object.keys(promisesObj);
|
|
@@ -11348,11 +11348,11 @@ function aborted(x, startIndex = 0) {
|
|
|
11348
11348
|
}
|
|
11349
11349
|
return false;
|
|
11350
11350
|
}
|
|
11351
|
-
function prefixIssues(
|
|
11351
|
+
function prefixIssues(path8, issues) {
|
|
11352
11352
|
return issues.map((iss) => {
|
|
11353
11353
|
var _a;
|
|
11354
11354
|
(_a = iss).path ?? (_a.path = []);
|
|
11355
|
-
iss.path.unshift(
|
|
11355
|
+
iss.path.unshift(path8);
|
|
11356
11356
|
return iss;
|
|
11357
11357
|
});
|
|
11358
11358
|
}
|
|
@@ -21018,6 +21018,9 @@ function findUiLibraryRoot() {
|
|
|
21018
21018
|
}
|
|
21019
21019
|
throw new Error("Could not find @aleph-alpha/ui-library. Is it installed?");
|
|
21020
21020
|
}
|
|
21021
|
+
function getLibraryRootPath() {
|
|
21022
|
+
return findUiLibraryRoot();
|
|
21023
|
+
}
|
|
21021
21024
|
function getLibrarySourcePath() {
|
|
21022
21025
|
const uiLibraryRoot = findUiLibraryRoot();
|
|
21023
21026
|
const srcPath = path2.join(uiLibraryRoot, "src");
|
|
@@ -21362,6 +21365,23 @@ function getComponentDocs(componentName) {
|
|
|
21362
21365
|
};
|
|
21363
21366
|
}
|
|
21364
21367
|
|
|
21368
|
+
// src/tools/get-setup.ts
|
|
21369
|
+
import * as path7 from "node:path";
|
|
21370
|
+
function getSetupGuide() {
|
|
21371
|
+
const libraryRoot = getLibraryRootPath();
|
|
21372
|
+
const quickStartPath = path7.join(libraryRoot, "docs", "public-docs", "quick-start.md");
|
|
21373
|
+
const quickStart = readTextFile(quickStartPath);
|
|
21374
|
+
if (quickStart) {
|
|
21375
|
+
return quickStart;
|
|
21376
|
+
}
|
|
21377
|
+
const readmePath = path7.join(libraryRoot, "README.md");
|
|
21378
|
+
const readme = readTextFile(readmePath);
|
|
21379
|
+
if (readme) {
|
|
21380
|
+
return readme;
|
|
21381
|
+
}
|
|
21382
|
+
return null;
|
|
21383
|
+
}
|
|
21384
|
+
|
|
21365
21385
|
// src/server.ts
|
|
21366
21386
|
var text = (t) => ({ content: [{ type: "text", text: t }] });
|
|
21367
21387
|
var error2 = (msg) => ({ ...text(msg), isError: true });
|
|
@@ -21458,6 +21478,20 @@ async function startServer() {
|
|
|
21458
21478
|
}
|
|
21459
21479
|
}
|
|
21460
21480
|
);
|
|
21481
|
+
server.tool(
|
|
21482
|
+
"get_setup_guide",
|
|
21483
|
+
"Get the setup and installation guide for integrating the UI library into a project. Returns UnoCSS config, Vite config, required dependencies, and MCP setup instructions.",
|
|
21484
|
+
{},
|
|
21485
|
+
async () => {
|
|
21486
|
+
try {
|
|
21487
|
+
const guide = getSetupGuide();
|
|
21488
|
+
if (!guide) return error2("Setup guide not found. Is @aleph-alpha/ui-library installed?");
|
|
21489
|
+
return text(guide);
|
|
21490
|
+
} catch (e) {
|
|
21491
|
+
return handleError(e);
|
|
21492
|
+
}
|
|
21493
|
+
}
|
|
21494
|
+
);
|
|
21461
21495
|
const transport = new StdioServerTransport();
|
|
21462
21496
|
await server.connect(transport);
|
|
21463
21497
|
console.error("UI Library MCP Server running");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aleph-alpha/lib-mcp",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/server.js",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@aleph-alpha/tsconfig-frontend": "0.5.0"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
|
-
"@aleph-alpha/ui-library": "1.
|
|
31
|
+
"@aleph-alpha/ui-library": "1.15.0"
|
|
32
32
|
},
|
|
33
33
|
"homepage": "https://docs.aleph-alpha.com",
|
|
34
34
|
"scripts": {
|