MCP server for image analysis using OpenRouter
Project description
MCP OpenVision
A simple MCP server for image analysis using OpenRouter. This MCP server allows clients (like Claude Desktop) to analyze images with state-of-the-art vision models.
Features
- Analyze images from local or remote sources using Claude, GPT-4o, or other models
- Extract text from images with language hints
- Compare images and identify differences
- Multiple analysis modes (general, detailed, text extraction, technical, social media)
- Configurable through environment variables
Installation
Option 1: Install from PyPI
pip install mcp-openvision
Option 2: Install from source
# Clone the repository
git clone https://github.com/Nazruden/mcp-openvision.git
cd mcp-openvision
# Install the package
pip install -e .
Option 3: Install with FastMCP
# Install directly for use with Claude
fastmcp install src/mcp_openvision/server.py --name "OpenVision" -e OPENROUTER_API_KEY=your_api_key_here
Requirements
- Python 3.10 or higher
- An OpenRouter API key (get one at openrouter.ai)
- Claude Desktop or another MCP client
Configuration
MCP OpenVision can be configured using environment variables:
- OPENROUTER_API_KEY (required): Your OpenRouter API key
- OPENROUTER_DEFAULT_MODEL (optional): The default vision model to use (defaults to "anthropic/claude-3-sonnet")
Adding to your mcp.json
To use OpenVision with Claude Desktop or other MCP clients, add this to your mcp.json file:
{
"mcpServers": {
"openvision": {
"command": "uvx",
"args": ["mcp-openvision"],
"env": {
"OPENROUTER_API_KEY": "your_openrouter_api_key_here",
"OPENROUTER_DEFAULT_MODEL": "anthropic/claude-3-sonnet"
}
}
}
}
For more detailed configuration options, see MCP_CONFIG.md.
Example Prompts
- "Analyze this screenshot and tell me what's happening on the webpage"
- "Extract all text from this image"
- "Describe this photo in detail"
- "Is there a dog in this picture?"
- "What kind of chart is this and what data is it showing?"
Development
Running in Development Mode
For development and testing, run the server in development mode:
fastmcp dev src/mcp_openvision/server.py -e OPENROUTER_API_KEY=your_api_key_here
Running Tests
pip install pytest pytest-asyncio
pytest tests/
Available Tools
The MCP server provides these tools:
- analyze_image: General purpose image analysis with various modes
- extract_text_from_image: Specialized tool for extracting text from images
- compare_images: Tool for comparing two images and describing differences
License
MIT
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcp_openvision-0.1.0.tar.gz.
File metadata
- Download URL: mcp_openvision-0.1.0.tar.gz
- Upload date:
- Size: 12.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a2fe2acf9e583f6932fda93016a246aa21e5c4bdebbfa45066c9ea795e87ff53
|
|
| MD5 |
b9b6e5ce955c055ffc94e6f8fbcfebad
|
|
| BLAKE2b-256 |
881de5cc7b8cd7406af79eb2635b3855242e01244a93c8f8548cfd370e411b2c
|
File details
Details for the file mcp_openvision-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mcp_openvision-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
21a4143d3880fa41f8013440db4b43728d609d99b2939dc4904b5f8439f6a910
|
|
| MD5 |
d644f53d167e57ef415c6364a18684b5
|
|
| BLAKE2b-256 |
b43a97c2cda7e94eb5faca7357c76a02956de2ed905d574c5971934630c85c36
|