# TinyPNG — how to use (mcp.ai)

Connect your TinyPNG account and use 5 tools for images and design straight from your AI agent. Connect with your own API key. TinyPNG uses smart lossy compression techniques to reduce the file size of your WebP, JPEG, and PNG files.

## Option A — via MCP (recommended)
Remote MCP endpoint (HTTP, streamable): `https://api.mcp.ai/p_tinypng?ms=1787293440000`
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. `tinypng_get_compression_count`).

## Option B — via direct REST API
Base URL: `https://api.mcp.ai/api/tinypng`
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/tinypng/_endpoints`

### Endpoints
- `POST https://api.mcp.ai/api/tinypng/get/compression/count` — Tool to retrieve the number of compressions made this month. Use when you need to monitor your TinyPNG API usage.
- `POST https://api.mcp.ai/api/tinypng/shrink/and/get/image/id` — Tool to shrink an image and return its TinyPNG image ID. Use when you need only the compressed image identifier from the API response Location header.
  - body: { source_url: string }
- `POST https://api.mcp.ai/api/tinypng/tinify/compress/and/store/in/azure` — Compress an image using the Tinify API and upload the optimized result directly to Azure Blob Storage in a single operation. The image is first compressed by Tinify, then uploaded to the specified Azu
  - body: { source_url: string, azure_blob_url: string }
- `POST https://api.mcp.ai/api/tinypng/tinify/output` — Tool to retrieve a compressed image by its image ID. Use after compressing an image to download the result.
  - body: { id: string }
- `POST https://api.mcp.ai/api/tinypng/transform/image` — Tool to transform a compressed image by resizing, converting format, preserving metadata, or storing to cloud storage. Use when you have an image ID from a previous compression and need to apply trans
  - body: { id: string, store?: object, resize?: object, convert?: object, preserve?: string[], transform?: object }

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

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