Model Context Protocol (MCP) สำหรับ AI
เชื่อมต่อ SmallPict เข้ากับ Claude Desktop, Cursor, Google Antigravity และผู้ช่วย AI
การเชื่อมต่อผ่าน Model Context Protocol (MCP)
SmallPict รองรับมาตรฐานเปิด Model Context Protocol (MCP) ที่พัฒนาขึ้น เพื่อช่วยให้ผู้ช่วยเขียนโค้ด AI สามารถจัดการและปรับแต่งไฟล์รูปภาพได้ตามคำสั่งภาษาธรรมชาติ
End-to-End Image Processing & Edge CDN Flow
Sub-50ms image optimization lifecycle from client upload to Cloudflare Enterprise edge delivery.
Client Application
WordPress / SDK / API
Uploads raw image binary with HMAC-SHA256 signature and UUID v4 idempotency key.
Cloudflare Edge CDN
Global Edge PoPs
Checks global edge cache. On cache HIT, delivers AVIF/WebP in <20ms worldwide.
SmallPict Go Gateway
AWS Lambda / API Gateway
Validates HMAC credentials, verifies quota limits, and scopes access to customer_id.
libvips SIMD Worker
High-Speed C-Engine
Multi-threaded quantization transcode to AVIF & WebP with 0 visual loss and ~88% compression.
S3 Pipeline & Storage
Global Object Store
Stores optimized output, invalidates outdated cache tags, and hydrates Cloudflare Edge.
🛠️ เครื่องมือ MCP ที่พร้อมใช้งาน
| เครื่องมือ | คำอธิบาย | พารามิเตอร์หลัก |
|---|---|---|
smallpict_optimize | ปรับแต่งรูปภาพในเครื่องหรือจาก URL เป็น AVIF/WebP | path, url, format, quality, max_width |
smallpict_get_quota | ตรวจสอบยอดโควตาคงเหลือและปริมาณการใช้งาน | ไม่มี (ใช้คีย์ที่กำหนดไว้) |
smallpict_purge_cdn | ล้างไฟล์ที่ระบุออกจากแคชของ Cloudflare CDN | urls (รายการ URL) |
⚙️ การตั้งค่าในโปรแกรมแก้ไข AI
1. Claude Desktop
เพิ่มการตั้งค่าลงในไฟล์ claude_desktop_config.json:
{ "mcpServers": { "smallpict": { "command": "npx", "args": [ "-y", "@smallpict/mcp" ], "env": { "SMALLPICT_API_KEY": "sp_sdk_your_key_here" } } }}2. Cursor IDE
ใน Cursor Settings > Features > MCP:
- Name: SmallPict
- Type:
command - Command:
npx -y @smallpict/mcp - Environment Variable:
SMALLPICT_API_KEY=sp_sdk_your_key_here
3. Google Antigravity
ในไฟล์การตั้งค่า (~/.gemini/antigravity/mcp/smallpict.json):
{ "command": "npx", "args": [ "-y", "@smallpict/mcp" ], "env": { "SMALLPICT_API_KEY": "sp_sdk_your_key_here" }}