@scayver/specshot-mcp-server 0.5.0 → 0.7.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/README.md CHANGED
@@ -24,8 +24,8 @@ node dist/index.js
24
24
  versions and workspaces. Always run `npm run build`. Rebuild after any src
25
25
  change. The server prints a startup
26
26
  banner to stderr with its version and target URL, so a stale dist is visible at
27
- a glance: `[specshot-mcp] v0.5.0 -> https://specshot.cc`. If the banner shows an
28
- old version, rebuild. The 0.5.0 server exposes the full workspace toolset
27
+ a glance: `[specshot-mcp] v0.6.0 -> https://specshot.cc`. If the banner shows an
28
+ old version, rebuild. The 0.6.0 server exposes the full workspace toolset
29
29
  (roughly 37 tools); seeing only 13 tools means you are running a 0.3.0 dist.
30
30
 
31
31
  After publishing, npx works with no install:
package/dist/index.js CHANGED
@@ -8,7 +8,8 @@ import { registerInspirationTools } from "./tools/inspiration.js";
8
8
  import { registerWireframeTools } from "./tools/wireframe.js";
9
9
  import { registerMessageTools } from "./tools/messages.js";
10
10
  import { registerWorkspaceTools } from "./tools/workspace.js";
11
- const VERSION = "0.5.0";
11
+ import { registerCanvasTools } from "./tools/canvas.js";
12
+ const VERSION = "0.7.0";
12
13
  const token = process.env.SPECSHOT_API_TOKEN;
13
14
  const baseUrl = process.env.SPECSHOT_APP_URL ?? "https://specshot.cc";
14
15
  if (!token) {
@@ -26,5 +27,6 @@ registerInspirationTools(server, client);
26
27
  registerWireframeTools(server, client);
27
28
  registerMessageTools(server, client);
28
29
  registerWorkspaceTools(server, client);
30
+ registerCanvasTools(server, client);
29
31
  const transport = new StdioServerTransport();
30
32
  await server.connect(transport);
@@ -0,0 +1,50 @@
1
+ import { z } from "zod";
2
+ function ok(data) {
3
+ return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
4
+ }
5
+ function fail(message) {
6
+ return { content: [{ type: "text", text: `Error: ${message}` }], isError: true };
7
+ }
8
+ export function registerCanvasTools(server, client) {
9
+ server.tool("get_selection", 'What the user has selected on the SpecShot build canvas RIGHT NOW: the project, the design they have open, the active frame and its width, and the exact section or layer they have highlighted (with its stable id, SS-SEC-... / SS-LYR-...). Call this FIRST whenever the user says "this section", "this screen", "here", or "what I\'m looking at" — it resolves the reference without asking them. Returns selection: null with a hint when no canvas is open. Reports ageSeconds and stale so you can tell a live selection from a forgotten tab. Read-only.', { projectId: z.string().optional() }, async ({ projectId }) => {
10
+ try {
11
+ return ok(await client.get("/api/mcp/canvas", { action: "selection", projectId }));
12
+ }
13
+ catch (e) {
14
+ return fail(e instanceof Error ? e.message : "Failed to read the selection.");
15
+ }
16
+ });
17
+ server.tool("list_frames", "The frames on the user's canvas board: what each points at, where it sits, how wide it is, who placed it, and whether you may close it. Call it before create_frame to see how many of the 6 slots are free, and to get the frameKey close_frame needs.", { projectId: z.string(), boardConceptId: z.string().optional() }, async ({ projectId, boardConceptId }) => {
18
+ try {
19
+ return ok(await client.get("/api/mcp/canvas", { action: "frames", projectId, boardConceptId }));
20
+ }
21
+ catch (e) {
22
+ return fail(e instanceof Error ? e.message : "Failed to list frames.");
23
+ }
24
+ });
25
+ server.tool("create_frame", "Place a design on the user's canvas board, beside what they are already looking at. This is how your work becomes VISIBLE: save_wireframe stores a design, create_frame makes it appear on screen. Call it once per variation. Set viewport to show it at a phone (390px), tablet (768px), or desktop (1440px) width. Omit x and y to auto-place it to the right of everything else. A board holds 6 frames. Requires a read/write token.", {
26
+ projectId: z.string(),
27
+ boardConceptId: z.string().optional(),
28
+ sourceConceptId: z.string().optional(),
29
+ sourceVersionId: z.string().optional(),
30
+ title: z.string().optional(),
31
+ viewport: z.enum(["mobile", "tablet", "desktop"]).optional(),
32
+ x: z.number().optional(),
33
+ y: z.number().optional(),
34
+ }, async (args) => {
35
+ try {
36
+ return ok(await client.post("/api/mcp/canvas", { action: "create_frame", ...args }));
37
+ }
38
+ catch (e) {
39
+ return fail(e instanceof Error ? e.message : "Failed to create the frame.");
40
+ }
41
+ });
42
+ server.tool("close_frame", "Remove a frame you placed from the user's canvas board, by frameKey (see list_frames). You can only close agent-placed frames: a frame the user added is theirs. Requires a read/write token.", { projectId: z.string(), boardConceptId: z.string().optional(), frameKey: z.string() }, async (args) => {
43
+ try {
44
+ return ok(await client.post("/api/mcp/canvas", { action: "close_frame", ...args }));
45
+ }
46
+ catch (e) {
47
+ return fail(e instanceof Error ? e.message : "Failed to close the frame.");
48
+ }
49
+ });
50
+ }
package/package.json CHANGED
@@ -1,8 +1,15 @@
1
1
  {
2
2
  "name": "@scayver/specshot-mcp-server",
3
- "version": "0.5.0",
4
- "description": "MCP server for SpecShot — lets Claude Code, Claude Desktop, and Cursor fetch approved design concepts with brand tokens and a ready-to-build prompt.",
5
- "keywords": ["mcp", "model-context-protocol", "specshot", "claude", "design", "ai"],
3
+ "version": "0.7.0",
4
+ "description": "MCP server for SpecShot \u2014 lets Claude Code, Claude Desktop, and Cursor fetch approved design concepts with brand tokens and a ready-to-build prompt.",
5
+ "keywords": [
6
+ "mcp",
7
+ "model-context-protocol",
8
+ "specshot",
9
+ "claude",
10
+ "design",
11
+ "ai"
12
+ ],
6
13
  "homepage": "https://specshot.cc",
7
14
  "repository": {
8
15
  "type": "git",
@@ -17,7 +24,10 @@
17
24
  "bin": {
18
25
  "specshot-mcp": "./dist/index.js"
19
26
  },
20
- "files": ["dist", "README.md"],
27
+ "files": [
28
+ "dist",
29
+ "README.md"
30
+ ],
21
31
  "engines": {
22
32
  "node": ">=18"
23
33
  },
@@ -25,6 +35,7 @@
25
35
  "access": "public"
26
36
  },
27
37
  "scripts": {
38
+ "prebuild": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\"",
28
39
  "build": "tsc",
29
40
  "dev": "tsc --watch",
30
41
  "start": "node dist/index.js",