MCP OpenVision is a Model Context Protocol (MCP) server that provides image analysis capabilities powered by OpenRouter vision models. It enables AI assistants to analyze images through a simple interface within the MCP ecosystem, allowing for detailed image examination without requiring complex integration.
For Claude Desktop users, you can install MCP OpenVision automatically using Smithery:
npx -y @smithery/cli install @Nazruden/mcp-openvision --client claude
pip install mcp-openvision
uv pip install mcp-openvision
MCP OpenVision requires an OpenRouter API key and can be configured through environment variables:
MCP OpenVision works with any OpenRouter model that supports vision capabilities. The default model is qwen/qwen2.5-vl-32b-instruct:free
, but you can specify alternatives:
qwen/qwen2.5-vl-32b-instruct:free
(default)anthropic/claude-3-5-sonnet
anthropic/claude-3-opus
anthropic/claude-3-sonnet
openai/gpt-4o
Test MCP OpenVision easily with the MCP Inspector tool:
npx @modelcontextprotocol/inspector uvx mcp-openvision
Edit your MCP configuration file:
%USERPROFILE%\.cursor\mcp.json
~/.cursor/mcp.json
or ~/Library/Application Support/Claude/claude_desktop_config.json
Add the following configuration:
{
"mcpServers": {
"openvision": {
"command": "uvx",
"args": ["mcp-openvision"],
"env": {
"OPENROUTER_API_KEY": "your_openrouter_api_key_here",
"OPENROUTER_DEFAULT_MODEL": "anthropic/claude-3-sonnet"
}
}
}
}
# Set the required API key
export OPENROUTER_API_KEY="your_api_key"
# Run the server module directly
python -m mcp_openvision
The core functionality of MCP OpenVision is the image_analysis tool, which supports:
MCP OpenVision accepts several types of image inputs:
project_root
parameter to specify a base directoryWhen using relative file paths, you have two options:
project_root
parameter:# Example with relative path and project_root
result = await image_analysis(
image="examples/image.jpg",
project_root="/path/to/your/project",
query="What is in this image?"
)
# Analyze an image from a URL
result = await image_analysis(
image="https://example.com/image.jpg",
query="Describe this image in detail"
)
# Analyze an image from a local file with a focused query
result = await image_analysis(
image="path/to/local/image.jpg",
query="Identify all traffic signs in this street scene and explain their meanings"
)
# Analyze with a base64-encoded image
result = await image_analysis(
image="SGVsbG8gV29ybGQ=...", # base64 data
query="Examine this product packaging design and highlight elements that could be improved"
)
# Customize the system prompt for specialized analysis
result = await image_analysis(
image="path/to/local/image.jpg",
query="Analyze the composition and artistic techniques used in this painting",
system_prompt="You are an expert art historian with deep knowledge of painting techniques."
)
The quality of your query significantly impacts the analysis results. A well-crafted query should include:
Basic Query | Enhanced Query |
---|---|
"Describe this image" | "Identify all retail products visible in this store shelf image and estimate their price range" |
"What's in this image?" | "Analyze this medical scan for abnormalities, focusing on the highlighted area" |
"Analyze this chart" | "Extract the numerical data from this bar chart showing quarterly sales, and identify key trends" |
"Read the text" | "Transcribe all visible text in this restaurant menu, preserving item names, descriptions, prices" |
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "openvision" '{"command":"uvx","args":["mcp-openvision"],"env":{"OPENROUTER_API_KEY":"your_openrouter_api_key_here","OPENROUTER_DEFAULT_MODEL":"anthropic/claude-3-sonnet"}}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"openvision": {
"command": "uvx",
"args": [
"mcp-openvision"
],
"env": {
"OPENROUTER_API_KEY": "your_openrouter_api_key_here",
"OPENROUTER_DEFAULT_MODEL": "anthropic/claude-3-sonnet"
}
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"openvision": {
"command": "uvx",
"args": [
"mcp-openvision"
],
"env": {
"OPENROUTER_API_KEY": "your_openrouter_api_key_here",
"OPENROUTER_DEFAULT_MODEL": "anthropic/claude-3-sonnet"
}
}
}
}
3. Restart Claude Desktop for the changes to take effect