Files
gitmost/packages/mcp/build
vvzvlad 334a50f003 feat(mcp): fetch insert_image/replace_image sources from web URLs
The insert_image and replace_image MCP tools previously uploaded only
local files (filePath), which an AI MCP client cannot provide — it has
no access to the server filesystem. Replace filePath with a required
imageUrl and download the image over http(s).

- client.ts: add fetchRemoteImage(url, maxBytes) — http/https-only scheme
  allowlist, 20 MiB cap (maxContentLength + post-download length recheck),
  30s timeout, Content-Type→MIME resolution with URL-extension fallback,
  filename derivation with canonical extension
- client.ts: rewrite uploadImage(pageId, url) as URL-only; drop the
  local-file branch, imageMimeFromPath and the fs import; insertImage/
  replaceImage now take a url
- index.ts: drop filePath, add required imageUrl to both tools; update
  tool descriptions and SERVER_INSTRUCTIONS
- README: document the web-URL behaviour
2026-06-18 01:28:23 +03:00
..