ShortPixel MCP Server
OfficialShortPixel MCP Server
Public HTTP MCP server that exposes ShortPixel SPIO image optimization to AI agents (Cursor, Claude Desktop, VS Code, etc.).
Architecture
AI client (Cursor, Claude, …)
│
│ MCP over HTTPS (Streamable HTTP)
▼
https://mcp.shortpixel.com/mcp
│
│ user's API key in Authorization header
▼
ShortPixel SPIO API (api.shortpixel.com)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.
Related MCP server: img-convert MCP Server
Requirements
Node.js 20+
npm
Install (server)
npm ci
npm run build
cp .env.example .envEdit .env for server settings (port, allowed hosts, upstream API URL). Do not put user API keys in server .env.
Run
npm startEndpoints:
Path | Method | Description |
| GET | 상태 확인 (API 키 불필요) |
| GET | 인증 확인 — API 키 헤더가 있으면 ok 반환 |
| POST | MCP 스트리밍 가능 HTTP 엔드포인트 |
Quick test (curl)
Server up, no API key:
curl http://mcp.shortpixel.com:3000/healthAPI key present (simple check):
curl -i -H "Authorization: Bearer YOUR_API_KEY" http://mcp.shortpixel.com:3000/pingUse http:// (not https://) on port 3000 unless TLS is configured on nginx.
MCP request (important: Streamable HTTP clients must accept both JSON and SSE):
curl -s -N -X POST http://mcp.shortpixel.com:3000/mcp \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}'Authentication
Send the user's ShortPixel API key on every MCP request:
Authorization: Bearer <shortpixel_api_key>Alternative header:
X-ShortPixel-Api-Key: <shortpixel_api_key>Users without a key can get one at shortpixel.com.
Cursor setup (end user)
{
"mcpServers": {
"shortpixel": {
"url": "https://mcp.shortpixel.com/mcp",
"headers": {
"Authorization": "Bearer YOUR_SHORTPIXEL_API_KEY"
}
}
}
}Replace the URL with your deployed host during development (e.g. http://localhost:3000/mcp).
Server environment variables
Variable | Required | Default | Description |
| no |
| HTTP 수신 포트 |
| no | — | 쉼표로 구분된 Host 헤더 허용 목록 (프로덕션에서 권장) |
| no |
| 업스트림 SPIO API 기본 URL |
| no |
| SPIO로 전송되는 플러그인 버전 |
| no |
| 로그 상세도: |
| no |
|
|
| no |
| 인바운드/아웃바운드 MCP JSON-RPC 페이로드 로깅 |
For internal ShortPixel development, set SHORTPIXEL_API_URL=https://devapi2.shortpixel.com/v2.
Request logging
Logs go to stdout (pm2 logs / npm start).
Default (LOG_FORMAT=text) — 따라갈 수 있는 내러티브 흐름:
[2026-06-30 15:01:53] [1/5] → CLIENT | HTTP POST /mcp | JSON-RPC request: "initialize" (client connects) | id: 0
{
"jsonrpc": "2.0",
"method": "initialize",
"id": 0,
"params": { ... }
}
[2026-06-30 15:01:53] [1/5] ← SERVER | HTTP POST /mcp 200 | JSON-RPC response: "initialize" (client connects)
[2026-06-30 15:01:53] [2/5] → CLIENT | HTTP POST /mcp | JSON-RPC request: "notifications/initialized" (session ready, no response body expected) | id: null
[2026-06-30 15:01:53] [2.5/5] → CLIENT | HTTP POST /mcp | JSON-RPC request: "tools/list" (client asks which tools exist) | id: 1
[2026-06-30 15:01:53] [2.5/5] ← SERVER | HTTP POST /mcp 200 | JSON-RPC response: "tools/list" (client asks which tools exist) | tools discovered: optimize_image_urls
[2026-06-30 15:02:18] [3/5] → CLIENT | HTTP POST /mcp | JSON-RPC request: "tools/call" (client runs a tool) | id: 2 | tool: "optimize_image_urls"
[2026-06-30 15:02:18] [4/5] MCP → SPIO API: POST reducer.php (args mapped to SPIO payload) | ...
[2026-06-30 15:02:35] [5/5] MCP ← SPIO API: Success | reduction: 27.41% | optimized: http://api.shortpixel.com/f/...-lossy.jpg | original: ...
[2026-06-30 15:02:35] [3/5] ← SERVER | HTTP POST /mcp 200 | JSON-RPC response: "tools/call" (client runs a tool) | tool: optimize_image_urls
{ "jsonrpc": "2.0", "id": 2, "result": { ... } }
[2026-06-30 15:02:35] ✓ round-trip done (16.3s)LOG_MCP_PROTOCOL=false는 상위 수준 앱 로그만 유지하고 MCP 페이로드 덤프를 숨깁니다.
Structured (LOG_FORMAT=json) — 줄당 하나의 JSON 객체:
Event | When |
| 모든 요청 (메서드, 경로, 상태, 지속 시간, MCP 메서드/도구) |
| SPIO |
| SPIO 결과 요약 (상태, 개선율 %) |
| API 키가 없는 요청 |
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.
pm2 logs shortpixel-mcp
# or
npm startSet LOG_LEVEL=debug for tools/list and extra HTTP lines.
Deploy on dev server
cd /xxx/mcp.shortpixel.com
npm ci
npm run build
cp .env.example .env
# set ALLOWED_HOSTS and PORT, then run behind nginx with TLS
npm startRe-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
Tool | Description |
| SPIO reducer API를 통해 하나 이상의 공개 이미지 URL을 최적화합니다. |
optimize_image_urls arguments:
urls(required): 최적화할 공개 이미지 URL (최대 100개)lossy: 압축 수준 (0무손실,1손실,2광택)wait: 최대 대기 시간(초) (0즉시 반환,1-30대기)upscale: 업스케일 계수 (0,2,3,4)resize: 크기 조정 모드 (0없음,1외부,3내부,4스마트 크롭)resize_width,resize_height: 크기 조정 대상 치수(픽셀)cmyk2rgb: CMYK를 RGB로 변환 (1예,0아니오)keep_exif: EXIF 메타데이터 유지 (1유지,0제거)convertto: 변환 값 (+webp,+avif,+webp|+avif,webp|avif,jpg,png,gif)bg_remove: 배경 제거 (1, 이미지 URL, 또는#rrggbbxx)refresh: 소스 다시 가져오기 강제 (1) 또는 캐시된 최적화 데이터 사용 (0)paramlist: URL별 재정의 배열 (urls길이와 일치해야 함)returndatalist: 응답에서 변경 없이 반향되는 모든 배열
Project layout
src/index.ts HTTP server entry point
src/http/auth.ts API key extraction from requests
src/mcp/create-mcp-server.ts Per-request MCP server factory
src/clients/spio-api-client.ts ShortPixel SPIO HTTP client
src/tools/spio-tools.ts MCP tools
src/http/request-log-middleware.ts HTTP request logging
src/logging/request-logger.ts Structured JSON logger
src/logging/mcp-protocol-log.ts MCP protocol payload capture/normalizeNaming conventions
Kind | Style | Example |
파일 | kebab-case |
|
클래스 | PascalCase |
|
메서드 | camelCase |
|
Scripts
Command | Description |
| TypeScript를 |
| HTTP MCP 서버 실행 |
| tsx로 실행 (빌드 단계 없음) |
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables AI assistants to download images from URLs and perform basic image optimization tasks.21818Apache 2.0
- Alicense-qualityDmaintenanceProvides AI agents with tools to convert images between formats and inspect image metadata, enabling seamless image processing within agent workflows.83MIT

@metricspot/mcp-serverofficial
Alicense-qualityFmaintenanceExposes SEO and AI-readability audit tools to AI agents, enabling one-shot anonymous audits or full authenticated audits with PDF reports and organic traffic data.66MIT- FlicenseAqualityDmaintenanceExposes the OctoBoost SEO API as MCP tools so agents can audit websites with compact, structured results instead of fetching and parsing raw HTML.486
Related MCP Connectors
SEO research, audits, backlinks, GSC, and content workflow tools for AI agents.
Zero-auth MCP: image optimize, cited storage/format data, and dev utilities LLMs get wrong.
URL intelligence for AI agents and developers. 16 tools, 25 signal weights, 20 free checks.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/short-pixel-optimizer/com.shortpixel.mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server