@scayver/specshot-mcp-server 0.14.0 → 0.22.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.
@@ -6,11 +6,25 @@ function ok(data) {
6
6
  function fail(message) {
7
7
  return { content: [{ type: "text", text: `Error: ${message}` }], isError: true };
8
8
  }
9
+ const deploys = (projectId, rest = "") => `/api/mcp/projects/${encodeURIComponent(projectId)}/wordpress/deploys${rest ? `/${rest}` : ""}`;
10
+ async function run(work, label) {
11
+ try {
12
+ return ok(await work());
13
+ }
14
+ catch (e) {
15
+ return fail(e instanceof Error ? e.message : label);
16
+ }
17
+ }
9
18
  /**
10
19
  * SpecShot for WordPress: the sites connected to a project through the SpecShot plugin, with
11
- * whether each runs Automatic.css, over the REST route /api/mcp/projects/[id]/wordpress. The hosted
12
- * endpoint registers the same tool from apps/web/src/lib/mcp/wordpress.ts, and the description
13
- * comes from the generated tool-descriptions.ts, so the two transports cannot drift.
20
+ * whether each runs Automatic.css, over the REST route /api/mcp/projects/[id]/wordpress; and drafts
21
+ * to WordPress (the owner, 2026-11-05): send approved pages to a paired site as drafts, read the
22
+ * deploys and one deploy's progress, and cancel one that has not gone live, over the routes under
23
+ * /api/mcp/projects/[id]/wordpress/deploys. Go live and Roll back are a person's click in SpecShot;
24
+ * no tool reaches them. The hosted endpoint registers the same tools from
25
+ * apps/web/src/lib/mcp/wordpress-tools.ts, and the descriptions come from the generated
26
+ * tool-descriptions.ts, so the two transports cannot drift. The server runs the portal's own rules
27
+ * and checks every argument.
14
28
  */
15
29
  export function registerWordPressTools(server, client) {
16
30
  server.tool("list_wordpress_sites", toolDescription("list_wordpress_sites"), { projectId: z.string() }, async ({ projectId }) => {
@@ -21,4 +35,20 @@ export function registerWordPressTools(server, client) {
21
35
  return fail(e instanceof Error ? e.message : "Failed to list the project's WordPress sites.");
22
36
  }
23
37
  });
38
+ server.tool("send_to_wordpress", toolDescription("send_to_wordpress"), {
39
+ projectId: z.string(),
40
+ siteId: z.string(),
41
+ designIds: z.array(z.string()).optional(),
42
+ siteRunId: z.string().optional(),
43
+ pageIds: z.array(z.string()).optional(),
44
+ postTypes: z.array(z.string()).optional(),
45
+ }, async ({ projectId, ...rest }) => run(() => client.post(deploys(projectId), rest), "Failed to send the pages to WordPress."));
46
+ server.tool("list_wordpress_deploys", toolDescription("list_wordpress_deploys"), {
47
+ projectId: z.string(),
48
+ designId: z.string().optional(),
49
+ pageId: z.string().optional(),
50
+ siteRunId: z.string().optional(),
51
+ }, async ({ projectId, designId, pageId, siteRunId }) => run(() => client.get(deploys(projectId), { designId, pageId, siteRunId }), "Failed to read the project's deploys to WordPress."));
52
+ server.tool("get_wordpress_deploy", toolDescription("get_wordpress_deploy"), { projectId: z.string(), deployId: z.string() }, async ({ projectId, deployId }) => run(() => client.get(deploys(projectId, encodeURIComponent(deployId))), "Failed to read the deploy."));
53
+ server.tool("cancel_wordpress_deploy", toolDescription("cancel_wordpress_deploy"), { projectId: z.string(), deployId: z.string() }, async ({ projectId, deployId }) => run(() => client.post(deploys(projectId, `${encodeURIComponent(deployId)}/cancel`), {}), "Failed to cancel the deploy."));
24
54
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scayver/specshot-mcp-server",
3
- "version": "0.14.0",
3
+ "version": "0.22.0",
4
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
5
  "keywords": [
6
6
  "mcp",