tinypng
🧙🏻 Integrated TinyPNG MCP server, quickly use TinyPNG through LLMs.
claude mcp add --transport stdio aiyogg-tinypng-mcp-server bun /path/to/tinypng-mcp-server/src/index.ts \ --env TINYPNG_API_KEY="your-tinypng-api-key"
How to use
This MCP server exposes TinyPNG image compression capabilities through a small, programmable interface. It supports two primary tools: compress_local_image, which takes a local file path and writes a compressed image to a specified output path, and compress_remote_image, which takes an image URL, compresses the image, and saves it locally. The server is intended to be run with either bun or node, and it relies on the TinyPNG API key provided via the TINYPNG_API_KEY environment variable. Once running, you can programmatically call the provided tools from your MCP workflow or automation that integrates with MCP servers.
To use the server, ensure you have the server process started (via bun or node) with the required environment variable. Then, invoke the tool definitions described in the server's tooling docs. The local-compression tool accepts an imagePath, an optional outputPath, and an optional outputFormat, allowing you to control where the compressed image is saved and in which format. The remote-compression tool accepts an imageUrl, and similarly supports an outputPath and outputFormat for the resulting file. These tools are designed to be used in automation scenarios where you want to compress assets before distribution or storage.
How to install
Prerequisites:
- Node.js and/or Bun installed on your system
- Access to the TinyPNG API key
- Git and a working development environment for the MCP server
Step-by-step installation:
- Install dependencies and build
pnpm i
pnpm build
- Prepare configuration Create or edit mcp.json to configure the server entry point and API key. Example:
{
"mcpServers": {
"tinypng": {
"command": "bun", // or "node"
"args": ["/path/to/tinypng-mcp-server/src/index.ts"], // or "dist/index.js"
"env": {
"TINYPNG_API_KEY": "your-tinypng-api-key"
}
}
}
}
- Run the MCP server
# If using bun
bun /path/to/tinypng-mcp-server/src/index.ts
# If using node
node /path/to/tinypng-mcp-server/dist/index.js
- Verify operation Ensure the server starts without errors and that the TINYPNG_API_KEY is correctly picked up by the process.
Additional notes
Tips and common issues:
- Ensure your TinyPNG API key is active and has sufficient quotas for the calls you intend to make.
- If switching between bun and node, make sure the entry point path matches the selected runtime (src/index.ts for bun, dist/index.js for compiled output).
- If you encounter CORS or network issues, verify outbound connectivity from the host running the MCP server.
- For debugging, print or log the environment variables at startup to confirm the API key is loaded (without exposing it in logs in production).
- The server supports both local and remote compression workflows; tailor outputPath and outputFormat to fit your asset pipeline.
Related MCP Servers
mcp
Official PostHog MCP Server 🦔
furi
CLI & API for MCP management
medical
An MCP server that provides comprehensive medical information by querying multiple authoritative medical APIs including FDA, WHO, PubMed, Google Scholar, and RxNorm
prediction-market
A simple MCP server that grabs prediction market data from polymarket, PredictIt, & Kalshi.
mcp-bundler
Is the MCP configuration too complicated? You can easily share your own simplified setup!
CodeRAG
Advanced graph-based code analysis for AI-assisted software development