webcake-landing-mcp 1.18.3 → 1.18.4

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.
@@ -89,7 +89,7 @@ function activateApp(name) {
89
89
  return;
90
90
  // Re-focus by process name via System Events (works for terminals whose app
91
91
  // name differs from the process, e.g. iTerm/Terminal/Warp/VS Code).
92
- execFile("osascript", ["-e", `tell application "System Events" to set frontmost of (first application process whose name is "${name.replace(/"/g, '\\"')}") to true`], () => { });
92
+ execFile("osascript", ["-e", `tell application "System Events" to set frontmost of (first application process whose name is "${name.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}") to true`], () => { });
93
93
  }
94
94
  const SUCCESS_HTML = `<!doctype html><html lang="en"><head><meta charset="utf-8">
95
95
  <meta name="viewport" content="width=device-width,initial-scale=1"><title>Connected to Webcake</title>
@@ -1,4 +1,11 @@
1
1
  [
2
+ {
3
+ "v": "1.18.4",
4
+ "d": "02/12/2026",
5
+ "type": "Fixed",
6
+ "en": "render_preview no longer accepts a per-request x-render-screenshot-base header to choose which screenshot proxy host this server calls, since a…",
7
+ "vi": "render_preview nay không còn nhận header x-render-screenshot-base theo từng request để chọn host proxy chụp ảnh mà server này gọi, vì một caller từ…"
8
+ },
2
9
  {
3
10
  "v": "1.18.3",
4
11
  "d": "01/12/2026",
@@ -33,12 +40,5 @@
33
40
  "type": "Fixed",
34
41
  "en": "The hosted remote-connector OAuth flow now rejects Dynamic Client Registration and /authorize requests whose redirect_uri is not a known MCP client…",
35
42
  "vi": "Luồng OAuth của remote connector đã hosted nay từ chối các yêu cầu Dynamic Client Registration và /authorize có redirect_uri không phải callback của…"
36
- },
37
- {
38
- "v": "1.17.0",
39
- "d": "28/11/2026",
40
- "type": "Fixed",
41
- "en": "clone_page and ingest_html/ingest_url with intent:'clone' now dismiss cookie/consent/newsletter banners, promo modals and chat widgets (clicking…",
42
- "vi": "clone_page và ingest_html/ingest_url với intent:'clone' nay bỏ các lớp cookie/consent/newsletter, modal quảng cáo và widget chat (bấm nút chấp…"
43
43
  }
44
44
  ]
@@ -33,12 +33,6 @@ export function resolveScreenshotProxyBase(override) {
33
33
  const base = override ?? process.env.RENDER_SCREENSHOT_BASE;
34
34
  return base && base.trim() !== "" ? base.replace(/\/+$/, "") : undefined;
35
35
  }
36
- /** Pull the per-request proxy base header (remote mode), if present. */
37
- export function screenshotProxyBaseFromHeaders(headers) {
38
- const v = headers?.["x-render-screenshot-base"];
39
- const raw = Array.isArray(v) ? v[0] : v;
40
- return raw && raw.trim() !== "" ? raw.trim() : undefined;
41
- }
42
36
  /** Which engine to try FIRST: "microlink" (free, default) or "proxy" (the keyed/self-hosted route). */
43
37
  export function resolveScreenshotPrimary(override) {
44
38
  const v = (override ?? process.env.RENDER_SCREENSHOT_PRIMARY ?? "").toLowerCase();
@@ -192,6 +192,10 @@ export function registerApiGatewayTools(server) {
192
192
  const missingPath = pathParams(o.path).filter((p) => params[p] == null || params[p] === "");
193
193
  if (missingPath.length)
194
194
  return { ok: false, error: `Missing path_params: ${missingPath.join(", ")}. Call sheet: api_find({ id: "${o.id}" }).` };
195
+ // encodeURIComponent keeps "." / "..", and the URL parser would resolve them onto another (refused) route.
196
+ const dotted = pathParams(o.path).filter((p) => /^\.{1,2}$/.test(String(params[p])));
197
+ if (dotted.length)
198
+ return { ok: false, error: `Invalid path_params: ${dotted.join(", ")} cannot be "." or "..".` };
195
199
  const path = o.path.replace(/:(\w+)/g, (_, p) => encodeURIComponent(String(params[p])));
196
200
  const input = o.method === "GET" ? args.query || {} : args.body || {};
197
201
  const missing = (o.required || []).filter((k) => input[k] === undefined);
@@ -28,7 +28,7 @@ import { homedir } from "node:os";
28
28
  import { fileURLToPath } from "node:url";
29
29
  import { text, image, images } from "../mcp/response.js";
30
30
  import { searchPexels, searchImagesViaProxy, resolvePexelsKey, resolvePexelsProxyBase, pexelsKeyFromHeaders, annotateVariantSizes, IMAGE_SIZE_GUIDE, } from "../persistence/pexels-client.js";
31
- import { captureScreenshot, captureScreenshotTiles, resolveScreenshotProxyBase, screenshotProxyBaseFromHeaders, resolveMicrolinkKey, microlinkKeyFromHeaders, } from "../persistence/screenshot-client.js";
31
+ import { captureScreenshot, captureScreenshotTiles, resolveScreenshotProxyBase, resolveMicrolinkKey, microlinkKeyFromHeaders, } from "../persistence/screenshot-client.js";
32
32
  import { uploadImageMultipart, uploadImagePreferCollection, resolveCollectionOrgId, listOrganizations, } from "../persistence/webcake-client.js";
33
33
  import { resolveIconSvg } from "../persistence/icon-client.js";
34
34
  import { sniffMime } from "../persistence/rehost.js";
@@ -252,7 +252,7 @@ export function registerMediaTools(server, allowLocalFiles = true) {
252
252
  });
253
253
  });
254
254
  // 13c) Render a page/URL to a screenshot the model can SEE --------------------
255
- server.tool("render_preview", "Renders a public URL to a PNG screenshot and returns it as an image. `page_id` targets a created page's preview URL (/preview/<id>); `url` targets any public page and takes precedence. full_page (default true) captures the whole scrollable page and `width` sets the viewport; `tiles:true` returns a tall page as several top-to-bottom band images (requires a self-hosted Playwright host via RENDER_SCREENSHOT_BASE, otherwise a single image is returned). Engine: Microlink's free tier by default (API: https://microlink.io/docs/api/getting-started/overview; about 50 requests/day per IP — when rate-limited the result is ok:false with HTTP 429), or a self-hosted screenshot proxy set by RENDER_SCREENSHOT_BASE / x-render-screenshot-base; MICROLINK_API_KEY / x-microlink-key raises the quota. A page published without a custom domain serves its preview for about 10 minutes after the last publish; after that the preview shows 'Preview page is expired'. Docs: https://github.com/vuluu2k/webcake-landing-mcp/blob/main/docs/tools.md", {
255
+ server.tool("render_preview", "Renders a public URL to a PNG screenshot and returns it as an image. `page_id` targets a created page's preview URL (/preview/<id>); `url` targets any public page and takes precedence. full_page (default true) captures the whole scrollable page and `width` sets the viewport; `tiles:true` returns a tall page as several top-to-bottom band images (requires a self-hosted Playwright host via RENDER_SCREENSHOT_BASE, otherwise a single image is returned). Engine: Microlink's free tier by default (API: https://microlink.io/docs/api/getting-started/overview; about 50 requests/day per IP — when rate-limited the result is ok:false with HTTP 429), or a self-hosted screenshot proxy set by RENDER_SCREENSHOT_BASE; MICROLINK_API_KEY / x-microlink-key raises the quota. A page published without a custom domain serves its preview for about 10 minutes after the last publish; after that the preview shows 'Preview page is expired'. Docs: https://github.com/vuluu2k/webcake-landing-mcp/blob/main/docs/tools.md", {
256
256
  page_id: z.string().optional().describe("A created page's id — screenshots its /preview/<id> URL (built from the preview base). Provide page_id OR url."),
257
257
  url: z.string().optional().describe("Any public http(s) URL to screenshot (e.g. the reference page being cloned). Wins over page_id."),
258
258
  full_page: z.boolean().optional().describe("Capture the whole scrollable page (default true) vs just the viewport."),
@@ -268,7 +268,8 @@ export function registerMediaTools(server, allowLocalFiles = true) {
268
268
  return text({ ok: false, error: "Pass `page_id` (to shoot its /preview/<id>) or `url`." });
269
269
  }
270
270
  const resolved = {
271
- proxyBase: resolveScreenshotProxyBase(screenshotProxyBaseFromHeaders(headers)),
271
+ // The proxy host is the operator's (env), never a caller header: a remote caller would pick where this server sends requests.
272
+ proxyBase: resolveScreenshotProxyBase(),
272
273
  microlinkKey: resolveMicrolinkKey(microlinkKeyFromHeaders(headers)),
273
274
  };
274
275
  // Tiles mode (tall pages): a stack of readable top→bottom bands. Needs a
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webcake-landing-mcp",
3
- "version": "1.18.3",
3
+ "version": "1.18.4",
4
4
  "description": "MCP server exposing Webcake landing-page element schemas + AI usage hints, and persisting LLM-generated page sources to a Webcake backend.",
5
5
  "mcpName": "io.github.vuluu2k/webcake-landing-mcp",
6
6
  "type": "module",