ShortPixel Image Optimizer
com.shortpixel.mcp由 mcp.shortpixel.com 發布官方發布者v0.3.0更新於 Oct 24, 2026
Optimize public image URLs via the ShortPixel SPIO API for AI agents
概覽
一個遠端 MCP 伺服器,讓助理透過 ShortPixel SPIO API 最佳化公開圖片網址,支援壓縮、縮放與格式轉換等選項。
- 可以做什麼
- 透過 ShortPixel 最佳化一個或多個公開圖片網址,每次最多 100 個,回傳最佳化後的圖片位址與壓縮比例。可選擇壓縮等級(無損、有損、光澤)、等待時間、放大倍數,以及縮放模式和目標寬高。轉換格式(WebP、AVIF、JPG、PNG、GIF),移除背景,將 CMYK 轉為 RGB,並保留或移除 EXIF 中繼資料。支援依網址個別覆寫參數,並在回應中原樣回傳一個資料清單。
- 適用情境
- 適合助理處理網頁圖片時,在對話中直接完成壓縮、縮放、格式轉換或背景移除。也適合每次請求批次最佳化最多 100 個公開圖片網址。
- 執行需求
- 遠端端點 mcp.shortpixel.com,使用 Streamable HTTP,終端使用者無需本機安裝。需要 ShortPixel 帳號與 API 金鑰,透過 Authorization 的 bearer 權杖(或 X-ShortPixel-Api-Key 標頭)傳送。圖片網址必須可公開存取。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 ShortPixel Image Optimizer,將其新增到工作區。
- 連接 Authorization token 憑證。它們會被私密儲存,絕不會在公開頁面上展示。
- 為需要使用其工具的對話啟用該服務。
Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。
交給代理程式安裝
把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。
閱讀 https://sourceweft.com/mcp/com.shortpixel.mcp%2Foptimize/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。其他 MCP 客戶端
把它新增到你客戶端的 mcpServers 設定中。
{
"mcpServers": {
"shortpixel-image-optimizer": {
"type": "http",
"url": "https://mcp.shortpixel.com/mcp",
"headers": {
"Authorization": "Bearer <YOUR_TOKEN>"
}
}
}
}README
ShortPixel MCP Server
Public HTTP MCP server that exposes ShortPixel SPIO image optimization to AI agents (Cursor, Claude Desktop, VS Code, etc.).
Architecture
Each request carries the user's own ShortPixel API key. The MCP server does not store user keys — it forwards them to the public SPIO API.
Requirements
- Node.js 20+
- npm
Install (server)
Edit .env for server settings (port, allowed hosts, upstream API URL). Do not put user API keys in server .env.
Run
Endpoints:
Quick test (curl)
Server up, no API key:
API key present (simple check):
Use http:// (not https://) on port 3000 unless TLS is configured on nginx.
MCP request (important: Streamable HTTP clients must accept both JSON and SSE):
Authentication
Send the user's ShortPixel API key on every MCP request:
Alternative header:
Users without a key can get one at shortpixel.com.
Cursor setup (end user)
Replace the URL with your deployed host during development (e.g. http://localhost:3000/mcp).
Server environment variables
For internal ShortPixel development, set SHORTPIXEL_API_URL=https://devapi2.shortpixel.com/v2.
Request logging
Logs go to stdout, which the shortpixel-mcp systemd service redirects to /var/log/shortpixel/mcp.log (npm start shows them directly when running locally).
Default (LOG_FORMAT=text) — narrative flow you can follow:
LOG_MCP_PROTOCOL=false keeps only high-level app logs and hides MCP payload dumps.
Structured (LOG_FORMAT=json) — one JSON object per line:
API keys are masked (****abcd). Full keys are never logged.
Note: The chat prompt never reaches this server. The LLM (inside the MCP client) turns user text into a structured tools/call; the server only sees JSON-RPC arguments and maps them to the SPIO API.
Set LOG_LEVEL=debug for tools/list and extra HTTP lines.
Deploy
Runs as the shortpixel-mcp systemd service (unit file at /etc/systemd/system/shortpixel-mcp.service), which runs node dist/index.js directly (no pm2) and reads env vars from .env in the project directory (EnvironmentFile=).
Re-upload package.json and package-lock.json after each dependency change. If build still fails, run npm ci --include=dev (some servers set NODE_ENV=production which skips devDependencies).
Available MCP tools
optimize_image_urls arguments:
urls(required): Public image URLs to optimize (max 100)lossy: Compression level (0lossless,1lossy,2glossy)wait: Max wait seconds (0to return immediately,1-30to wait)upscale: Upscale factor (0,2,3,4)resize: Resize mode (0none,1outer,3inner,4smart crop)resize_width,resize_height: Resize target dimensions in pixelscmyk2rgb: Convert CMYK to RGB (1yes,0no)keep_exif: Keep EXIF metadata (1keep,0remove)convertto: Conversion value (+webp,+avif,+webp|+avif,webp|avif,jpg,png,gif)bg_remove: Background removal (1, image URL, or#rrggbbxx)refresh: Force source refetch (1) or use cached optimized data (0)paramlist: Per-URL overrides array (must matchurlslength)returndatalist: Any array echoed back unchanged in response
Project layout
Naming conventions
Scripts
來源:README.md,提交 a7e387d
工具
0版本歷史
1- v0.3.0最新Sep 16, 2026
評分
已滿足適用檢查項的 75%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通必需25 分
- 已宣告認證方式必需10 分
- 已列出工具必需15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分
請在儲存庫或註冊中心條目中宣告授權條款。