πΌοΈπ€ 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