# Shortpixel — how to use (mcp.ai)

Connect your Shortpixel account and use 12 tools for images and design straight from your AI agent. Connect with your own API key. ShortPixel is an image optimization and compression service that offers APIs and plugins to enhance website performance by reducing image sizes without compromising quality.

## Option A — via MCP (recommended)
Remote MCP endpoint (HTTP, streamable): `https://api.mcp.ai/p_shortpixel?ms=1787295840000`
Add it as a custom/remote MCP connector in your client (Claude, Cursor, VS Code…), then authenticate when prompted. Once connected, ask the agent to use the server's tools (e.g. `shortpixel_add_cdn_domain`).

## Option B — via direct REST API
Base URL: `https://api.mcp.ai/api/shortpixel`
Auth: `Authorization: Bearer sk_live_…` — create a workspace API key at https://mcp.ai/settings/api-keys
Discover endpoints: `GET https://api.mcp.ai/api/shortpixel/_endpoints`

### Endpoints
- `POST https://api.mcp.ai/api/shortpixel/add/cdn/domain` — Tool to add a new domain to the ShortPixel CDN system and associate it with your API key. Use when you need to register a domain for CDN services. If the domain already exists without a user, it will 
  - body: { domain: string }
- `POST https://api.mcp.ai/api/shortpixel/bulk/purge/storage` — Tool to purge all files stored on ShortPixel storage servers for a domain. Use when you need to remove all stored files for a site in bulk.
  - body: { domain: string }
- `POST https://api.mcp.ai/api/shortpixel/check/image/status` — Tool to check the optimization status of an image being processed by ShortPixel. Returns current status of queued images including URLs and size information.
  - body: { url: string }
- `POST https://api.mcp.ai/api/shortpixel/clean/up/image` — Tool to remove images from the processing queue. Use when you need to optimize another image with the same URL but different contents within the next hour.
  - body: { urllist: string[] }
- `POST https://api.mcp.ai/api/shortpixel/get/adaptive/image/cdn` — Tool to optimize images on-the-fly via ShortPixel CDN. Transform images by URL with parameters for width, height, cropping, quality, and format conversion. Returns the optimized image directly without
  - body: { crop?: string, width?: integer, height?: integer, quality?: string, image_url: string, keep_exif?: boolean, to_format?: string, return_mode?: string }
- `POST https://api.mcp.ai/api/shortpixel/get/api/status` — Tool to retrieve the current status of your API key, including available credits. Use when you need to monitor your account usage before making additional API calls.
- `POST https://api.mcp.ai/api/shortpixel/get/cdn/usage` — Tool to retrieve detailed CDN usage statistics for a domain including traffic, API calls, monthly quota, remaining credits, and historical usage breakdown by date. Use when you need to monitor CDN con
  - body: { domain: string }
- `POST https://api.mcp.ai/api/shortpixel/optimize/images/by/url` — Tool to optimize images by providing their URLs. Supports batch processing of up to 100 URLs per request with options for lossy, glossy, or lossless compression, resizing, format conversion (WebP/AVIF
  - body: { wait?: integer, lossy?: string, resize?: string, refresh?: integer, upscale?: string, urllist: string[], cmyk2rgb?: integer, bg_remove?: string, convertto?: string, keep_exif?: integer, paramlist?: object[], resize_width?: integer, resize_height?: integer, plugin_version?: string, returndatalist?: string|integer|number|boolean|object[] }
- `POST https://api.mcp.ai/api/shortpixel/read/cdn/domain` — Tool to check the status of a domain and its CDN quota on ShortPixel. Returns a status code indicating credit availability. Use when you need to verify domain accessibility and quota status.
  - body: { domain: string }
- `POST https://api.mcp.ai/api/shortpixel/revoke/cdn/domain` — Tool to revoke a domain association from ShortPixel CDN. Only works if the API key belongs to the current domain owner. Use when you need to remove the association between a domain and the user accoun
  - body: { domain: string }
- `POST https://api.mcp.ai/api/shortpixel/set/cdn/domain` — Tool to associate an API key with an existing domain. Unlike add-domain, this does not create a new domain - it only associates a user ID if not already associated. Use when you need to claim unassoci
  - body: { domain: string }
- `POST https://api.mcp.ai/api/shortpixel/upload/and/optimize/images` — Tool to upload and optimize images that are not accessible online. Uses multipart form data to upload files directly and applies optimization parameters like compression type, resize options, and form
  - body: { file1: object, file2?: object, lossy?: integer, resize?: integer, convertto?: string, plugin_version?: string }

## Example prompts
- "What can I do in Shortpixel?"
- "Show me a summary of my Shortpixel account"

## More
- Page: https://mcp.ai/shortpixel
- Agent spec (llms.txt): https://mcp.ai/shortpixel/llms.txt
- Postman collection: https://mcp.ai/shortpixel/postman.json
