๐ผ๏ธ๐ค OpenRouter Image MCP Server
๐ฅ Supercharge your AI agents with powerful image analysis capabilities! ๐ฅ
A blazing-fast โก MCP (Model Context Protocol) server that enables AI agents to see and understand images using OpenRouter's cutting-edge vision models. Perfect for screenshots, photos, diagrams, and any visual content! ๐ธโจ
๐ What Makes This Special?
๐ฏ Multi-Model Support: Choose from Claude, Gemini, GPT-4 Vision, and more!
๐ Lightning Fast: Built with TypeScript and optimized for performance
๐ง Flexible Input: Support for file paths, URLs, and base64 data
๐ฐ Cost-Effective: Smart model selection for the best price-to-quality ratio
๐ก๏ธ Production Ready: Robust error handling, retries, and comprehensive logging
๐จ Easy Integration: Works seamlessly with Claude Code, Cline, Cursor, and more!
๐ Quick Start
Prerequisites ๐
Node.js 18+ โก
OpenRouter API Key ๐ (Get one at openrouter.ai)
Your favorite MCP client ๐ค (Claude Code, Cline, etc.)
Installation ๐ฆ
๐ก Why npx is recommended: No installation required, always gets the latest version, and works perfectly for MCP server usage!
Configuration โ๏ธ
The MCP server requires an OpenRouter API key. You can configure it in several ways:
Method 1: Environment Variables (Recommended)
Method 2: .env File
Add your OpenRouter credentials to .env
:
Method 3: Direct Configuration in MCP Client
Add the API key directly in your MCP client configuration (see examples below).
๐ Works Locally - No Restarts Needed! ๐ฏ
๐ HUGE ADVANTAGE: This MCP server works perfectly locally with zero manual intervention once configured! No restarts, no manual server starts, no fiddling with settings. It just works! โจ
๐ How It Works Automatically
๐ฏ Configure once โ Set up your MCP client one time
๐ Auto-launches โ Client starts the server automatically
๐ง Connects โ Validates API and loads models instantly
๐ ๏ธ Ready to use โ All 3 tools available immediately
โก Local Setup Benefits
๐ฅ Fire-and-forget: Set up once, forget forever
โก Lightning startup: ~5 seconds total ready time
๐ Persistent across restarts: Survives laptop shutdowns
๐ฑ Cross-platform: Works on any OS with Node.js
๐ฏ Zero maintenance: No babysitting required
๐ง MCP Configuration
Option 1: Using npx (Recommended - No Installation Required)
The easiest way to use this MCP server is with npx, which automatically downloads and runs the package without any installation:
For Claude Code
Add to ~/.claude.json
:
For Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json
:
For Other MCP Clients
Cursor:
~/.cursor/mcp.json
Cline:
~/.cline/mcp.json
Windsurf: MCP settings file
Other agents: Check your agent's MCP documentation
โจ Benefits of npx:
๐ No installation needed - works immediately
๐ Always latest version - automatically updates
๐ฑ Cross-platform - works everywhere Node.js is installed
๐งน Clean system - no global packages required
Option 2: Global Installation (For Frequent Users)
If you plan to use this MCP server frequently, install it globally:
Then use this configuration:
Benefits of global installation:
โก Faster startup - no download time
๐ Works offline - once installed
๐ง Simpler command - shorter configuration
Option 3: Local Development
If you cloned the repo locally for development:
๐ฏ Pro Tip: Replace the API key with your actual OpenRouter key. The free model works great for most use cases!
๐ก Recommendation: Start with npx (Option 1) - it's the easiest and most reliable way to get started!
๐ก Pro Tips for Local Setup
๐ฏ Path Management
Absolute paths work best:
/path/to/openrouter-image-mcp/dist/index.js
Avoid relative paths: May break when switching directories
Use your actual path: Update the examples with your real project location
๐ง Environment Variables
Set in : Keep your API key secure
OR set in system:
export OPENROUTER_API_KEY=sk-or-v1-...
Test quickly: Run
OPENROUTER_API_KEY=... node dist/index.js
๐ Quick Verification
๐ Troubleshooting Local Issues
โ "Command not found"
โ "File not found"
โ "API key required"
๐ Local Development Workflow
๐ ๏ธ Build once:
npm run build
โ๏ธ Configure once: Add MCP config to your AI agent
๐ Restart agent: Pick up the new configuration
๐ฏ Use immediately: No manual server management needed!
๐ฅ Usage Examples
With Claude Code ๐ค
Add this to your ~/.claude.json
:
With Claude Desktop ๐ฅ๏ธ
Add this to your claude_desktop_config.json
:
๐ฏ Amazing Things You Can Do!
๐ ๏ธ Available Tools
๐ผ๏ธ analyze_image
- General Image Analysis
Perfect for photos, diagrams, charts, and general visual content!
Parameters:
type
๐ Input type:file
,url
, orbase64
data
๐ธ Image data (path, URL, or base64 string)prompt
๐ญ Custom analysis promptformat
๐ Output:text
orjson
maxTokens
๐ข Maximum response tokens (default: 4000)temperature
๐ก๏ธ Creativity 0-2 (default: 0.1)
๐ analyze_webpage_screenshot
- Webpage Specialist
Designed specifically for web page analysis and debugging!
Features:
๐ฏ Layout analysis
๐ฑ Content extraction
๐ Navigation review
๐ Form analysis
โฟ Accessibility evaluation
๐ Structured JSON output
๐ฑ analyze_mobile_app_screenshot
- Mobile App Expert
Specialized for mobile application UI/UX analysis!
Features:
๐ iOS/๐ค Android platform detection
๐จ UI design review
๐ User experience evaluation
โฟ Accessibility analysis
๐ UX heuristic scoring
๐ Performance insights
๐ฐ Vision Model Recommendations
Model | Cost | Vision Quality | Best For |
๐
| FREE | โญโญโญโญโญ | Great for beginners! General analysis, docs |
๐
| FREE | โญโญโญโญ | Charts, diagrams, technical content |
๐
| ๐ฐ Very Low | โญโญโญโญโญ | Best value! High quality at low cost |
๐ง
| ๐ฐ๐ฐ Medium | โญโญโญโญโญ | Detailed analysis, complex reasoning |
๐ฅ
| ๐ฐ๐ฐ๐ฐ Higher | โญโญโญโญโญ | High accuracy, professional use |
๐ฏ Recommended Models
๐ Start with FREE models:
google/gemini-2.0-flash-exp:free
works excellently for most use cases๐ฐ Upgrade when needed: Move to paid models only if you need higher accuracy or specific features
๐ฅ Best performance:
anthropic/claude-3-5-sonnet-20241022
for professional analysis
๐ก Cost Tips
Free models handle ~80% of use cases perfectly
Paid models cost ~$0.001-0.01 per image
Monitor usage at OpenRouter Dashboard
๐ ๏ธ Development
Local Setup ๐ง
๐งช Testing
Run Test Suite ๐งช
Manual Testing ๐ฏ
๐ค Contributing
Contributions welcome! Fork the repo, make changes, and submit a pull request. Please follow the existing code style and add tests for new features.
๐ Supported Image Formats
Format | Extension | MIME Type | Status |
๐ผ๏ธ JPEG |
,
|
| โ |
๐ผ๏ธ PNG |
|
| โ |
๐ผ๏ธ WebP |
|
| โ |
๐ผ๏ธ GIF |
|
| โ |
๐ Max Size | - | - | 10MB (configurable) |
๐ก๏ธ Security & Privacy
๐ API Keys: Loaded from environment variables only
๐ซ No Sensitive Logging: Personal data never logged
โ Input Validation: All parameters validated
๐ Size Limits: Configurable file size restrictions
๐ HTTPS Only: All API communications encrypted
๐๏ธ Data Cleanup: Temporary files automatically removed
๐ Troubleshooting
๐ง Common Issues & Solutions
๐ "OPENROUTER_API_KEY environment variable is required"
๐ค "Invalid or unsupported model"
๐ก "Failed to connect to OpenRouter API"
๐ "Image size exceeds maximum"
๐ Debug Mode
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Ready to give your AI agents the power of sight?
Made with โค๏ธ by the open-source community
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Enables AI agents to analyze and understand images using OpenRouter's vision models. Supports screenshots, photos, diagrams, and web content with specialized tools for webpage and mobile app analysis.
- ๐ What Makes This Special?
- ๐ Quick Start
- ๐ Works Locally - No Restarts Needed! ๐ฏ
- ๐ง MCP Configuration
- ๐ฅ Usage Examples
- ๐ ๏ธ Available Tools
- ๐ฐ Vision Model Recommendations
- ๐ ๏ธ Development
- ๐งช Testing
- ๐ค Contributing
- ๐ Supported Image Formats
- ๐ก๏ธ Security & Privacy
- ๐ Troubleshooting
- ๐ License