home / mcp / image tools mcp server
A Model Context Protocol (MCP) service for retrieving image dimensions, supporting both URL and local file sources.
Configuration
View docs{
"mcpServers": {
"kshern-image-tools-mcp": {
"command": "npx",
"args": [
"image-tools-mcp"
],
"env": {
"TINIFY_API_KEY": "<YOUR_TINIFY_API_KEY>",
"FIGMA_API_TOKEN": "<YOUR_FIGMA_API_TOKEN>"
}
}
}
}You can retrieve image dimensions from URLs or local files, compress images using the TinyPNG API, and convert images to webp, jpeg/jpg, or png formats with Image Tools MCP. It exposes a small set of tools you can call from an MCP client to measure, optimize, and fetch image data across remote and local sources.
Connect to the Image Tools MCP server from your MCP client. You will access five tools that let you measure image dimensions, compress images, and fetch image links from Figma for compression.
Available tools and what they do: get_image_size retrieves dimensions for remote images, get_local_image_size reads dimensions for local files, compress_image_from_url compresses a remote image, compress_local_image compresses a local image, and figma fetches image links from a Figma file and prepares them for compression.
Prerequisites: you need Node.js and npm installed on your system.
Start the MCP server using the standard MCP command shown in the examples. This runs locally and keeps the server ready to accept tool calls from your MCP client.
npx image-tools-mcpTo connect your MCP client to this server, configure the MCP connection with the following JSON snippet. It uses a local stdio transport and includes the required environment variables for image compression and Figma access.
{
"mcpServers": {
"image_tools": {
"command": "npx",
"args": ["image-tools-mcp"],
"env": {
"TINIFY_API_KEY": "<YOUR_TINIFY_API_KEY>",
"FIGMA_API_TOKEN": "<YOUR_FIGMA_API_TOKEN>"
}
}
}
}The following environment variables are required for compression and Figma integration. Provide real values in your deployment: - TINIFY_API_KEY: Your TinyPNG API key used for image compression. - FIGMA_API_TOKEN: Your Figma API token used to fetch image links.
- get_image_size: Get dimensions for a remote image via its URL. - get_local_image_size: Get dimensions for a local image file. - compress_image_from_url: Compress a remote image and optionally convert to a different format. - compress_local_image: Compress a local image and optionally specify an output path and format. - figma: Fetch image links from a Figma file and prepare them for compression.
Example results show width, height, type, MIME type, and compression details for each operation, including paths or temporary files when relevant.
If compression tools are not registered, ensure the TINIFY_API_KEY is provided. If the Figma tool is unavailable, verify the FIGMA_API_TOKEN.
Retrieve dimensions for a remote image given its URL, returning width, height, type, and MIME type.
Retrieve dimensions for a local image file, returning width, height, type, MIME type, and file path.
Compress a remote image using the TinyPNG API and optionally convert to a target format such as webp, jpeg/jpg, or png; returns original and compressed sizes and the path to the compressed file.
Compress a local image file using the TinyPNG API, with optional output path and format; returns original and compressed sizes and the output format.
Fetch image links from a Figma file and prepare them for compression via TinyPNG API.