MCP Server — Agentic Image Optimization
Install the tinify.ai MCP Server locally via npm or connect to the remote HTTP endpoint. Compress, resize, upscale, and tag images from any MCP-compatible AI editor.
MCP Server
The tinify.ai MCP Server exposes image optimization as a tool callable by any MCP-compatible AI host. It supports both local stdio (installed via npm) and remote HTTP.
Install
npx -y @tinify-ai/mcp-serverOr install globally:
npm install -g @tinify-ai/mcp-server
tinify-mcpRemote HTTP endpoint (no install):
https://app.tinify.ai/mcpCore concepts
Local stdio vs remote HTTP
| Mode | Command | Auth | Use when |
|---|---|---|---|
| Local stdio | npx -y @tinify-ai/mcp-server | Guest or logged-in | Claude Code, Cursor, Windsurf, Copilot, Codex |
| Remote HTTP | https://app.tinify.ai/mcp | Device code flow | ChatGPT, any HTTP MCP host |
optimize_image tool
The primary tool. Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
image_path | string | Yes | Absolute path to the image file |
operation | string | No | "auto" (default), "compress", "resize", "upscale", "tag" |
format | string | No | "jpg", "png", "webp", "avif" — leave unset to keep original |
width | number | No | Target width in pixels (resize only) |
height | number | No | Target height in pixels (resize only) |
output_path | string | No | Destination path — defaults to overwriting the source |
Example call:
{
"tool": "optimize_image",
"arguments": {
"image_path": "/Users/me/project/hero.png",
"operation": "compress",
"format": "webp"
}
}Auth tools
| Tool | Purpose |
|---|---|
login | Opens browser → device code flow → stores token at ~/.tinify/session.json |
logout | Revokes token and deletes ~/.tinify/session.json |
status | Shows current tier, credits remaining, reset time |
Auth flow
Guest mode works with no auth — 20 credits/day. To use credits from your tinify.ai account:
- In your AI editor, call the
logintool - A browser window opens to
https://tinify.ai/mcp/authorize?code=TINI-XXXX-XXXX - Log in (if needed) and click Approve
- The MCP server receives your token — credits now come from your account
Platforms using this surface
External links
- npm: npmjs.com/package/@tinify-ai/mcp-server
- Remote MCP: app.tinify.ai/mcp
API & Integrations — Agentic Image Optimization
Integrate tinify.ai programmatically via MCP Server (primary) or x402 pay-per-request. No REST API key required for MCP.
Open Plugin — Agentic Image Optimization
Install the tinify.ai Open Plugin for Claude Code, GitHub Copilot, or Codex. Agent-native image optimization via the OpenAI plugin spec.