Skip to main content
Glama

vision-bridge-mcp

Дайте глаза вашему текстовому агенту OpenCode.

Текстовые модели OpenCode (например, DeepSeek V4) не умеют читать изображения — так что если вы прикрепите скриншот ошибки, набросок на доске или фото макета интерфейса, агент понятия не имеет, что на нём. vision-bridge-mcp — это небольшой MCP-сервер, который подключается напрямую к OpenCode и даёт ему два новых инструмента: analyze_image (общее описание / визуальные вопросы и ответы) и ocr_image (точное распознавание текста), оба работают на базе Gemini API (gemini-3.6-flash по умолчанию — можно переопределить через GEMINI_MODEL, если Google позже уберёт эту модель; актуальные идентификаторы моделей смотрите на https://ai.google.dev/gemini-api/docs/models).

После настройки достаточно сказать агенту посмотреть на файл:

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

и он сам вызовет analyze_image — без ручного копирования в окно чата и без отдельного шага через CLI.

Требования

  • Node.js 18 или новее

  • Бесплатный ключ Gemini API — получите его на https://aistudio.google.com/apikey (бесплатный тариф: 1500 запросов в день, кредитная карта не требуется)

Related MCP server: Vision MCP Server

Установка

Клонирование не требуется. Добавьте это в конфиг OpenCode (opencode.json в корне проекта или ~/.config/opencode/opencode.json для глобальной настройки):

{
  "$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"
      }
    }
  }
}

Перезапустите OpenCode (или выполните opencode mcp для переподключения), и инструменты analyze_image и ocr_image появятся автоматически. При первом запуске npx загружает и кэширует пакет — ничего не нужно собирать или устанавливать вручную.

Предпочитаете переменную окружения вместо жёстко заданного ключа в конфиге? Установите GEMINI_API_KEY в профиле оболочки и удалите блок "environment" — сервер всё равно прочитает его из окружения процесса.

Запуск отдельно (для разработки или тестирования)

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

Сервер общается через MCP по stdio, поэтому сам по себе он просто ждёт подключения клиента (например, OpenCode) — это ожидаемо.

Инструменты

analyze_image

Универсальное понимание изображений. Передайте путь и, при необходимости, свой промпт.

Параметр

Обязательный

Описание

image_path

да

Путь к локальному изображению (абсолютный или относительно рабочей директории OpenCode)

prompt

нет

Своя инструкция. По умолчанию — описание, ориентированное на разработчика.

ocr_image

Дословно распознаёт видимый текст — полезно для диалогов ошибок, скриншотов терминала или сфотографированных заметок.

Параметр

Обязательный

Описание

image_path

да

Путь к локальному изображению (абсолютный или относительно рабочей директории OpenCode)

Оба инструмента поддерживают PNG, JPEG, WEBP, GIF и HEIC/HEIF, по умолчанию до 20 МБ.

Конфигурация

Вся конфигурация задаётся через переменные окружения (устанавливайте их напрямую, в файле .env для автономного использования или в блоке "environment" в ваш opencode.json MCP):

Переменная

Обязательная

По умолчанию

Описание

GEMINI_API_KEY

да

—

Ваш ключ Gemini API

GEMINI_MODEL

нет

gemini-3.6-flash

Любая модель Gemini с поддержкой зрения

VISION_BRIDGE_MAX_IMAGE_MB

нет

20

Отклонять изображения больше этого размера

Сервер запускается даже без установленного GEMINI_API_KEY (поэтому opencode mcp всё равно может перечислить инструменты) — ошибка с понятным сообщением возникает только при фактическом вызове инструмента без настроенного ключа.

Обработка ошибок

Каждый вызов инструмента либо завершается успешно с текстовым результатом, либо падает с isError: true и конкретным, полезным сообщением — отсутствующий файл, неподдерживаемый формат, файл сверх лимита, отсутствующий/недействительный ключ API или ошибка вышестоящего сервиса Gemini. Сам сервер никогда не падает при некорректном вызове.

Разработка

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

Набор тестов покрывает разрешение путей, определение MIME-типов и проверку файлов (отсутствующие файлы, каталоги, пустые файлы, превышающие размер) — то есть логику обработки входных данных, которая чаще всего ломается при реальном использовании. Сам вызов Gemini API здесь не имитируется и не тестируется, так как требует рабочего ключа; если хотите проверить этот путь, установите GEMINI_API_KEY и запустите npm start, затем подключитесь с любым MCP-клиентом (или MCP Inspector).

Публикация (для сопровождающих)

npm login
npm publish --access public

Сначала увеличьте version в package.json — npx -y vision-bridge-mcp всегда разрешается в последнюю опубликованную версию.

Участие в разработке

Смотрите CONTRIBUTING.md.

Лицензия

MIT — см. 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