Opencode Vision is a plugin for OpenCode that enables vision support for models that lack native image attachment support.
Originally built for MiniMax models, it can be configured to work with any model that requires MCP-based image handling.
It restores the "paste and ask" workflow by automatically saving image assets and routing them through a configured MCP image analysis tool such as local_vision.
Compared with @devadathanmb/opencode-minimax-easy-vision, it doesn't save images from the clipboard to the local device.
See how it works:
https://github.com/user-attachments/assets/df396c6c-6fa8-46b8-8984-c003ecf1c12c
https://github.com/user-attachments/assets/826f90ea-913f-427e-ace8-0b711302c497
When using MiniMax models (like MiniMax M2.1) in OpenCode, native image attachments aren't supported.
These models usually need an MCP image analysis tool with an explicit file path. This breaks the normal flow:
The MCP server that exposes the local_vision tool must be configured in your opencode.json before using this plugin.
Add the plugin to the plugin array in your opencode.json file:
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-vision"]
}
This plugin automates the vision pipeline so you don't have to think about it.
How it works:
Result: You just paste the image and ask your question just like how you do with Claude or GPT models. The plugin handles the rest.
By default, the plugin activates for models matching the pattern ["*/qwen3-coder-next-mlx"]:
*/qwen3-coder-next-mlx — the qwen3-coder-next-mlx model from any providerYou can enable this for other models by creating a config file.
.opencode/opencode-vision.json~/.config/opencode/opencode-vision.json{
"models": ["*/qwen3-coder-next-mlx", "z-ai/*", "*/minimax-m2.5"]
}
| Pattern | Matches |
|---|---|
* | Match ALL models |
minimax/* | All models from the minimax provider |
*/minimax-m2.5 | Specific model from any provider |
z-ai/* | All models from the z-ai provider |
*suffix matches values ending with suffixprefix* matches values starting with prefix* matches everything*text* matches values containing textIf the config is missing or empty, it defaults to ["*/qwen3-coder-next-mlx"].
Enable for all models:
{
"models": ["*"]
}
Specific providers:
{
"models": ["minimax/*", "z-ai/*", "google/*"]
}
Mix of providers and models:
{
"models": ["minimax/*", "z-ai/glm-4.7", "*/minimax-m2.5"]
}
By default, the plugin uses the local_vision tool for image analysis. You can still configure a different tool if needed.
[!NOTE] The
imageAnalysisToolvalue is the tool name, not the MCP server name.MCP servers expose one or more tools. Set
imageAnalysisToolto the exact tool name you want the model to call.
openrouter-image-mcp routes image analysis through OpenRouter, giving you access to any vision-capable model including free ones.
Add the MCP server to your opencode.json:
{
"mcp": {
"openrouter_image": {
"type": "local",
"command": ["npx", "openrouter-image-mcp"],
"environment": {
"OPENROUTER_API_KEY": "your-api-key-here",
"OPENROUTER_MODEL": "nvidia/nemotron-nano-12b-v2-vl:free"
}
}
}
}
Then configure the plugin to use it:
{
"models": ["*/qwen3-coder-next-mlx"],
"imageAnalysisTool": "mcp_openrouter_image_analyze_image"
}
[!TIP]
nvidia/nemotron-nano-12b-v2-vl:freeis a free vision model on OpenRouter that requires no credits.
By default, the plugin generates a fixed instruction prompt telling the model to use the image analysis tool. You can override this with a custom template:
{
"promptTemplate": "I'm attaching {imageCount} image(s) for you to analyze.\n\nImages:\n{imageList}\n\nUse the `{toolName}` tool on each one.\n\nMy question: {userText}"
}
| Variable | Description |
|---|---|
{imageList} | Newline-separated list: - Image 1: /path/to/file |
{imageCount} | Number of images, e.g. 1, 3 |
{toolName} | The configured MCP tool name |
{userText} | The user's original message text (may be empty) |
The template must contain at least one variable — if none are present, the plugin falls back to the default prompt.
(The plugin currently accepts PNG, JPEG, and WebP inputs and passes them to your configured image tool.)
Cmd+V / Ctrl+V).You: [pasted screenshot] Why is this failing?
Model: I'll check the image using the
local_visiontool.[Calls local_vision path="/tmp/xyz.png"]Model: The error suggests a syntax error on line 12.
npm install
npm run build
dist/index.js.mkdir -p ~/.config/opencode/plugin
ln -sf $(pwd)/dist/index.js ~/.config/opencode/plugin/opencode-vision.js
AGPL-3.0. See LICENSE
3 commits
Hacker News (1)
TypeScript
100.0%
Opencode Vision is a plugin for OpenCode that enables vision support for models that lack native image attachment support.
Originally built for MiniMax models, it can be configured to work with any model that requires MCP-based image handling.
It restores the "paste and ask" workflow by automatically saving image assets and routing them through a configured MCP image analysis tool such as local_vision.
Compared with @devadathanmb/opencode-minimax-easy-vision, it doesn't save images from the clipboard to the local device.
See how it works:
https://github.com/user-attachments/assets/df396c6c-6fa8-46b8-8984-c003ecf1c12c
https://github.com/user-attachments/assets/826f90ea-913f-427e-ace8-0b711302c497
When using MiniMax models (like MiniMax M2.1) in OpenCode, native image attachments aren't supported.
These models usually need an MCP image analysis tool with an explicit file path. This breaks the normal flow:
The MCP server that exposes the local_vision tool must be configured in your opencode.json before using this plugin.
Add the plugin to the plugin array in your opencode.json file:
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-vision"]
}
This plugin automates the vision pipeline so you don't have to think about it.
How it works:
Result: You just paste the image and ask your question just like how you do with Claude or GPT models. The plugin handles the rest.
By default, the plugin activates for models matching the pattern ["*/qwen3-coder-next-mlx"]:
*/qwen3-coder-next-mlx — the qwen3-coder-next-mlx model from any providerYou can enable this for other models by creating a config file.
.opencode/opencode-vision.json~/.config/opencode/opencode-vision.json{
"models": ["*/qwen3-coder-next-mlx", "z-ai/*", "*/minimax-m2.5"]
}
| Pattern | Matches |
|---|---|
* | Match ALL models |
minimax/* | All models from the minimax provider |
*/minimax-m2.5 | Specific model from any provider |
z-ai/* | All models from the z-ai provider |
*suffix matches values ending with suffixprefix* matches values starting with prefix* matches everything*text* matches values containing textIf the config is missing or empty, it defaults to ["*/qwen3-coder-next-mlx"].
Enable for all models:
{
"models": ["*"]
}
Specific providers:
{
"models": ["minimax/*", "z-ai/*", "google/*"]
}
Mix of providers and models:
{
"models": ["minimax/*", "z-ai/glm-4.7", "*/minimax-m2.5"]
}
By default, the plugin uses the local_vision tool for image analysis. You can still configure a different tool if needed.
[!NOTE] The
imageAnalysisToolvalue is the tool name, not the MCP server name.MCP servers expose one or more tools. Set
imageAnalysisToolto the exact tool name you want the model to call.
openrouter-image-mcp routes image analysis through OpenRouter, giving you access to any vision-capable model including free ones.
Add the MCP server to your opencode.json:
{
"mcp": {
"openrouter_image": {
"type": "local",
"command": ["npx", "openrouter-image-mcp"],
"environment": {
"OPENROUTER_API_KEY": "your-api-key-here",
"OPENROUTER_MODEL": "nvidia/nemotron-nano-12b-v2-vl:free"
}
}
}
}
Then configure the plugin to use it:
{
"models": ["*/qwen3-coder-next-mlx"],
"imageAnalysisTool": "mcp_openrouter_image_analyze_image"
}
[!TIP]
nvidia/nemotron-nano-12b-v2-vl:freeis a free vision model on OpenRouter that requires no credits.
By default, the plugin generates a fixed instruction prompt telling the model to use the image analysis tool. You can override this with a custom template:
{
"promptTemplate": "I'm attaching {imageCount} image(s) for you to analyze.\n\nImages:\n{imageList}\n\nUse the `{toolName}` tool on each one.\n\nMy question: {userText}"
}
| Variable | Description |
|---|---|
{imageList} | Newline-separated list: - Image 1: /path/to/file |
{imageCount} | Number of images, e.g. 1, 3 |
{toolName} | The configured MCP tool name |
{userText} | The user's original message text (may be empty) |
The template must contain at least one variable — if none are present, the plugin falls back to the default prompt.
(The plugin currently accepts PNG, JPEG, and WebP inputs and passes them to your configured image tool.)
Cmd+V / Ctrl+V).You: [pasted screenshot] Why is this failing?
Model: I'll check the image using the
local_visiontool.[Calls local_vision path="/tmp/xyz.png"]Model: The error suggests a syntax error on line 12.
npm install
npm run build
dist/index.js.mkdir -p ~/.config/opencode/plugin
ln -sf $(pwd)/dist/index.js ~/.config/opencode/plugin/opencode-vision.js
AGPL-3.0. See LICENSE
Hacker News (1)
3 commits
TypeScript
100.0%