@getflip/swirl-mcp 0.4.0 → 0.4.1
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.
|
@@ -6,7 +6,7 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
|
6
6
|
// package.json
|
|
7
7
|
var package_default = {
|
|
8
8
|
name: "@getflip/swirl-mcp",
|
|
9
|
-
version: "0.4.
|
|
9
|
+
version: "0.4.1",
|
|
10
10
|
description: "MCP server for Swirl Design System \u2014 lets AI agents discover and use Swirl components",
|
|
11
11
|
author: "Flip GmbH",
|
|
12
12
|
repository: {
|
|
@@ -180,13 +180,18 @@ var ArtifactLibrary = class _ArtifactLibrary {
|
|
|
180
180
|
return this.dataSource.readText(`${name}.md`);
|
|
181
181
|
}
|
|
182
182
|
getTokensByCategory(category) {
|
|
183
|
-
return this.tokens[category];
|
|
183
|
+
return this.tokens?.[category];
|
|
184
184
|
}
|
|
185
185
|
static async fromDataSource(dataSource) {
|
|
186
|
-
const
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
186
|
+
const components = await dataSource.readJson(
|
|
187
|
+
"components-index.json"
|
|
188
|
+
);
|
|
189
|
+
let tokens;
|
|
190
|
+
try {
|
|
191
|
+
tokens = await dataSource.readJson("tokens.json");
|
|
192
|
+
} catch {
|
|
193
|
+
tokens = void 0;
|
|
194
|
+
}
|
|
190
195
|
return new _ArtifactLibrary(components.components, tokens, dataSource);
|
|
191
196
|
}
|
|
192
197
|
};
|
|
@@ -454,6 +459,17 @@ function registerListTokensTool(server, loadLibrary2, name, description, categor
|
|
|
454
459
|
async ({ version, format }) => {
|
|
455
460
|
const lib = await loadLibrary2(version);
|
|
456
461
|
const tokens = lib.getTokensByCategory(category);
|
|
462
|
+
if (tokens === void 0) {
|
|
463
|
+
return {
|
|
464
|
+
isError: true,
|
|
465
|
+
content: [
|
|
466
|
+
{
|
|
467
|
+
type: "text",
|
|
468
|
+
text: `The "${name}" tool is not supported for the @getflip/swirl-components@${version} version`
|
|
469
|
+
}
|
|
470
|
+
]
|
|
471
|
+
};
|
|
472
|
+
}
|
|
457
473
|
const formatted = tokens.map((t) => formatToken(t, format)).filter((t) => t !== null);
|
|
458
474
|
return {
|
|
459
475
|
content: [{ type: "text", text: JSON.stringify(formatted) }]
|
package/dist/transports/http.js
CHANGED
package/dist/transports/stdio.js
CHANGED