Logo Webflow Mcp:Compress Cms Image

Webflow Mcp:Compress Cms Image

Tổ chức
webflow
webflow-mcp:compress-cms-image

Nén và chuyển đổi các trường hình ảnh của mục CMS sang webp hoặc avif trong bộ sưu tập Webflow. Yêu cầu ID bộ sưu tập, ID mục, các trường hình ảnh, chất lượng và định dạng đích, sau đó tải ảnh xuống, chuyển đổi, tải lại qua S3 được cấp URL ký sẵn và xuất bản mục đã cập nhật.

Add to TypingMind

Tổng quan

Nhà phát hànhwebflow
Kho mãwebflow-skills
Tên kỹ năngwebflow-mcp:compress-cms-image
Sao
122
Bản fork
18
Tệp đi kèm
Chỉ có hướng dẫn
Giấy phépMIT
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • Hướng dẫn có đủ mọi thứ cần thiết

    Mọi thứ mô hình cần đều nằm trong hướng dẫn — không có tệp bổ sung cần đồng bộ.

  • Mã nguồn mở

    Được webflow công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Webflow Mcp:Compress Cms Image trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/webflow/webflow-skills/tree/main/plugins/webflow-skills/skills/webflow-compress-cms-image
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/webflow/webflow-skills.git /tmp/webflow-skills
mkdir -p .claude/skills
cp -r /tmp/webflow-skills/plugins/webflow-skills/skills/webflow-compress-cms-image .claude/skills/webflow-webflow-mcp-compress-cms-image
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Webflow Mcp:Compress Cms Image trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp Webflow Mcp:Compress Cms Image ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng Webflow Mcp:Compress Cms Image với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

Webflow CMS Image Compression

Compress and reformat image fields on a Webflow CMS item to .webp or .avif.

This skill does not support images embedded inside Rich Text fields at this time. Tell the user that limitation before starting and only process CMS fields whose schema type is Image or MultiImage.

Important Note

ALWAYS use Webflow MCP tools for Webflow operations:

  • Use Webflow MCP's data_sites_tool with action list_sites to discover the site ID when needed
  • Use Webflow MCP's data_cms_tool with action get_collection_details to fetch collection schemas
  • Use Webflow MCP's data_cms_tool with action list_collection_items to fetch the target CMS item
  • Use Webflow MCP's data_assets_tool with action create_asset to create presigned asset uploads
  • Use Webflow MCP's data_cms_tool with action update_collection_items to update CMS image fields
  • Use Webflow MCP's data_cms_tool with action publish_collection_items to publish the updated item
  • All Webflow MCP calls must include the required context parameter (15-25 words, third-person perspective)
  • Mutating operations require explicit user confirmation. Ask the user to type confirm before uploading assets, updating CMS fields, or publishing.
  • Rich Text embedded images are not supported. Do not parse or rewrite Rich Text HTML for image compression.

Instructions

Phase 1: Gather Parameters

Collect all required inputs in one shot when possible:

  1. Collection ID: Ask "What is the Collection ID?"
  2. Item ID: Ask "What is the Item ID?"
  3. Image fields: Ask "Which image fields should be compressed?"
    • "All image fields" - compress every Image or MultiImage field found on the item
    • "Specify field names" - user will name specific field slugs
  4. Target format: Ask "Target format?"
    • "webp (Recommended)" - best browser support, good compression
    • "avif" - better compression, slightly less support
  5. Quality (1-100): Ask "Quality (1-100)?"
    • "85 - Recommended (webp)" - visually lossless for most photos
    • "75 - Recommended (avif)" - avif is efficient at lower quality
    • "Custom" - user types their own value

If the user chose "Specify field names", follow up for comma-separated field slugs. If the user chose "Custom" quality, follow up for the numeric value. Validate custom quality is an integer from 1 to 100.

Phase 2: Discover Image Fields

  1. Call data_cms_tool with action get_collection_details and the collection ID.
  2. Filter fields where type === "Image" or type === "MultiImage".
  3. Select target fields:
    • If the user chose "All image fields", use every Image and MultiImage field found.
    • If the user named specific fields, validate each slug exists and is an Image or MultiImage field.
    • Warn and skip requested fields that do not exist or are not image fields.
  4. Stop and report if no valid image fields remain.

Phase 3: Fetch the CMS Item

Call data_cms_tool with action list_collection_items to fetch the target item. Use the item ID to identify the item directly when the tool supports it; otherwise filter or search the returned items.

Extract current fieldData for each target field:

  • For Image fields, capture url and fileId.
  • For MultiImage fields, capture each array entry's url and fileId.
  • Skip null, empty, or malformed image values.
  • Skip images already in the target format unless the user explicitly asks to recompress them.

Phase 4: Preview and Confirm

Before downloading or uploading anything, show a preview:

markdown
Compression Preview

Collection: [collection ID]
Item: [item ID]
Target format: webp
Quality: 85

Fields to process:
- main-image: hero.jpg -> hero.webp
- gallery: 3 images -> webp

Skipped:
- thumbnail: already webp

Type `confirm` to download, convert, upload, update the CMS item, and publish.

Proceed only after the user types confirm.

Phase 5: Convert Each Image

For each image:

  1. Download to /tmp/:
bash
curl -sL "{url}" -o "/tmp/cms_img_{fieldSlug}_{index}.orig"
  1. Ensure Pillow is available:
bash
python3 -c "from PIL import Image" 2>/dev/null || pip3 install Pillow -q

For avif, also try:

bash
pip3 install pillow-avif-plugin -q
  1. Convert with the user's quality setting:
bash
python3 - <<'EOF'
from PIL import Image
import os

try:
    import pillow_avif
except ImportError:
    pass

source = "/tmp/cms_img_{fieldSlug}_{index}.orig"
target = "/tmp/cms_img_{fieldSlug}_{index}.{ext}"
img = Image.open(source)
img.save(target, "{FORMAT}", quality={quality})
orig = os.path.getsize(source)
new = os.path.getsize(target)
print(f"Original: {orig:,} bytes -> {FORMAT}: {new:,} bytes ({(1 - new / orig) * 100:.1f}% smaller)")
EOF

If avif conversion fails, report the error and ask whether to fall back to webp or abort.

  1. Compute the MD5 hash of the converted file:
bash
md5 -q "/tmp/cms_img_{fieldSlug}_{index}.{ext}"

On Linux:

bash
md5sum "/tmp/cms_img_{fieldSlug}_{index}.{ext}" | cut -d' ' -f1

Phase 6: Upload to Webflow Assets

For each converted file:

  1. Determine site_id. If it is not known from the collection or prior context, call data_sites_tool with action list_sites. If multiple sites are available, ask the user which one owns the collection.
  2. Call data_assets_tool with action create_asset:
    • site_id: the target site ID
    • file_name: original base name plus the new extension, such as hero.webp
    • file_hash: the MD5 hex string
  3. Capture the response values:
    • uploadUrl: S3 endpoint
    • uploadDetails: form fields
    • id: new asset ID
    • hostedUrl: CDN URL to use as the CMS source reference
  4. POST to S3 as multipart/form-data. Map uploadDetails keys to curl fields:
    • xAmzAlgorithm -> X-Amz-Algorithm
    • xAmzCredential -> X-Amz-Credential
    • xAmzDate -> X-Amz-Date
    • xAmzSignature -> X-Amz-Signature
    • successActionStatus -> success_action_status
    • contentType -> Content-Type
    • cacheControl -> Cache-Control
    • Pass acl, bucket, key, and policy as-is
    • Append the file last: -F "file=@/tmp/cms_img_{fieldSlug}_{index}.{ext};type=image/{ext}"
  5. Expect HTTP 201. If the response is not 201, log the response body and report the upload error. Presigned URLs have a one-hour TTL; restart from asset creation if the URL expires.

Phase 7: Update and Publish

Call data_cms_tool with action update_collection_items using only fields that were successfully converted and uploaded.

For Image fields, set:

json
{
  "fieldSlug": {
    "fileId": "{newAssetId}",
    "url": "{hostedUrl}"
  }
}

For MultiImage fields, reconstruct the full image array and replace only successfully processed entries with the new { "fileId", "url" } values. Preserve skipped entries exactly as they were.

After a successful update, call data_cms_tool with action publish_collection_items for the item ID. The CMS may re-process the image and generate its own CDN URL; the hostedUrl from the asset upload is the source reference.

Phase 8: Report Results

Print a concise summary table:

FieldOriginalConvertedSavings
main-image118,044 B (JPEG)113,260 B (webp)4.1%

Also report:

  • Fields skipped because they were null, empty, malformed, already in the target format, or not image fields
  • Conversion failures and whether the user chose fallback or abort
  • Upload failures, including response bodies when available
  • New asset IDs for uploads that succeeded when a later CMS update or publish failed

Examples

User prompt:

text
Compress the main image on this CMS item to webp.

Response flow:

markdown
I need the collection ID, item ID, image fields, target format, and quality before compressing the CMS image.

Compression Preview

Collection: 65f...
Item: 66a...
Target format: webp
Quality: 85

Fields to process:
- main-image: blog-hero.jpg -> blog-hero.webp

Type `confirm` to download, convert, upload, update the CMS item, and publish.

Final report:

markdown
CMS Image Compression Complete

| Field | Original | Converted | Savings |
|-------|----------|-----------|---------|
| main-image | 842,911 B (JPEG) | 214,330 B (webp) | 74.6% |

Updated and published item 66a...

Guidelines

  • Handle one CMS item at a time. For bulk operations across many items, rerun the skill for each item or extend the workflow with an explicit loop.
  • Do not delete the original JPEG or PNG from Webflow's asset store; only update the CMS field reference.
  • Preserve filenames by stripping the original extension and appending the target extension. Avoid double extensions such as hero.jpg.webp.
  • Continue processing other selected fields after a single image conversion or upload failure unless the failed field is the only target.
  • Never update or publish the CMS item if no image was successfully converted and uploaded.
  • Keep a local in-memory rollback note with the original image field values and include it in the final report when an update succeeds.

Câu hỏi thường gặp

Kỹ năng AI Webflow Mcp:Compress Cms Image làm được gì?

Nén và chuyển đổi các trường hình ảnh của mục CMS sang webp hoặc avif trong bộ sưu tập Webflow. Yêu cầu ID bộ sưu tập, ID mục, các trường hình ảnh, chất lượng và định dạng đích, sau đó tải ảnh xuống, chuyển đổi, tải lại qua S3 được cấp URL ký sẵn và xuất bản mục đã cập nhật.

Vì sao nên dùng Webflow Mcp:Compress Cms Image trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Webflow Mcp:Compress Cms Image là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Webflow Mcp:Compress Cms Image trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/webflow/webflow-skills/tree/main/plugins/webflow-skills/skills/webflow-compress-cms-image. TypingMind đọc tệp SKILL.md rồi cài đặt kỹ năng để bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Webflow Mcp:Compress Cms Image?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng Webflow Mcp:Compress Cms Image với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Webflow Mcp:Compress Cms Image với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Webflow Mcp:Compress Cms Image có miễn phí không?

Có. Kỹ năng này được webflow phát hành trên GitHub theo giấy phép MIT. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇