@seed-design/mcp 1.1.18 → 1.2.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/bin/index.mjs +5 -5
- package/package.json +2 -2
- package/src/tools.ts +13 -4
package/bin/index.mjs
CHANGED
|
@@ -394,7 +394,7 @@ function registerTools(server, figmaClient, config = {}) {
|
|
|
394
394
|
}
|
|
395
395
|
});
|
|
396
396
|
} catch (error) {
|
|
397
|
-
return
|
|
397
|
+
return formatTextResponse(`Error in get_node_info: ${formatError(error)}\n\n⚠️ Figma 라이브러리가 최신 버전인지 확인해주세요.`);
|
|
398
398
|
}
|
|
399
399
|
});
|
|
400
400
|
// Nodes Info Tool
|
|
@@ -436,7 +436,7 @@ function registerTools(server, figmaClient, config = {}) {
|
|
|
436
436
|
}));
|
|
437
437
|
return formatObjectResponse(results);
|
|
438
438
|
} catch (error) {
|
|
439
|
-
return
|
|
439
|
+
return formatTextResponse(`Error in get_nodes_info: ${formatError(error)}\n\n⚠️ Figma 라이브러리가 최신 버전인지 확인해주세요.`);
|
|
440
440
|
}
|
|
441
441
|
});
|
|
442
442
|
server.tool("get_node_react_code", "Get the React code for a specific node in Figma", {
|
|
@@ -456,11 +456,11 @@ function registerTools(server, figmaClient, config = {}) {
|
|
|
456
456
|
shouldPrintSource: false
|
|
457
457
|
});
|
|
458
458
|
if (!generated) {
|
|
459
|
-
return formatTextResponse("Failed to generate code");
|
|
459
|
+
return formatTextResponse("Failed to generate code\n\n⚠️ Figma 라이브러리가 최신 버전인지 확인해주세요.");
|
|
460
460
|
}
|
|
461
461
|
return formatTextResponse(`${generated.imports}\n\n${generated.jsx}`);
|
|
462
462
|
} catch (error) {
|
|
463
|
-
return
|
|
463
|
+
return formatTextResponse(`Error in get_node_react_code: ${formatError(error)}\n\n⚠️ Figma 라이브러리가 최신 버전인지 확인해주세요.`);
|
|
464
464
|
}
|
|
465
465
|
});
|
|
466
466
|
// Export Node as Image Tool
|
|
@@ -678,7 +678,7 @@ function registerPrompts(server) {
|
|
|
678
678
|
});
|
|
679
679
|
}
|
|
680
680
|
|
|
681
|
-
var version = "1.
|
|
681
|
+
var version = "1.2.0";
|
|
682
682
|
|
|
683
683
|
// Config loader
|
|
684
684
|
async function loadConfig(configPath) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seed-design/mcp",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/daangn/seed-design.git",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@modelcontextprotocol/sdk": "^1.10.2",
|
|
26
|
-
"@seed-design/figma": "1.
|
|
26
|
+
"@seed-design/figma": "1.2.0",
|
|
27
27
|
"cac": "^6.7.14",
|
|
28
28
|
"uuid": "^13.0.0",
|
|
29
29
|
"ws": "^8.18.1",
|
package/src/tools.ts
CHANGED
|
@@ -3,6 +3,7 @@ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
|
3
3
|
import { createRestNormalizer, figma, getFigmaColorVariableNames, react } from "@seed-design/figma";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
import type { McpConfig } from "./config";
|
|
6
|
+
import { formatError } from "./logger";
|
|
6
7
|
import {
|
|
7
8
|
formatErrorResponse,
|
|
8
9
|
formatImageResponse,
|
|
@@ -200,7 +201,9 @@ export function registerTools(
|
|
|
200
201
|
},
|
|
201
202
|
});
|
|
202
203
|
} catch (error) {
|
|
203
|
-
return
|
|
204
|
+
return formatTextResponse(
|
|
205
|
+
`Error in get_node_info: ${formatError(error)}\n\n⚠️ Figma 라이브러리가 최신 버전인지 확인해주세요.`,
|
|
206
|
+
);
|
|
204
207
|
}
|
|
205
208
|
},
|
|
206
209
|
);
|
|
@@ -252,7 +255,9 @@ export function registerTools(
|
|
|
252
255
|
);
|
|
253
256
|
return formatObjectResponse(results);
|
|
254
257
|
} catch (error) {
|
|
255
|
-
return
|
|
258
|
+
return formatTextResponse(
|
|
259
|
+
`Error in get_nodes_info: ${formatError(error)}\n\n⚠️ Figma 라이브러리가 최신 버전인지 확인해주세요.`,
|
|
260
|
+
);
|
|
256
261
|
}
|
|
257
262
|
},
|
|
258
263
|
);
|
|
@@ -276,12 +281,16 @@ export function registerTools(
|
|
|
276
281
|
});
|
|
277
282
|
|
|
278
283
|
if (!generated) {
|
|
279
|
-
return formatTextResponse(
|
|
284
|
+
return formatTextResponse(
|
|
285
|
+
"Failed to generate code\n\n⚠️ Figma 라이브러리가 최신 버전인지 확인해주세요.",
|
|
286
|
+
);
|
|
280
287
|
}
|
|
281
288
|
|
|
282
289
|
return formatTextResponse(`${generated.imports}\n\n${generated.jsx}`);
|
|
283
290
|
} catch (error) {
|
|
284
|
-
return
|
|
291
|
+
return formatTextResponse(
|
|
292
|
+
`Error in get_node_react_code: ${formatError(error)}\n\n⚠️ Figma 라이브러리가 최신 버전인지 확인해주세요.`,
|
|
293
|
+
);
|
|
285
294
|
}
|
|
286
295
|
},
|
|
287
296
|
);
|