vision-bridge-mcp
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
Универсальное понимание изображений. Передайте путь и, при необходимости, свой промпт.
Параметр | Обязательный | Описание |
| да | Путь к локальному изображению (абсолютный или относительно рабочей директории OpenCode) |
| нет | Своя инструкция. По умолчанию — описание, ориентированное на разработчика. |
ocr_image
Дословно распознаёт видимый текст — полезно для диалогов ошибок, скриншотов терминала или сфотографированных заметок.
Параметр | Обязательный | Описание |
| да | Путь к локальному изображению (абсолютный или относительно рабочей директории OpenCode) |
Оба инструмента поддерживают PNG, JPEG, WEBP, GIF и HEIC/HEIF, по умолчанию до 20 МБ.
Конфигурация
Вся конфигурация задаётся через переменные окружения (устанавливайте их напрямую, в файле .env для автономного использования или в блоке "environment" в ваш opencode.json MCP):
Переменная | Обязательная | По умолчанию | Описание |
| да | — | Ваш ключ Gemini API |
| нет |
| Любая модель Gemini с поддержкой зрения |
| нет |
| Отклонять изображения больше этого размера |
Сервер запускается даже без установленного 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 toolsanalyze_imageD
| Name | Required | Description | Default |
|---|---|---|---|
| prompt | No | Optional custom instruction for what to look for or how to describe the image. If omitted, a general developer-focused description is returned. | |
| image_path | Yes | Path to a local image file (absolute, or relative to the directory OpenCode was started in). Supports PNG, JPEG, WEBP, GIF, HEIC/HEIF. |
TDQS
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.
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.
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.
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.
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.
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
| Name | Required | Description | Default |
|---|---|---|---|
| image_path | Yes | Path 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
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.
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.
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.
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.
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.
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.
2 tool updates
v0.1.2- First observed
analyze_image - First observed
ocr_image
TDQS
Scored across 2 tools
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.
Both tools follow the same verb_noun pattern: analyze_image and ocr_image. The naming convention is clear, consistent, and predictable.
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.
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
Related MCP Connectors
OCR, transcription, file extraction, and image generation for AI agents via MCP.
Generate images, GIFs, videos, and PDFs from HTML, URLs, or templates — from your AI agent.
Video, audio, and image processing for AI agents: convert, transcribe, upscale - 150+ operations.
Image & PDF tools for AI agents: compress, convert, resize, PDF, AI vision, pipeline.
Related MCP Servers
- FlicenseAqualityNot gradedmaintenanceEnables 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-
- AlicenseAqualityDmaintenanceEnables AI agents to analyze images, extract text, compare images, and analyze video through any OpenAI-compatible vision model.4154 npm20MIT
- AlicenseAqualityAmaintenanceEnables 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.1185 npm11MIT
- AlicenseNot gradedqualityDmaintenanceEnables 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