mcp-openvision
MCP OpenVision is an image analysis server powered by OpenRouter vision models via the Model Context Protocol (MCP), enabling detailed image interpretation and insights.
Analyze images: Supports Base64-encoded strings, URLs, and local file paths for image input
Customizable queries: Guide analysis with specific text instructions for contextual interpretation
System prompts: Define the model's role and behavior for specialized tasks
Model selection: Works with various OpenRouter-supported vision models (default: qwen/qwen2.5-vl-32b-instruct:free)
Advanced parameters: Control temperature, max_tokens, top_p, presence and frequency penalties
Relative path handling: Resolve image paths relative to a specified project root
Specialized use cases: Examples include product design analysis, medical scan interpretation, and chart data extraction
Provides a support option for the project through Buy Me A Coffee donations to the developer
Hosts the project repository and provides issue tracking and development collaboration tools
Leverages OpenAI's GPT-4o model through OpenRouter for vision-based image analysis tasks
Distributes the package through the Python Package Index, enabling installation via pip or uv
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-openvisionanalyze this product photo and describe what's shown"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP OpenVision
Overview
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 via a simple interface within the MCP ecosystem.
Related MCP server: MCP OpenVision
Installation
Installing via Smithery
To install mcp-openvision for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @Nazruden/mcp-openvision --client claudeUsing pip
pip install mcp-openvisionUsing UV (recommended)
uv pip install mcp-openvisionConfiguration
MCP OpenVision requires an OpenRouter API key and can be configured through environment variables:
OPENROUTER_API_KEY (required): Your OpenRouter API key
OPENROUTER_DEFAULT_MODEL (optional): The vision model to use
OpenRouter Vision Models
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 any other compatible model.
Some popular vision models available through OpenRouter include:
qwen/qwen2.5-vl-32b-instruct:free(default)anthropic/claude-3-5-sonnetanthropic/claude-3-opusanthropic/claude-3-sonnetopenai/gpt-4o
You can specify custom models by setting the OPENROUTER_DEFAULT_MODEL environment variable or by passing the model parameter directly to the image_analysis function.
Usage
Testing with MCP Inspector
The easiest way to test MCP OpenVision is with the MCP Inspector tool:
npx @modelcontextprotocol/inspector uvx mcp-openvisionIntegration with Claude Desktop or Cursor
Edit your MCP configuration file:
Windows:
%USERPROFILE%\.cursor\mcp.jsonmacOS:
~/.cursor/mcp.jsonor~/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"
}
}
}
}Running Locally for Development
# Set the required API key
export OPENROUTER_API_KEY="your_api_key"
# Run the server module directly
python -m mcp_openvisionFeatures
MCP OpenVision provides the following core tool:
image_analysis: Analyze images with vision models, supporting various parameters:
image: Can be provided as:Base64-encoded image data
Image URL (http/https)
Local file path
query: User instruction for the image analysis tasksystem_prompt: Instructions that define the model's role and behavior (optional)model: Vision model to usetemperature: Controls randomness (0.0-1.0)max_tokens: Maximum response length
Crafting Effective Queries
The query parameter is crucial for getting useful results from the image analysis. A well-crafted query provides context about:
Purpose: Why you're analyzing this image
Focus areas: Specific elements or details to pay attention to
Required information: The type of information you need to extract
Format preferences: How you want the results structured
Examples of Effective Queries
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 and providing possible diagnoses" |
"Analyze this chart" | "Extract the numerical data from this bar chart showing quarterly sales, and identify the key trends from 2022-2023" |
"Read the text" | "Transcribe all visible text in this restaurant menu, preserving the item names, descriptions, and prices" |
By providing context about why you need the analysis and what specific information you're seeking, you help the model focus on relevant details and produce more valuable insights.
Example Usage
# 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 for a driver education course"
)
# Analyze with a base64-encoded image and a specific analytical purpose
result = await image_analysis(
image="SGVsbG8gV29ybGQ=...", # base64 data
query="Examine this product packaging design and highlight elements that could be improved for better visibility and brand recognition"
)
# 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, focusing on how they create emotional impact",
system_prompt="You are an expert art historian with deep knowledge of painting techniques and art movements. Focus on formal analysis of composition, color, brushwork, and stylistic elements."
)Image Input Types
The image_analysis tool accepts several types of image inputs:
Base64-encoded strings
Image URLs - must start with http:// or https://
File paths:
Absolute paths: full paths starting with / (Unix) or drive letter (Windows)
Relative paths: paths relative to the current working directory
Relative paths with project_root: use the
project_rootparameter to specify a base directory
Using Relative Paths
When using relative file paths (like "examples/image.jpg"), you have two options:
The path must be relative to the current working directory where the server is running
Or, you can specify a
project_rootparameter:
# 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?"
)This is particularly useful in applications where the current working directory may not be predictable or when you want to reference files using paths relative to a specific directory.
Development
Setup Development Environment
# Clone the repository
git clone https://github.com/modelcontextprotocol/mcp-openvision.git
cd mcp-openvision
# Install development dependencies
pip install -e ".[dev]"Code Formatting
This project uses Black for automatic code formatting. The formatting is enforced through GitHub Actions:
All code pushed to the repository is automatically formatted with Black
For pull requests from repository collaborators, Black formats the code and commits directly to the PR branch
For pull requests from forks, Black creates a new PR with the formatted code that can be merged into the original PR
You can also run Black locally to format your code before committing:
# Format all Python code in the src and tests directories
black src testsRun Tests
pytestRelease Process
This project uses an automated release process:
Update the version in
pyproject.tomlfollowing Semantic Versioning principlesYou can use the helper script:
python scripts/bump_version.py [major|minor|patch]
Update the
CHANGELOG.mdwith details about the new versionThe script also creates a template entry in CHANGELOG.md that you can fill in
Commit and push these changes to the
mainbranchThe GitHub Actions workflow will:
Detect the version change
Automatically create a new GitHub release
Trigger the publishing workflow that publishes to PyPI
This automation helps maintain a consistent release process and ensures that every release is properly versioned and documented.
Support
If you find this project helpful, consider buying me a coffee to support ongoing development and maintenance.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Available Tools
1 toolimage_analysisA
Analyze an image using OpenRouter's vision capabilities.
This tool allows you to send an image to OpenRouter's vision models for analysis.
You provide a query to guide the analysis and can optionally customize the system prompt
for more control over the model's behavior.
Args:
image: The image as a base64-encoded string, URL, or local file path
query: Text prompt to guide the image analysis. For best results, provide context
about why you're analyzing the image and what specific information you need.
Including details about your purpose and required focus areas leads to more
relevant and useful responses.
system_prompt: Instructions for the model defining its role and behavior
model: The vision model to use (defaults to the value set by OPENROUTER_DEFAULT_MODEL)
max_tokens: Maximum number of tokens in the response (100-4000)
temperature: Temperature parameter for generation (0.0-1.0)
top_p: Optional nucleus sampling parameter (0.0-1.0)
presence_penalty: Optional penalty for new tokens based on presence in text so far (0.0-2.0)
frequency_penalty: Optional penalty for new tokens based on frequency in text so far (0.0-2.0)
project_root: Optional root directory to resolve relative image paths against
Returns:
The analysis result as text
Examples:
Basic usage with a file path:
image_analysis(image="path/to/image.jpg", query="Describe this image in detail")
Basic usage with an image URL:
image_analysis(image="https://example.com/image.jpg", query="Describe this image in detail")
Basic usage with a relative path and project root:
image_analysis(image="examples/image.jpg", project_root="/path/to/project", query="Describe this image in detail")
Usage with a detailed contextual query:
image_analysis(
image="path/to/image.jpg",
query="Analyze this product packaging design for a fitness supplement. Identify all nutritional claims,
certifications, and health icons. Assess the visual hierarchy and how the key selling points
are communicated. This is for a competitive analysis project."
)
Usage with custom system prompt:
image_analysis(
image="path/to/image.jpg",
query="What objects can you see in this image?",
system_prompt="You are an expert at identifying objects in images. Focus on listing all visible objects."
)
| Name | Required | Description | Default |
|---|---|---|---|
| image | Yes | ||
| query | No | Describe this image in detail | |
| system_prompt | No | You are an expert vision analyzer with exceptional attention to detail. Your purpose is to provide accurate, comprehensive descriptions of images that help AI agents understand visual content they cannot directly perceive. Focus on describing all relevant elements in the image - objects, people, text, colors, spatial relationships, actions, and context. Be precise but concise, organizing information from most to least important. Avoid making assumptions beyond what's visible and clearly indicate any uncertainty. When text appears in images, transcribe it verbatim within quotes. Respond only with factual descriptions without subjective judgments or creative embellishments. Your descriptions should enable an agent to make informed decisions based solely on your analysis. | |
| model | No | ||
| max_tokens | No | ||
| temperature | No | ||
| top_p | No | ||
| presence_penalty | No | ||
| frequency_penalty | No | ||
| project_root | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Without annotations, the description carries full burden for behavioral disclosure. It explains that the tool uses OpenRouter's vision models and returns text, and it lists default parameter values. However, it lacks information about external API dependencies, potential latency, failure modes, or rate limits, which are important for an agent to understand. The description is adequate but not comprehensive in this regard.
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?
The description is well-structured with a clear introductory sentence, parameter list, return value, and examples. While it is verbose in parts (e.g., the query parameter explanation is lengthy), every sentence adds value. It could be slightly more concise, but it is appropriately sized for the tool's complexity.
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?
Given the tool's complexity (10 parameters, no output schema, no annotations), the description is highly complete. It explains all parameters, specifies return type ('The analysis result as text'), and provides comprehensive examples covering various use cases. The default system prompt is also elaborated, which adds valuable context.
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?
Schema description coverage is 0%, so the description must compensate entirely. It does so excellently by providing detailed explanations for all 10 parameters, including their purpose, defaults, and constraints. For example, it explains that 'query' should include context for better results and provides examples. This enables correct parameter usage without relying on the schema.
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?
The description clearly states the tool's purpose: 'Analyze an image using OpenRouter's vision capabilities.' It specifies the action (analyze), resource (image), and technology (OpenRouter's vision), leaving no ambiguity. With no sibling tools, differentiation is not needed, but the purpose is specific and actionable.
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?
The description provides clear usage guidance through detailed parameter descriptions and multiple examples covering file paths, URLs, contextual queries, and custom system prompts. However, it does not explicitly state when not to use this tool or mention alternatives, though none exist. 'Clear context, no exclusions' accurately reflects this.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
With only one tool, there is no possibility of confusion between tools. The tool's purpose is clear and unique.
A single tool means no inconsistency in naming patterns. The name 'image_analysis' is descriptive and follows a common noun_noun convention.
A single tool for a vision server feels slightly thin. While the one tool is comprehensive, the server scope seems narrow; typically 3-15 tools are expected for a well-scoped server.
The server only offers image analysis. Missing other common vision operations like model listing, batch processing, or generation. The surface is incomplete for a vision-focused server.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
The OpenRouter MCP server plugs OpenRouter into the AI tools you already use. Once connected, your assistant can pull live OpenRouter data (models, prices, your credits, rankings, and docs) and send quick test messages, all without leaving your editor.
MCP server for building and testing AI agents with multi-model experimentation and insights.
OCR, transcription, file extraction, and image generation for AI agents via MCP.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn MCP server for analyzing images using OpenRouter vision models, offering capabilities like automatic image resizing, model configuration, and handling custom queries about images.10MIT
- AlicenseAqualityDmaintenanceA Model Context Protocol server that enables AI assistants to analyze images using OpenRouter vision models through a simple interface.11MIT
- AlicenseNot gradedqualityCmaintenanceA Model Context Protocol server that provides multimodal vision tools such as image description, OCR, visual Q&A, and object detection, powered by any vision model via OpenRouter.MIT
- AlicenseNot gradedqualityCmaintenanceMCP server for analyzing images using multiple vision LLM providers (OpenCode, OpenAI, Anthropic, Google, and custom OpenAI-compatible endpoints). Provides tools to analyze single or multiple images, list providers, and test vision capabilities.MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Nazruden/mcp-openvision'
If you have feedback or need assistance with the MCP directory API, please join our Discord server