Skip to content
plugmcp
DirectorySkillsCategoriesBlog
EN/中文
Sign inSign up
Home/Servers/ShortPixel Image Optimizer

ShortPixel Image Optimizer

by com.shortpixel.mcp

Optimize public image URLs via the ShortPixel SPIO API for AI agents

Power your agent

Add this server

The publisher's own URL. Not a PlugMCP endpoint.

Server URL
https://mcp.shortpixel.com/mcp
Provider
Add in Claude

Claude opens with the name and URL filled in. You still confirm it there.

Claude Code
claude mcp add --transport http com.shortpixel.mcp-optimize https://mcp.shortpixel.com/mcp

Run in a terminal.

Claude Desktop
{
  "mcpServers": {
    "com.shortpixel.mcp-optimize": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "https://mcp.shortpixel.com/mcp"
      ]
    }
  }
}

claude_desktop_config.json

Step-by-step: add this in Claude

Remote URL or a command on your machine? How the two installs differ

Run on PlugMCP

Host a copy with our keys and logs.

A new server you create. It is not this listing's official endpoint. Use the publisher install when you want their URL and their credentials.

Launch

Related MCP

View more
  • Firecrawl🔥 Official Firecrawl MCP Server - Adds powerful web scraping and search to Cursor, Claude and any other LLM clients.
  • N
    NotionToken-auth Notion MCP: pages, databases, blocks, comments, files. Runs headless in CI and agents.
  • Context7Context7 Platform -- Up-to-date code documentation for LLMs and AI code editors

Related skills

View all
  • reaReverse engineer anything with agents, from app behavior down to native binaries.
  • rea-changelog-updatePrepare or rewrite REA release changelogs and GitHub release notes from pinned Git history, with verified contributor thanks and Release Please synchronization.
  • rea-tool-designDesign or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.

Optimize public image URLs via the ShortPixel SPIO API for AI agents

ShortPixel 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.

Requirements

  • Node.js 20+
  • npm

Install (server)

npm ci
npm run build
cp .env.example .env

Edit .env for server settings (port, allowed hosts, upstream API URL). Do not put user API keys in server .env.

Run

npm start

Endpoints:

PathMethodDescription
/healthGETHealth check (no API key)
/pingGETAuth check — returns ok if API key header is present
/mcpPOSTMCP Streamable HTTP endpoint

Quick test (curl)

Server up, no API key:

curl http://mcp.shortpixel.com:3000/health

API key present (simple check):

curl -i -H "Authorization: Bearer YOUR_API_KEY" http://mcp.shortpixel.com:3000/ping

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):

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

VariableRequiredDefaultDescription
PORTno3000HTTP listen port
ALLOWED_HOSTSno—Comma-separated Host header allowlist (recommended in production)
SHORTPIXEL_API_URLnohttps://api.shortpixel.com/v2Upstream SPIO API base URL
SHORTPIXEL_PLUGIN_VERSIONnoMCP01Plugin version sent to SPIO
LOG_LEVELnoinfoLog verbosity: debug, info, warn, error
LOG_FORMATnotexttext = human-readable lines; json = structured JSON
LOG_MCP_PROTOCOLnotrueLog inbound/outbound MCP JSON-RPC payloads

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:

[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 keeps only high-level app logs and hides MCP payload dumps.

Structured (LOG_FORMAT=json) — one JSON object per line:

EventWhen
http_requestEvery request (method, path, status, duration, MCP method/tool)
spio_requestOutgoing call to SPIO reducer.php
spio_responseSPIO result summary (status, % improvement)
mcp_auth_missingRequest without API key

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.

tail -f /var/log/shortpixel/mcp.log
# or, running locally
npm start

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=).

cd /web/mcp.shortpixel.com   # liveVPS; a separate host from the rest of the PHP stack
npm ci
npm run build
# edit .env directly on the server (not deployed - gitignored)
sudo systemctl restart shortpixel-mcp
sudo systemctl status shortpixel-mcp

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

ToolDescription
optimize_image_urlsOptimize one or more public image URLs via SPIO reducer API

optimize_image_urls arguments:

  • urls (required): Public image URLs to optimize (max 100)
  • lossy: Compression level (0 lossless, 1 lossy, 2 glossy)
  • wait: Max wait seconds (0 to return immediately, 1-30 to wait)
  • upscale: Upscale factor (0, 2, 3, 4)
  • resize: Resize mode (0 none, 1 outer, 3 inner, 4 smart crop)
  • resize_width, resize_height: Resize target dimensions in pixels
  • cmyk2rgb: Convert CMYK to RGB (1 yes, 0 no)
  • keep_exif: Keep EXIF metadata (1 keep, 0 remove)
  • 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 match urls length)
  • returndatalist: Any array echoed back unchanged in response

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/normalize

Naming conventions

KindStyleExample
Fileskebab-casespio-api-client.ts
ClassesPascalCaseSpioApiClient
MethodscamelCaseoptimizeUrls

Scripts

CommandDescription
npm run buildCompile TypeScript to dist/
npm startRun HTTP MCP server
npm run devRun with tsx (no build step)
How do I install ShortPixel Image Optimizer?
Copy the http config for Cursor, Claude Desktop, Claude Code, or VS Code on this page. It uses the publisher's install, not a PlugMCP proxy.
Does ShortPixel Image Optimizer need an API key?
No required environment variable is listed on this record.
What transport does ShortPixel Image Optimizer use?
ShortPixel Image Optimizer is reached over HTTP.
When was ShortPixel Image Optimizer last checked?
Last checked 2026-10-16. Optimize public image URLs via the ShortPixel SPIO API for AI agents

No tool list yet. Remote servers get one after the first health check.

plugmcp

Plug any tool into any agent. MCP servers for people who do not write servers. Gateway for volume, n8n for apps.

  • github.com/TODO
  • x.com/TODO
  • linkedin.com/company/TODO

PlugMCP, 2026

Product
  • Browse
  • Install
  • Host your own
  • Voice mode
  • Browser
Directory
  • All MCP servers
  • Agent skills
  • Categories
  • New
  • Voice
  • Submit a server
Developers
  • Docs
  • Blog
  • What is MCP
  • What is WebMCP
  • Status
Company
  • About
  • Contact
  • Terms
  • Privacy
  • DPA