image-tools-mcp
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
Image Tools MCP
A Model Context Protocol (MCP) service for retrieving image dimensions and compressing images, supporting both URL and local file sources.
Features
- Retrieve image dimensions from URLs
- Get image dimensions from local files
- Compress images from URLs using TinyPNG API
- Compress local images using TinyPNG API
- Convert images to different formats (webp, jpeg/jpg, png)
- Returns width, height, type, MIME type, and compression information
Installation
Usage
Using as an MCP Service
This service provides four tool functions:
get_image_size
- Get dimensions of remote imagesget_local_image_size
- Get dimensions of local imagescompress_image_from_url
- Compress remote images using TinyPNG APIcompress_local_image
- Compress local images using TinyPNG API
Client Integration
To use this MCP service, you need to connect to it from an MCP client. Here are examples of how to integrate with different clients:
Using with Claude Desktop
- Install Claude Desktop from claude.ai/download
- Get TinyPNG API key: Visit TinyPNG and get your API key
- Configure Claude Desktop to use this MCP server by editing the configuration file:
- Restart Claude Desktop
- Ask Claude to get image dimensions: "Can you tell me the dimensions of this image: https://example.com/image.jpg?"
- Ask Claude to compress an image: "Can you compress this image: https://example.com/image.jpg?"
- Ask Claude to compress a local image: "Can you compress this image: D:/path/to/image.png?"
- Ask Claude to compress a local image folder: "Can you compress this folder: D:/imageFolder?"
Using with MCP Client Library
Tool Schemas
get_image_size
get_local_image_size
compress_image_from_url
compress_local_image
Technical Implementation
This project is built on the following libraries:
- probe-image-size - For image dimension detection
- tinify - For image compression via the TinyPNG API
Environment Variables
TINIFY_API_KEY
- Required for image compression functionality. Get your API key from TinyPNG
License
MIT
This server cannot be installed
Image Tools MCP is a Model Context Protocol (MCP) service that retrieves image dimensions and compresses images from URLs and local files using the TinyPNG API. It supports converting images to formats like webp, jpeg/jpg, and png, providing detailed information on width, height, type, and compressi