@avocadostudio-ai/mcp-server 0.3.2 → 0.4.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 +1 -1
- package/dist/tools/history.js +19 -0
- package/dist/tools/publishing.js +12 -3
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -14,7 +14,7 @@ Each install is scoped to **one site**: `(session, siteId)` are bound at launch
|
|
|
14
14
|
| Sites | `avocado-register-site`, `avocado-list-sites`, `avocado-get-site-config`, `avocado-update-site-config` |
|
|
15
15
|
| Media | `avocado-upload-image`, `avocado-generate-image`, `avocado-search-unsplash`, `avocado-transcribe-audio`, `avocado-interpret-image` |
|
|
16
16
|
| Publishing | `avocado-compute-publish-diff`, `avocado-publish-content`, `avocado-get-publish-status`, `avocado-list-snapshots`, `avocado-restore-snapshot` |
|
|
17
|
-
| History | `avocado-undo-edit`, `avocado-redo-edit`, `avocado-restore-version` |
|
|
17
|
+
| History | `avocado-undo-edit`, `avocado-redo-edit`, `avocado-restore-version`, `avocado-discard-changes` |
|
|
18
18
|
| Planner | `avocado-chat-plan`, `avocado-preview-plan`, `avocado-approve-pending-plan`, `avocado-discard-pending-plan` |
|
|
19
19
|
| Preview | `avocado-screenshot-page` — returns a full-page JPEG inline (visual feedback channel for chat-only hosts like Claude Desktop) |
|
|
20
20
|
|
package/dist/tools/history.js
CHANGED
|
@@ -34,4 +34,23 @@ export function registerHistoryTools(server, client) {
|
|
|
34
34
|
return errorResult(err);
|
|
35
35
|
}
|
|
36
36
|
});
|
|
37
|
+
server.tool("avocado-discard-changes", [
|
|
38
|
+
"Throw away changes from the history log. Each affected page is rolled back to the state it held immediately before the earliest version selected on it.",
|
|
39
|
+
"A page has one timeline, so discarding a change also discards the later changes to that same page — the response lists them under `discarded[].alsoDiscarded`. Pages you did not select keep their edits.",
|
|
40
|
+
"Versions with nothing recorded before them come back under `skipped` rather than being guessed at. The discard itself is undoable.",
|
|
41
|
+
].join("\n"), {
|
|
42
|
+
versions: z
|
|
43
|
+
.array(z.number().int().positive())
|
|
44
|
+
.min(1)
|
|
45
|
+
.describe("Version numbers from the history log to discard."),
|
|
46
|
+
}, async ({ versions }) => {
|
|
47
|
+
try {
|
|
48
|
+
return jsonResult(await client.request("POST", "/history/discard", {
|
|
49
|
+
body: client.scopedBody({ versions }),
|
|
50
|
+
}));
|
|
51
|
+
}
|
|
52
|
+
catch (err) {
|
|
53
|
+
return errorResult(err);
|
|
54
|
+
}
|
|
55
|
+
});
|
|
37
56
|
}
|
package/dist/tools/publishing.js
CHANGED
|
@@ -13,15 +13,24 @@ export function registerPublishingTools(server, client) {
|
|
|
13
13
|
return errorResult(err);
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
|
-
server.tool("avocado-publish-content",
|
|
16
|
+
server.tool("avocado-publish-content", [
|
|
17
|
+
"Publish the current draft to the live site. Requires AVOCADO_PUBLISH_TOKEN env var (the orchestrator's DRAFT_MODE_SECRET) to be set on the MCP server process.",
|
|
18
|
+
"Pass `slugs` to publish only those pages — every other page keeps exactly what it has live. Omit it to publish the whole draft.",
|
|
19
|
+
].join("\n"), {
|
|
17
20
|
siteOrigin: z.string().url().optional(),
|
|
18
|
-
|
|
21
|
+
slugs: z.array(z.string()).optional().describe("Publish only these page slugs, leaving every other page as it is on the live site. Omit for a full publish."),
|
|
22
|
+
includeSiteConfig: z.boolean().optional().describe("Whether the site header/nav ships with this publish. Defaults to true."),
|
|
23
|
+
}, async ({ siteOrigin, slugs, includeSiteConfig }) => {
|
|
19
24
|
if (!client.config.publishToken) {
|
|
20
25
|
return errorResult(new Error("AVOCADO_PUBLISH_TOKEN is not set on the MCP server. Re-install the connector with --env AVOCADO_PUBLISH_TOKEN=<DRAFT_MODE_SECRET>."));
|
|
21
26
|
}
|
|
22
27
|
try {
|
|
23
28
|
return jsonResult(await client.request("POST", "/publish", {
|
|
24
|
-
body: client.scopedBody({
|
|
29
|
+
body: client.scopedBody({
|
|
30
|
+
siteOrigin,
|
|
31
|
+
...(slugs && slugs.length > 0 ? { slugs } : {}),
|
|
32
|
+
...(includeSiteConfig === false ? { includeSiteConfig: false } : {}),
|
|
33
|
+
}),
|
|
25
34
|
bearer: client.config.publishToken,
|
|
26
35
|
}));
|
|
27
36
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@avocadostudio-ai/mcp-server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Avocado Studio MCP server — exposes page/block/discovery tools over the Model Context Protocol.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
43
43
|
"zod": "^4.3.6",
|
|
44
|
-
"@avocadostudio-ai/shared": "^0.
|
|
44
|
+
"@avocadostudio-ai/shared": "^0.4.0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@types/node": "^22.13.10",
|