@seed-design/mcp 1.1.13 → 1.1.15
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 +1 -1
- package/package.json +2 -2
- package/src/bin/index.ts +4 -4
- package/src/tools.ts +7 -1
package/bin/index.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seed-design/mcp",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.15",
|
|
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.1.
|
|
26
|
+
"@seed-design/figma": "1.1.15",
|
|
27
27
|
"cac": "^6.7.14",
|
|
28
28
|
"uuid": "^13.0.0",
|
|
29
29
|
"ws": "^8.18.1",
|
package/src/bin/index.ts
CHANGED
|
@@ -8,7 +8,7 @@ import { createFigmaWebSocketClient } from "../websocket";
|
|
|
8
8
|
import { registerEditingTools, registerTools } from "../tools";
|
|
9
9
|
import { registerPrompts } from "../prompts";
|
|
10
10
|
import { version } from "../../package.json" with { type: "json" };
|
|
11
|
-
import type {
|
|
11
|
+
import type { ServerWebSocket } from "bun";
|
|
12
12
|
import { loadConfig, type McpConfig } from "../config";
|
|
13
13
|
|
|
14
14
|
// Initialize CLI
|
|
@@ -53,7 +53,7 @@ async function startWebSocketServer(port: number) {
|
|
|
53
53
|
port,
|
|
54
54
|
// uncomment this to allow connections in windows wsl
|
|
55
55
|
// hostname: "0.0.0.0",
|
|
56
|
-
fetch(req
|
|
56
|
+
fetch(req, server) {
|
|
57
57
|
// Handle CORS preflight
|
|
58
58
|
if (req.method === "OPTIONS") {
|
|
59
59
|
return new Response(null, {
|
|
@@ -83,7 +83,7 @@ async function startWebSocketServer(port: number) {
|
|
|
83
83
|
},
|
|
84
84
|
websocket: {
|
|
85
85
|
open: handleWebSocketConnection,
|
|
86
|
-
message(ws
|
|
86
|
+
message(ws, message) {
|
|
87
87
|
try {
|
|
88
88
|
console.log("Received message from client:", message);
|
|
89
89
|
const data = JSON.parse(message as string);
|
|
@@ -176,7 +176,7 @@ async function startWebSocketServer(port: number) {
|
|
|
176
176
|
console.error("Error handling message:", err);
|
|
177
177
|
}
|
|
178
178
|
},
|
|
179
|
-
close(ws
|
|
179
|
+
close(ws) {
|
|
180
180
|
// Remove client from their channel
|
|
181
181
|
channels.forEach((clients) => {
|
|
182
182
|
clients.delete(ws);
|
package/src/tools.ts
CHANGED
|
@@ -346,7 +346,13 @@ export function registerEditingTools(server: McpServer, figmaClient: FigmaWebSoc
|
|
|
346
346
|
async ({ nodeId, x, y }) => {
|
|
347
347
|
try {
|
|
348
348
|
const result = await sendCommandToFigma("clone_node", { nodeId, x, y });
|
|
349
|
-
const typedResult = result as {
|
|
349
|
+
const typedResult = result as {
|
|
350
|
+
id: string;
|
|
351
|
+
originalId: string;
|
|
352
|
+
x?: number;
|
|
353
|
+
y?: number;
|
|
354
|
+
success: boolean;
|
|
355
|
+
};
|
|
350
356
|
return formatTextResponse(
|
|
351
357
|
`Cloned node with new ID: ${typedResult.id}${x !== undefined && y !== undefined ? ` at position (${x}, ${y})` : ""}`,
|
|
352
358
|
);
|