vision
Enables vision capabilities for OpenCode by analyzing local images (PNG, JPG, WebP, GIF, HEIC, SVG) using the Google Gemini API.
README
Simple Vision MCP Server for Opencode
MCP server for OpenCode that adds vision capabilities — analyze local PNG, JPG, WebP, GIF, HEIC and SVG files via the Google Gemini API.
Prerequisites
- Node.js ≥ 18
- Google Gemini API key (aistudio.google.com)
- OpenCode running in the terminal
Setup
cd ~/mcp-vision
npm install
cp .env.example .env
Edit .env and add your API key:
GEMINI_API_KEY=your_api_key_here
GEMINI_MODEL=gemini-3.5-flash
Handshake test
echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"0.0.1"}}}' \
| node ~/mcp-vision/server.mjs 2>/dev/null
Expected output: a JSON object with result.serverInfo.name: "vision".
OpenCode configuration
Find your Node.js path:
which node
# e.g. /opt/homebrew/bin/node
Add to ~/.config/opencode/opencode.json:
{
"mcp": {
"vision": {
"type": "local",
"command": ["/opt/homebrew/bin/node", "/Users/YOURUSER/mcp-vision/server.mjs"],
"enabled": true
}
}
}
All variables are loaded from .env in the project directory.
Replace /Users/YOURUSER/ with your actual username. Use the full Node.js path from which node (OpenCode does not inherit the shell PATH).
Usage
analyze_image /Users/YOURUSER/Desktop/screenshot.png
analyze_image /path/to/image.jpg "What UI elements can you see?"
Supported formats
| Format | MIME type | Notes |
|---|---|---|
| PNG | image/png |
Native |
| JPEG/JPG | image/jpeg |
Native |
| WebP | image/webp |
Native |
| GIF | image/gif |
Native |
| HEIC/HEIF | image/heic / image/heif |
Native |
| SVG | image/svg+xml |
Converted to PNG via sharp |
Troubleshooting
Status failed in OpenCode: Run the handshake test. If you get a JSON response, the issue is the Node.js path in your config.
GEMINI_API_KEY not found: Make sure .env exists in the project directory and contains the key (no quotes around the value).
404 from Gemini API: The configured model may be deprecated — set GEMINI_MODEL to gemini-3.5-flash in .env.
File not found: Always use absolute paths (no ~/ tilde notation).
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
Neon Database
MCP server for interacting with Neon Management API and databases
E2B
Using MCP to run code via e2b.
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.