Agentic Image Optimization in the Terminal
Run the tinify.ai MCP Server from the terminal on macOS or Windows. Compress, resize, upscale, and tag images via CLI or scripts.
Agentic Image Optimization in the Terminal
Run tinify.ai's MCP Server directly from the terminal — useful for scripting, CI pipelines, or using with a local MCP client.
Requirements
- Node.js ≥ 18
Install
macOS / Linux
npx -y @tinify-ai/mcp-serverOr install globally:
npm install -g @tinify-ai/mcp-server
tinify-mcpWindows (PowerShell)
npx -y @tinify-ai/mcp-serverOr globally:
npm install -g @tinify-ai/mcp-server
tinify-mcpNote: paths use backslashes on Windows — use C:\Users\me\project\hero.png, not ~/project/hero.png.
Verify
macOS / Linux
npx -y @tinify-ai/mcp-server --versionExpected:
@tinify-ai/mcp-server 1.x.xWindows (PowerShell)
npx -y @tinify-ai/mcp-server --versionSame expected output.
Usage example
Start the MCP Server and connect with a local MCP client (e.g., mcp-cli):
macOS / Linux
# Start server on stdio
npx -y @tinify-ai/mcp-server
# Call optimize_image via mcp-cli (separate terminal)
mcp-cli call optimize_image '{"image_path":"/home/user/hero.png","operation":"compress","format":"webp"}'Windows (PowerShell)
# Start server on stdio
npx -y @tinify-ai/mcp-server
# Call optimize_image via mcp-cli
mcp-cli call optimize_image '{"image_path":"C:\\Users\\me\\hero.png","operation":"compress","format":"webp"}'Auth
Guest mode: 20 credits/day, no signup. For account credits, call the login tool:
mcp-cli call login '{}'A browser opens to https://tinify.ai/mcp/authorize. Log in and approve. Pricing →
Troubleshooting
npx: command not found (macOS/Linux)
Install Node.js from nodejs.org or via brew install node.
'npx' is not recognized (Windows)
Install Node.js from nodejs.org. Ensure Node is in your PATH: node --version should return a version number.
Insufficient credits error
20 free credits/day, resets at midnight UTC. Upgrade →