Skip to main content
Glama

Herramientas de imagen MCP

insignia de herrería

Un servicio de Protocolo de Contexto de Modelo (MCP) para recuperar dimensiones de imágenes y comprimir imágenes, compatible con fuentes de archivos locales y URL.

中文文档

Características

  • Recuperar dimensiones de imágenes a partir de URL

  • Obtener las dimensiones de la imagen desde archivos locales

  • Comprimir imágenes desde URL usando la API TinyPNG

  • Comprimir imágenes locales usando la API TinyPNG

  • Convertir imágenes a diferentes formatos (webp, jpeg/jpg, png)

  • Devuelve información de ancho, alto, tipo, tipo MIME y compresión.

Resultados de ejemplo

Ejemplo Resultado 1Ejemplo Resultado 2

Descargar desde la URL de Figma y comprimirEjemplo Resultado 3

Related MCP server: test-1

Uso

Utilizando como servicio MCP

Este servicio proporciona cinco funciones de herramienta:

  1. get_image_size - Obtener las dimensiones de las imágenes remotas

  2. get_local_image_size - Obtener las dimensiones de las imágenes locales

  3. compress_image_from_url - Comprime imágenes remotas usando la API TinyPNG

  4. compress_local_image : comprime imágenes locales usando la API TinyPNG

  5. figma : obtiene enlaces de imágenes de la API de Figma y los comprime usando la API TinyPNG

Integración de clientes

Para usar este servicio MCP, debe conectarse desde un cliente MCP. A continuación, se muestran ejemplos de integración con diferentes clientes:

Uso con Claude Desktop

  1. Instalar Claude Desktop desde claude.ai/download

  2. Obtenga la clave API de TinyPNG: Visite TinyPNG y obtenga su clave API

  3. Configure Claude Desktop para utilizar este servidor MCP editando el archivo de configuración:

{
  "mcpServers": {
    "image-tools": {
      "command": "npx",
      "args": ["image-tools-mcp"],
      "env": {
        "TINIFY_API_KEY": "<YOUR_TINIFY_API_KEY>",
        "FIGMA_API_TOKEN": "<YOUR_FIGMA_API_TOKEN>"
      }
    }
  }
}
  1. Reiniciar Claude Desktop

  2. Pídele a Claude que obtenga las dimensiones de la imagen: "¿Puedes decirme las dimensiones de esta imagen: https://example.com/image.jpg ?"

  3. Pídele a Claude que comprima una imagen: "¿Puedes comprimir esta imagen: https://example.com/image.jpg ? "

  4. Pídele a Claude que comprima una imagen local: "¿Puedes comprimir esta imagen: D:/path/to/image.png?"

  5. Pídele a Claude que comprima una carpeta de imágenes local: "¿Puedes comprimir esta carpeta: D:/imageFolder?"

  6. Pídele a Claude que obtenga enlaces de imágenes de la API de Figma: "¿Puedes obtener enlaces de imágenes de la API de Figma: https://www.figma.com/file/XXXXXXX ?"

Uso con la biblioteca de cliente MCP

import { McpClient } from "@modelcontextprotocol/client";

// Initialize the client
const client = new McpClient({
  transport: "stdio" // or other transport options
});

// Connect to the server
await client.connect();

// Get image dimensions from URL
const urlResult = await client.callTool("get_image_size", {
  options: {
    imageUrl: "https://example.com/image.jpg"
  }
});
console.log(JSON.parse(urlResult.content[0].text));
// Output: { width: 800, height: 600, type: "jpg", mime: "image/jpeg" }

// Get image dimensions from local file
const localResult = await client.callTool("get_local_image_size", {
  options: {
    imagePath: "D:/path/to/image.png"
  }
});
console.log(JSON.parse(localResult.content[0].text));
// Output: { width: 1024, height: 768, type: "png", mime: "image/png", path: "D:/path/to/image.png" }

// Compress image from URL
const compressUrlResult = await client.callTool("compress_image_from_url", {
  options: {
    imageUrl: "https://example.com/image.jpg",
    outputFormat: "webp" // Optional: convert to webp, jpeg/jpg, or png
  }
});
console.log(JSON.parse(compressUrlResult.content[0].text));
// Output: { originalSize: 102400, compressedSize: 51200, compressionRatio: "50.00%", tempFilePath: "/tmp/compressed_1615456789.webp", format: "webp" }

// Compress local image
const compressLocalResult = await client.callTool("compress_local_image", {
  options: {
    imagePath: "D:/path/to/image.png",
    outputPath: "D:/path/to/compressed.webp", // Optional
    outputFormat: "image/webp" // Optional: convert to image/webp, image/jpeg, or image/png
  }
});
console.log(JSON.parse(compressLocalResult.content[0].text));
// Output: { originalSize: 102400, compressedSize: 51200, compressionRatio: "50.00%", outputPath: "D:/path/to/compressed.webp", format: "webp" }

// Fetch image links from Figma API

const figmaResult = await client.callTool("figma", {
  options: {
    figmaUrl: "https://www.figma.com/file/XXXXXXX"
  }
});
console.log(JSON.parse(figmaResult.content[0].text));
// Output: { imageLinks: ["https://example.com/image1.jpg", "https://example.com/image2.jpg"] }

### Tool Schemas

#### get_image_size

```typescript
{
  options: {
    imageUrl: string // URL of the image to retrieve dimensions for
  }
}

obtener_tamaño_de_imagen_local

{
  options: {
    imagePath: string; // Absolute path to the local image file
  }
}

comprimir_imagen_desde_url

{
  options: {
    imageUrl: string // URL of the image to compress
    outputFormat?: "image/webp" | "image/jpeg" | "image/jpg" | "image/png" // Optional output format
  }
}

comprimir_imagen_local

{
  options: {
    imagePath: string // Absolute path to the local image file
    outputPath?: string // Optional absolute path for the compressed output image
    outputFormat?: "image/webp" | "image/jpeg" | "image/jpg" | "image/png" // Optional output format
  }
}

Figma

{
  options: {
    figmaUrl: string; // URL of the Figma file to fetch image links from
  }
}

Registro de cambios

  • 12/05/2025: Se actualizó la API de Figma para admitir parámetros adicionales, incluido un escalado de imagen de 2x.

Implementación técnica

Este proyecto se basa en las siguientes bibliotecas:

  • probe-image-size : para la detección de la dimensión de la imagen

  • tinify - Para la compresión de imágenes a través de la API TinyPNG

  • figma-api : para obtener enlaces de imágenes de la API de Figma

Variables de entorno

  • TINIFY_API_KEY : Necesaria para la compresión de imágenes. Obtén tu clave API de TinyPNG.

    • Cuando no se proporcionan, las herramientas de compresión ( compress_image_from_url y compress_local_image ) no se registrarán

  • FIGMA_API_TOKEN : Necesario para obtener enlaces de imágenes de la API de Figma. Obtén tu token de API de Figma.

    • Cuando no se proporciona, la herramienta Figma ( figma ) no se registrará

Nota: Las herramientas básicas de dimensión de imagen ( get_image_size y get_local_image_size ) siempre están disponibles independientemente de las claves API.

Licencia

Instituto Tecnológico de Massachusetts (MIT)

Available Tools

2 tools
get_image_sizeC

Get the size of an image from URL

ParametersJSON Schema
NameRequiredDescriptionDefault
optionsYesOptions for retrieving image size

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states what the tool does but lacks details on performance (e.g., network timeouts, rate limits), error handling (e.g., invalid URLs, unsupported formats), or output format (e.g., dimensions in pixels). This leaves significant gaps for a tool that performs network operations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, direct sentence with zero wasted words. It front-loads the core purpose ('Get the size of an image') and efficiently specifies the source ('from URL'). Every word earns its place, making it highly concise and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's network-based operation and lack of annotations or output schema, the description is incomplete. It doesn't address critical context like what 'size' means (e.g., dimensions, file size), potential errors, or response format. For a tool with no structured output documentation, this leaves too much unspecified.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema fully documents the single parameter 'imageUrl'. The description adds no additional semantic context beyond implying the URL is for an image, which is already clear from the parameter name. This meets the baseline for high schema coverage but doesn't enhance understanding.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Get the size') and resource ('an image from URL'), making the purpose immediately understandable. It distinguishes from the sibling tool 'get_local_image_size' by specifying the image source as 'from URL' rather than local. However, it doesn't explicitly contrast with the sibling, so it's not a perfect 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus its sibling 'get_local_image_size'. There's no mention of prerequisites, alternative scenarios, or exclusion criteria. The agent must infer usage from the name and description alone without explicit direction.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_local_image_sizeC

Get the size of a local image

ParametersJSON Schema
NameRequiredDescriptionDefault
optionsYesOptions for retrieving local image size

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states what the tool does but doesn't add context beyond the basic action—missing details like error handling, performance implications, or what the output looks like (e.g., dimensions in pixels). This leaves significant gaps for a tool that interacts with local files.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero waste, front-loading the core purpose without unnecessary details. It's appropriately sized for a simple tool, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of annotations and output schema, the description is incomplete for a tool that reads local files. It doesn't explain the return value (e.g., width and height), error cases, or security considerations, leaving the agent with insufficient context to use it effectively beyond the basic parameter.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, documenting the 'imagePath' parameter as an absolute path. The description doesn't add any meaning beyond this, such as format examples or constraints, so it meets the baseline of 3 where the schema does the heavy lifting without extra value from the description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Get' and the resource 'size of a local image', making the purpose specific and understandable. However, it doesn't explicitly differentiate from its sibling 'get_image_size', which might handle remote images or have different scope, leaving room for ambiguity in sibling distinction.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives, such as its sibling 'get_image_size'. It lacks context on prerequisites, exclusions, or specific scenarios, offering only a basic statement of function without usage instructions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 2 tool updatesv1.0.0
    • First observedget_image_size
    • First observedget_local_image_size

TDQS

C2.9/5.0
Disambiguation2/5

The two tools have overlapping purposes—both retrieve image sizes—with only the source (URL vs. local) differing. This creates ambiguity as an agent might misselect between them if the input context is unclear, such as when 'image' could refer to either type. The descriptions help slightly by specifying the source, but the core functionality is identical, leading to potential confusion.

Naming Consistency5/5

The tool names follow a consistent verb_noun pattern with 'get_image_size' and 'get_local_image_size', both using snake_case and starting with 'get'. This predictability makes it easy for an agent to understand the naming convention and infer tool purposes without deviation or mixed styles.

Tool Count2/5

With only 2 tools, the server feels thin and under-scoped for an 'image-tools' domain, which typically implies a broader set of operations like resizing, converting, or analyzing images. The limited count suggests incomplete coverage, as basic image manipulation tasks beyond size retrieval are missing, making it inadequate for comprehensive image handling.

Completeness2/5

The tool set is severely incomplete for an image processing domain, covering only size retrieval from two sources. There are significant gaps in common operations such as resizing, cropping, format conversion, or metadata extraction, which will likely cause agent failures when attempting typical image-related tasks. The surface lacks core functionality needed for a coherent image tools server.

Maintenance

ActivityInactive
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/kshern/image-tools-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server