Skip to main content
Glama

vision-bridge-mcp

Dale ojos a tu agente OpenCode solo de texto.

Los modelos solo de texto de OpenCode (p. ej. DeepSeek V4) no pueden leer imágenes, así que si adjuntas una captura de pantalla de un error, un boceto de pizarra o una foto de un mockup de interfaz, el agente no tiene ni idea de lo que contiene. vision-bridge-mcp es un pequeño servidor MCP que se conecta directamente a OpenCode y le proporciona dos nuevas herramientas: analyze_image (descripción general / preguntas y respuestas visuales) y ocr_image (transcripción exacta de texto), ambas respaldadas por la API de Gemini (gemini-3.6-flash por defecto; puedes sobrescribirlo con GEMINI_MODEL si Google lo retira más adelante; consulta https://ai.google.dev/gemini-api/docs/models para ver los IDs de modelos actuales).

Una vez configurado, solo tienes que decirle al agente que mire un archivo:

Look at ./screenshots/error.png and tell me what's failing.

y él mismo llamará a analyze_image — sin copiar y pegar manualmente en una ventana de chat, sin pasos adicionales de CLI.

Requisitos

  • Node.js 18 o superior

  • Una clave de API de Gemini gratuita — consíguela en https://aistudio.google.com/apikey (plan gratuito: 1.500 solicitudes/día, sin necesidad de tarjeta de crédito)

Related MCP server: Vision MCP Server

Instalación

No es necesario clonar el repositorio. Añade esto a tu configuración de OpenCode (opencode.json en la raíz de tu proyecto, o ~/.config/opencode/opencode.json para una configuración global):

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "vision-bridge": {
      "type": "local",
      "command": ["npx", "-y", "vision-bridge-mcp"],
      "environment": {
        "GEMINI_API_KEY": "your-api-key-here"
      }
    }
  }
}

Reinicia OpenCode (o ejecuta opencode mcp para reconectar) y las herramientas analyze_image y ocr_image aparecerán automáticamente. npx descarga y almacena en caché el paquete la primera vez que se ejecuta — no hay nada que compilar ni instalar manualmente.

¿Prefieres una variable de entorno en lugar de codificar la clave en el archivo de configuración? Establece GEMINI_API_KEY en tu perfil de shell y elimina el bloque "environment" — el servidor la leerá del entorno del proceso de cualquier forma.

Ejecutarlo de forma independiente (para desarrollo o pruebas)

git clone https://github.com/YOUR_GITHUB_USERNAME/vision-bridge-mcp.git
cd vision-bridge-mcp
npm install
cp .env.example .env   # then fill in GEMINI_API_KEY
npm start

El servidor habla MCP sobre stdio, así que por sí solo se queda esperando a que un cliente (como OpenCode) se conecte — eso es lo esperado.

Herramientas

analyze_image

Comprensión de imágenes de propósito general. Dale una ruta y, opcionalmente, un prompt personalizado.

Parámetro

Obligatorio

Descripción

image_path

sí

Ruta a una imagen local (absoluta, o relativa al directorio de trabajo actual de OpenCode)

prompt

no

Instrucción personalizada. Por defecto, una descripción centrada en el desarrollador.

ocr_image

Transcribe el texto visible tal cual — útil para diálogos de error, capturas de terminal o notas fotografiadas.

Parámetro

Obligatorio

Descripción

image_path

sí

Ruta a una imagen local (absoluta, o relativa al directorio de trabajo actual de OpenCode)

Ambas herramientas admiten PNG, JPEG, WEBP, GIF y HEIC/HEIF, hasta 20MB por defecto.

Configuración

Toda la configuración se realiza mediante variables de entorno (establécelas directamente, en un archivo .env para uso independiente, o en el bloque "environment" de tu entrada MCP en opencode.json):

Variable

Obligatorio

Valor por defecto

Descripción

GEMINI_API_KEY

sí

—

Tu clave de API de Gemini

GEMINI_MODEL

no

gemini-3.6-flash

Cualquier modelo de Gemini con soporte de visión

VISION_BRIDGE_MAX_IMAGE_MB

no

20

Rechaza imágenes más grandes que este tamaño

El servidor se inicia incluso sin GEMINI_API_KEY configurada (para que opencode mcp pueda seguir listando las herramientas) — solo da error, con un mensaje claro, en el momento en que se llama a una herramienta sin tener una clave configurada.

Manejo de errores

Cada llamada a una herramienta o bien tiene éxito con un resultado de texto, o bien falla con isError: true y un mensaje específico y accionable — un archivo inexistente, un formato no compatible, un archivo que supera el límite de tamaño, una clave de API faltante o inválida, o un error de la API de Gemini. El servidor nunca se bloquea ante una llamada incorrecta.

Desarrollo

npm install
npm test    # unit tests (node's built-in test runner, no network needed)
npm run lint

La suite de pruebas cubre la resolución de rutas, la detección de tipos MIME y la validación de archivos (archivos inexistentes, directorios, archivos vacíos, archivos sobredimensionados) — la lógica de manejo de entrada con más probabilidad de fallar en el uso real. La llamada a la API de Gemini en sí no está simulada ni probada aquí, ya que requiere una clave activa; si quieres verificar esa parte, establece GEMINI_API_KEY y ejecuta npm start, y luego conéctate con cualquier cliente MCP (o el MCP Inspector).

Publicación (mantenedores)

npm login
npm publish --access public

Primero incrementa la version en package.json — npx -y vision-bridge-mcp siempre se resuelve a la última versión publicada.

Contribuciones

Consulta CONTRIBUTING.md.

Licencia

MIT — consulta LICENSE.

Available Tools

2 tools
analyze_imageD
ParametersJSON Schema
NameRequiredDescriptionDefault
promptNoOptional custom instruction for what to look for or how to describe the image. If omitted, a general developer-focused description is returned.
image_pathYesPath to a local image file (absolute, or relative to the directory OpenCode was started in). Supports PNG, JPEG, WEBP, GIF, HEIC/HEIF.

TDQS

D1/5.0
Behavior1/5

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

Tool has no description.

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

Conciseness1/5

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

Tool has no description.

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

Completeness1/5

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

Tool has no description.

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

Parameters1/5

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

Tool has no description.

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

Purpose1/5

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

Tool has no description.

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

Usage Guidelines1/5

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

Tool has no description.

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

ocr_imageD
ParametersJSON Schema
NameRequiredDescriptionDefault
image_pathYesPath to a local image file to extract text from (absolute, or relative to the directory OpenCode was started in). Supports PNG, JPEG, WEBP, GIF, HEIC/HEIF.

TDQS

D1/5.0
Behavior1/5

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

Tool has no description.

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

Conciseness1/5

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

Tool has no description.

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

Completeness1/5

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

Tool has no description.

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

Parameters1/5

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

Tool has no description.

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

Purpose1/5

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

Tool has no description.

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

Usage Guidelines1/5

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

Tool has no description.

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.

  1. 2 tool updatesv0.1.2
    • First observedanalyze_image
    • First observedocr_image

TDQS

D1.8/5.0

Scored across 2 tools

Disambiguation4/5

The tool names suggest distinct purposes — one for general image analysis and one for OCR. However, the complete lack of descriptions introduces some ambiguity about their exact boundaries.

Naming Consistency5/5

Both tools follow the same verb_noun pattern: analyze_image and ocr_image. The naming convention is clear, consistent, and predictable.

Tool Count3/5

With only two tools, the server feels minimal and borderline thin for an image-related service. The count is not excessive, but it is at the low edge of what could be considered a functional toolset.

Completeness2/5

A vision-bridge server with only image analysis and OCR lacks obvious capabilities like object detection, image comparison, or metadata extraction. The surface appears significantly incomplete for a general vision service.

Maintenance

ActivitySlowing
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • F
    license
    A
    quality
    Not graded
    maintenance
    Enables AI agents to analyze images through vision AI providers (Gemini, OpenAI, Claude), performing tasks like image description, object detection with bounding boxes, region-specific analysis, and precise color extraction without consuming context window with raw pixels.
    4
    -
  • A
    license
    A
    quality
    A
    maintenance
    Enables text-only coding agents to analyze local images using a dedicated vision provider, returning markdown and structured JSON evidence for screenshots, diagrams, UI mockups, and error captures.
    11
    85 npm
    11
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables AI agents to analyze images using any OpenAI-compatible vision API, providing tools for image analysis, OCR, error diagnosis, diagram understanding, and chart analysis.
    MIT