Skip to main content
Glama

Servidor MCP - Imagen

Un servidor de Protocolo de Contexto de Modelo (MCP) que proporciona herramientas para obtener y procesar imágenes de URL, rutas de archivos locales y matrices numpy. El servidor incluye una herramienta llamada fetch_images que devuelve imágenes como cadenas codificadas en base64 junto con sus tipos MIME.

Apóyanos

Si este proyecto te resulta útil y quieres apoyar proyectos futuros, ¡invítanos a un café! Tu apoyo nos ayuda a seguir desarrollando soluciones innovadoras de IA.

Sus contribuciones contribuyen en gran medida a alimentar nuestra pasión por crear aplicaciones inteligentes y fáciles de usar.

Related MCP server: Image Toolkit MCP Server

Tabla de contenido

Características

  • Obtener imágenes de URL (http/https)

  • Cargar imágenes desde rutas de archivos locales

  • Manejo especializado de imágenes locales de gran tamaño

  • Compresión automática de imágenes para imágenes grandes (>1 MB)

  • Procesamiento paralelo de múltiples imágenes

  • Asignación adecuada de tipos MIME para diferentes extensiones de archivo

  • Manejo y registro de errores integral

Prerrequisitos

  • Python 3.10+

  • gestor de paquetes uv (recomendado)

Instalación

  1. Clonar este repositorio

  2. Crear y activar un entorno virtual usando uv:

uv venv
# On Windows:
.venv\Scripts\activate
# On Unix/MacOS:
source .venv/bin/activate
  1. Instalar dependencias usando uv:

uv pip install -r requirements.txt

Ejecución del servidor

Hay dos formas de ejecutar el servidor MCP:

1. Método directo

Para iniciar el servidor MCP directamente:

uv run python mcp_image.py

2. Configurar para Windsurf/Cursor

Windsurf

Para agregar este servidor MCP a Windsurf:

  1. Edite el archivo de configuración en ~/.codeium/windsurf/mcp_config.json

  2. Agregue la siguiente configuración:

{
  "mcpServers": {
    "image": {
      "command": "uv",
        "args": ["--directory", "/path/to/mcp-image", "run", "mcp_image.py"]
    }
  }
}

Cursor

Para agregar este servidor MCP a Cursor:

  1. Abra Cursor y vaya a Configuración (Barra de navegación → Configuración del cursor)

  2. Vaya a CaracterísticasServidores MCP

  3. Haga clic en + Agregar nuevo servidor MCP

  4. Introduzca la siguiente configuración:

{
  "mcpServers": {
    "image": {
      "command": "uv",
      "args": ["--directory", "/path/to/mcp-image", "run", "mcp_image.py"]
    }
  }
}

Herramientas disponibles

El servidor proporciona las siguientes herramientas:

fetch_images : obtiene y procesa imágenes desde URL o rutas de archivos locales Parámetros: image_sources: lista de URL o rutas de archivos a imágenes Devuelve: lista de imágenes procesadas con codificación base64 y tipos MIME

Ejemplos de uso

Ahora puedes usar comandos como:

  • "Obtener estas imágenes: [lista de URL o rutas de archivo]"

  • "Cargar y procesar esta imagen local: [ruta_del_archivo]"

Ejemplos

# URL-only test
[
  "https://upload.wikimedia.org/wikipedia/commons/thumb/7/70/Chocolate_%28blue_background%29.jpg/400px-Chocolate_%28blue_background%29.jpg",
  "https://imgs.search.brave.com/Sz7BdlhBoOmU4wZjnUkvgestdwmzOzrfc3GsiMr27Ik/rs:fit:860:0:0:0/g:ce/aHR0cHM6Ly9pbWdj/ZG4uc3RhYmxlZGlm/ZnVzaW9ud2ViLmNv/bS8yMDI0LzEwLzE4/LzJmOTY3NTViLTM0/YmQtNDczNi1iNDRh/LWJlMTVmNGM5MDBm/My5qcGc",
  "https://shigacare.fukushi.shiga.jp/mumeixxx/img/main.png"
]

# Mixed URL and local file test
[
  "https://upload.wikimedia.org/wikipedia/commons/thumb/7/70/Chocolate_%28blue_background%29.jpg/400px-Chocolate_%28blue_background%29.jpg",
  "C:\\Users\\username\\Pictures\\image1.jpg",
  "https://imgs.search.brave.com/Sz7BdlhBoOmU4wZjnUkvgestdwmzOzrfc3GsiMr27Ik/rs:fit:860:0:0:0/g:ce/aHR0cHM6Ly9pbWdj/ZG4uc3RhYmxlZGlm/ZnVzaW9ud2ViLmNv/bS8yMDI0LzEwLzE4/LzJmOTY3NTViLTM0/YmQtNDczNi1iNDRh/LWJlMTVmNGM5MDBm/My5qcGc",
  "C:\\Users\\username\\Pictures\\image2.jpg"
]

Depuración

Si encuentra algún problema:

  1. Compruebe que todas las dependencias estén instaladas correctamente

  2. Verifique que el servidor esté ejecutándose y escuchando conexiones

  3. Para problemas de carga de imágenes locales, asegúrese de que las rutas de los archivos sean correctas y accesibles

  4. Para errores de "Tipo de imagen no compatible", verifique el manejo del tipo de contenido

  5. Busque mensajes de error en la salida del servidor

Contribuyendo

¡Agradecemos sus contribuciones! No dude en enviar una solicitud de incorporación de cambios.

Licencia

Este proyecto está licenciado bajo la licencia MIT: consulte el archivo de LICENCIA para obtener más detalles.

Available Tools

1 tool
fetch_imagesA
Fetch and process images from URLs or local file paths, returning them in a format suitable for LLMs.

This tool accepts a list of image sources which can be either:
1. URLs pointing to web-hosted images (http:// or https://)
2. Local file paths pointing to images stored on the local filesystem (e.g., "C:/images/photo1.jpg")

For a single image, provide a one-element list. The function will process images in parallel
when multiple sources are provided. Images that exceed the size limit (1MB) will be automatically 
compressed while maintaining aspect ratio and reasonable quality.

Args:
    image_sources: A list of image URLs or local file paths. For a single image, provide a one-element list.
    
Returns:
    A list of Image objects or None values (if processing failed) in the same order as the input sources.
ParametersJSON Schema
NameRequiredDescriptionDefault
image_sourcesYes

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations provided, the description carries the full burden and discloses key behavioral traits: parallel processing for multiple images, automatic compression for images over 1MB with aspect ratio and quality preservation, and failure handling (returns None for failed processing). It doesn't cover aspects like rate limits or authentication needs, but provides substantial operational context.

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 well-structured and front-loaded with the core purpose, followed by detailed input specifications, processing behavior, and return values. Every sentence adds value without redundancy, and it's appropriately sized for the tool's complexity.

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

Completeness4/5

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

Given the tool's moderate complexity (1 parameter, no output schema, no annotations), the description is largely complete: it covers purpose, input semantics, processing behavior, and return format. However, it lacks details on the 'Image objects' structure (e.g., format, metadata) and any error specifics, which would enhance completeness for an agent.

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

Parameters5/5

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

The schema description coverage is 0%, so the description must compensate fully. It clearly explains the single parameter 'image_sources' as a list of URLs or file paths, specifies format examples (http/https URLs, local paths like 'C:/images/photo1.jpg'), and clarifies handling for single images (one-element list). This adds comprehensive meaning beyond the bare schema.

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

Purpose5/5

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

The description clearly states the tool's purpose with specific verbs ('fetch and process images') and resources ('from URLs or local file paths'), and distinguishes its output format ('suitable for LLMs'). With no sibling tools, it fully defines its scope without redundancy.

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

Usage Guidelines3/5

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

The description implies usage by specifying input types (URLs or file paths) and handling of single vs. multiple images, but lacks explicit guidance on when to use this tool versus alternatives (e.g., other image tools or direct file handling). With no siblings, this is less critical but still a gap.

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

TDQS

A4.1/5.0
Disambiguation5/5

With only one tool, there is no possibility of ambiguity or overlap between tools. The single tool 'fetch_images' has a clearly defined and distinct purpose that cannot be confused with any other tool in this server.

Naming Consistency5/5

The single tool name 'fetch_images' follows a clear verb_noun pattern, and with only one tool, there is perfect consistency. No naming conventions can conflict when only one tool exists.

Tool Count2/5

A single tool is generally too few for most server purposes, creating a thin surface that limits functionality. While this tool handles image fetching and processing well, the server's scope as an 'Image Server' suggests potential gaps that would require additional tools for comprehensive image operations.

Completeness2/5

For an 'Image Server' domain, having only a fetch/processing tool leaves significant gaps. There are no tools for image manipulation (resize, crop, filter), analysis (object detection, metadata extraction), or management (list, delete, organize images), making the surface severely incomplete for typical image-related workflows.

Maintenance

ActivityInactive
ResponsivenessNo issues

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/IA-Programming/mcp-images'

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