Logo vun OpenRouter Image Analysis

OpenRouter Image Analysis

Communautéit
JonathanJude

đŸ–Œïž OpenRouter Image MCP: Supercharge AI agents with vision! đŸ”„ Analyze screenshots, debug UI, extract text from images. Works locally with zero restarts - configure once and forget! 📾✹

EditeurJonathanJude
Repositoryopenrouter-image-mcp
SproochTypeScript
Forks
2
StÀren
12
Disponibel Tools
0
Transporttypstdio
Kategorien
LizenzMIT
Linken
  • Tools mat KI-Workflows verbannen

    OpenRouter Image Analysis stellt MCP-Funktioune bereit, déi vu kompatibele KI-Clienten a KI-Agente kënne benotzt ginn.

  • 0 disponibel Tools

    Kuckt Iech déi opruffbar Aktiounen hei drënner un, mat Nimm a Beschreiwungen, wa se vum Server geliwwert ginn.

  • Konfiguratioun fir ze kopĂ©ieren

    Benotzt d'Installatiounsbeispiller, fir dĂ«se Server an Ärem bevorzugte MCP-Client ze konfigurĂ©ieren.

  • Indicateure fir Open Source

    12 StÀren an 2 Forks aus dem verlinkte Repository.

đŸ–ŒïžđŸ€– OpenRouter Image MCP Server

npm version License: MIT TypeScript Node.js

đŸ”„ 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 📩

bash
# 🌟 Option 1: Use immediately with npx (recommended)
npx openrouter-image-mcp

# 🚀 Option 2: Install globally for frequent use
npm install -g openrouter-image-mcp

# đŸ› ïž Option 3: Clone and build locally
git clone https://github.com/JonathanJude/openrouter-image-mcp.git
cd openrouter-image-mcp
npm install
npm run build
npm install -g .

💡 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)

bash
# 🔑 Set your API key
export OPENROUTER_API_KEY=sk-or-v1-your-api-key-here

# 🎯 Set model (uses free model by default)
export OPENROUTER_MODEL=google/gemini-2.0-flash-exp:free

Method 2: .env File

bash
# 📋 Copy the environment template
cp .env.example .env

# ✏ Edit with your credentials
nano .env

Add your OpenRouter credentials to .env:

bash
# 🔑 Required
OPENROUTER_API_KEY=sk-or-v1-your-api-key-here

# 🆓 Model (FREE by default - great for getting started!)
OPENROUTER_MODEL=google/gemini-2.0-flash-exp:free

# đŸŽ›ïž Optional settings
LOG_LEVEL=info
MAX_IMAGE_SIZE=10485760
RETRY_ATTEMPTS=3

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

  1. 🎯 Configure once → Set up your MCP client one time
  2. 🚀 Auto-launches → Client starts the server automatically
  3. 🔧 Connects → Validates API and loads models instantly
  4. đŸ› ïž 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:

json
{
  "mcp": {
    "servers": {
      "openrouter-image": {
        "command": "npx",
        "args": ["openrouter-image-mcp"],
        "env": {
          "OPENROUTER_API_KEY": "sk-or-v1-your-api-key-here",
          "OPENROUTER_MODEL": "google/gemini-2.0-flash-exp:free"
        }
      }
    }
  }
}

For Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:

json
{
  "mcpServers": {
    "openrouter-image": {
      "command": "npx",
      "args": ["openrouter-image-mcp"],
      "env": {
        "OPENROUTER_API_KEY": "sk-or-v1-your-api-key-here",
        "OPENROUTER_MODEL": "google/gemini-2.0-flash-exp:free"
      }
    }
  }
}

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:

bash
npm install -g openrouter-image-mcp

Then use this configuration:

json
{
  "mcp": {
    "servers": {
      "openrouter-image": {
        "command": "openrouter-image-mcp",
        "env": {
          "OPENROUTER_API_KEY": "sk-or-v1-your-api-key-here",
          "OPENROUTER_MODEL": "google/gemini-2.0-flash-exp:free"
        }
      }
    }
  }
}

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:

json
{
  "mcpServers": {
    "openrouter-image": {
      "command": "node",
      "args": ["/path/to/openrouter-image-mcp/dist/index.js"],
      "env": {
        "OPENROUTER_API_KEY": "sk-or-v1-your-api-key-here",
        "OPENROUTER_MODEL": "google/gemini-2.0-flash-exp:free"
      }
    }
  }
}

🎯 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 .env file: 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

bash
# 🔍 Test if server works
export OPENROUTER_API_KEY=sk-or-v1-your-key
export OPENROUTER_MODEL=google/gemini-2.5-flash-lite-preview-09-2025
node dist/index.js

# ✅ Should see logs: "Starting OpenRouter Image MCP Server"

🐛 Troubleshooting Local Issues

❌ "Command not found"

bash
# ✅ Use absolute path to node
"$(which node)" "/path/to/openrouter-image-mcp/dist/index.js"

❌ "File not found"

bash
# ✅ Verify the built file exists
ls -la /path/to/openrouter-image-mcp/dist/index.js

# 📝 Rebuild if missing
npm run build

❌ "API key required"

bash
# ✅ Check your environment variables
echo $OPENROUTER_API_KEY

# 🔧 Or create .env file
echo "OPENROUTER_API_KEY=sk-or-v1-your-key" > .env

🌟 Local Development Workflow

  1. đŸ› ïž Build once: npm run build
  2. ⚙ Configure once: Add MCP config to your AI agent
  3. 🔄 Restart agent: Pick up the new configuration
  4. 🎯 Use immediately: No manual server management needed!

đŸ”„ Usage Examples

With Claude Code đŸ€–

Add this to your ~/.claude.json:

json
{
  "mcp": {
    "servers": {
      "openrouter-image": {
        "command": "npx",
        "args": ["openrouter-image-mcp"],
        "env": {
          "OPENROUTER_API_KEY": "sk-or-v1-your-api-key-here",
          "OPENROUTER_MODEL": "google/gemini-2.0-flash-exp:free"
        }
      }
    }
  }
}

With Claude Desktop đŸ–„ïž

Add this to your claude_desktop_config.json:

json
{
  "mcpServers": {
    "openrouter-image": {
      "command": "npx",
      "args": ["openrouter-image-mcp"],
      "env": {
        "OPENROUTER_API_KEY": "sk-or-v1-your-api-key-here",
        "OPENROUTER_MODEL": "google/gemini-2.0-flash-exp:free"
      }
    }
  }
}

🎯 Amazing Things You Can Do!

bash
# 📾 Analyze any screenshot
"Analyze this screenshot: /path/to/screenshot.png"

# 🔍 Extract text from images
"What text do you see in this document: /path/to/scan.jpg"

# 🎹 Review UI designs
"Review this UI mockup for accessibility issues: /path/to/design.png"

# đŸ“± Debug mobile apps
"Analyze this mobile app screenshot for UX problems: /path/to/app.png"

# 🌐 Analyze webpages
"What can you tell me about this webpage: https://example.com/screenshot.png"

đŸ› ïž Available Tools

đŸ–Œïž analyze_image - General Image Analysis

Perfect for photos, diagrams, charts, and general visual content!

Parameters:

  • type 📁 Input type: file, url, or base64
  • data 📾 Image data (path, URL, or base64 string)
  • prompt 💭 Custom analysis prompt
  • format 📊 Output: text or json
  • 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

ModelCostVision QualityBest For
🆓 google/gemini-2.0-flash-exp:freeFREE⭐⭐⭐⭐⭐Great for beginners! General analysis, docs
🆓 meta-llama/llama-3.2-90b-vision-instructFREE⭐⭐⭐⭐Charts, diagrams, technical content
🌟 google/gemini-2.5-flash-lite-preview-09-2025💰 Very Low⭐⭐⭐⭐⭐Best value! High quality at low cost
🧠 anthropic/claude-3-5-sonnet-20241022💰💰 Medium⭐⭐⭐⭐⭐Detailed analysis, complex reasoning
đŸ”„ anthropic/claude-3-5-haiku-20241022💰💰💰 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 🔧

bash
# 🍮 Clone the repository
git clone https://github.com/your-username/openrouter-image-mcp.git
cd openrouter-image-mcp

# 📩 Install dependencies
npm install

# 🔹 Build the project
npm run build

# 🚀 Start in development mode
npm run dev

# đŸ§Ș Run tests
npm test

# 🔍 Lint and format
npm run lint
npm run format


đŸ§Ș Testing

Run Test Suite đŸ§Ș

bash
# đŸ§Ș Run all tests
npm test

# 📊 Run with coverage
npm run test:coverage

# 🔍 Debug mode
DEBUG=* npm test

Manual Testing 🎯

bash
# 📾 Test with a sample image
node test-image-analysis.js

# 🔍 Test different models
OPENROUTER_MODEL=anthropic/claude-sonnet-4 node test-image-analysis.js

# 🚀 Test with URL input
echo '{"type":"url","data":"https://example.com/image.png","prompt":"What do you see?"}' | node dist/index.js

đŸ€ 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

FormatExtensionMIME TypeStatus
đŸ–Œïž JPEG.jpg, .jpegimage/jpeg✅
đŸ–Œïž PNG.pngimage/png✅
đŸ–Œïž WebP.webpimage/webp✅
đŸ–Œïž GIF.gifimage/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"

bash
# ✅ Solution: Set your API key
export OPENROUTER_API_KEY=sk-or-v1-your-key-here
# Or add to .env file

đŸ€– "Invalid or unsupported model"

bash
# ✅ Check available models
curl -H "Authorization: Bearer $OPENROUTER_API_KEY" \
  https://openrouter.ai/api/v1/models | jq '.data[] | select(.architecture.input_modalities | contains(["image"])) | .id'

📡 "Failed to connect to OpenRouter API"

bash
# ✅ Test connection
curl -H "Authorization: Bearer $OPENROUTER_API_KEY" \
  https://openrouter.ai/api/v1/models

📏 "Image size exceeds maximum"

bash
# ✅ Increase limit or compress image
export MAX_IMAGE_SIZE=20971520  # 20MB

🐛 Debug Mode

bash
# 🔍 Enable detailed logging
export LOG_LEVEL=debug
npm start

# 📊 Monitor API usage
curl -H "Authorization: Bearer $OPENROUTER_API_KEY" \
  https://openrouter.ai/api/v1/auth/key

📄 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?

⭐ Star this repo ‱ 🐛 Report Issues ‱ 💡 Suggest Features

Made with ❀ by the open-source community

Installatioun

TypingMind
Viraussetzungen:

Node.js 18+

{
  "mcpServers": {
    "openrouter-image": {
      "command": "npx",
      "args": [
        "openrouter-image-mcp"
      ],
      "env": {
        "OPENROUTER_API_KEY": "sk-or-v1-your-api-key-here",
        "OPENROUTER_MODEL": "google/gemini-2.0-flash-exp:free"
      }
    }
  }
}

OpenRouter Image Analysis MCP mat verschiddene KI-Modeller benotzen

TypingMind verbĂ«nnt MCP-Tools um Niveau vum AarbechtsberĂ€ich. Soubal OpenRouter Image Analysis verbonnen ass, kĂ«nnt Dir et mat verschiddene KI-Modeller an TypingMind benotzen, amplaz et fir all Modell separat anzeriichten. DĂ«s MCP-Integratioun leeft lokal iwwer den TypingMind-MCP-Connector op Ärem Apparat.

Ariichtungsuleedung fir de lokale Connector ze benotzen

Benotzt dĂ«s Optioun, wann den MCP-Server ZougrĂ«ff op lokal Fichieren, Appen oder privat Ressourcen op Ärem Computer brauch.

1

D'MCP-Astellungen opmaachen

Gitt an TypingMind op „Astellungen“, „Erweidert Astellungen“, dann op „Model Context Protocol“ a wielt „Connector ariichten“.

  1. Maacht TypingMind an Ärem Browser op.
  2. Klickt op d'Astellungssymbol.
  3. Gitt op „Erweidert Astellungen“.
  4. Maacht d'Sektioun „Model Context Protocol“ op.
  5. Klickt op „Connector ariichten“ a wielt „DĂ«sen Apparat“.
Ariichtungsbildschierm vum TypingMind-MCP-Connector mat „DĂ«sen Apparat“ ausgewielt
2

De Connector-Befeel ausféieren

Wielt „DĂ«sen Apparat“, kopĂ©iert de Befeel aus TypingMind a fĂ©iert en am Terminal aus. Loosst de Prozess lafen, wĂ€rend Dir MCP benotzt.

  1. Kopéiert den Ariichtungsbefeel, deen TypingMind uweist.
  2. Maacht Terminal op macOS oder Windows Terminal op Windows op.
  3. Pescht de Befeel an a féiert en aus.
  4. BestÀtegt d'Installatioun vum Package, wann den Terminal Iech freet, ob Dir weiderfuere wëllt.
  5. Loosst den Terminal an de Prozess doranner lafen, wÀrend Dir MCP-Tools benotzt.
3

OpenRouter Image Analysis als Server derbÀisetzen

Wann de Connector-Status „Prett“ ass, klickt op „Serveren Ă€nneren“ a pescht d'MCP-Serverkonfiguratioun an.

  1. Waart, bis de Connector-Status „Prett“ weist.
  2. Klickt op „Serveren Ă€nneren“.
  3. Pescht d'MCP-Serverkonfiguratioun vu OpenRouter Image Analysis an.
  4. SpÀichert d'Serverlëscht.
  5. Aktualiséiert, wann Dir kontrolléiere wëllt, ob de Connector nach ëmmer prett ass.
MCP-Astellunge vun TypingMind mat aktivem Server an dem KnĂ€ppchen „Serveren Ă€nneren“
{
  "mcpServers": {
    "openrouter-image-analysis": {
      "command": "npx",
      "args": [
        "-y",
        "openrouter-image-mcp"
      ]
    }
  }
}
4

D'Verbindung mat verschiddene Modeller benotzen

SpĂ€ichert d'ServerlĂ«scht, maacht „Plugins“ op an aktivĂ©iert d'MCP-Tools vu OpenRouter Image Analysis. Wielt dann e belibegen Ă«nnerstĂ«tzte KI-Modell an TypingMind a benotzt d'Tools am Chat oder weist se engem KI-Agent zou.

  1. Maacht d'SĂ€it „Plugins“ an TypingMind op.
  2. Aktivéiert d'MCP-Tools vu OpenRouter Image Analysis.
  3. Start e Chat a wielt de KI-Modell, deen Dir benotze wëllt.
  4. Benotzt d'MCP-Tools am Chat oder weist se engem KI-Agent zou.
  5. Wiesselt bei Bedarf op en anere KI-Modell, ouni MCP nei ze verbannen.
TypingMind-Chat mat aktivéierte MCP-Tools an engem ausgewielte KI-Modell
Hëlleft Dir mir bei dëser Aufgab mat OpenRouter Image Analysis?
OpenRouter Image Analysis
Jo. Ech hunn et gelies.
Dat hunn ech mat OpenRouter Image Analysis fonnt.

Heefeg gestallte Froen

Fir wat gëtt de MCP-Server OpenRouter Image Analysis benotzt?

OpenRouter Image Analysis ass e MCP-Server, deen et kompatibele KI-Clienten erlaabt, sech mat externen Tools a Kontext ze verbannen. An TypingMind kĂ«nnt Dir dĂ«se MCP-Server eemol derbĂ€isetzen a seng Tools an Ärem KI-AarbechtsberĂ€ich zur VerfĂŒgung stellen.

Kann ech OpenRouter Image Analysis MCP mat méi KI-Modeller an TypingMind benotzen?

Jo. TypingMind verbënnt MCP-Tools um Niveau vum AarbechtsberÀich. Sou kënnt Dir OpenRouter Image Analysis mat verschiddene KI-Modeller wéi Claude, ChatGPT, Gemini oder anere Modeller benotzen, déi Dir an TypingMind konfiguréiert hutt, ouni de MCP-Server fir all Modell separat anzeriichten.

Firwat OpenRouter Image Analysis MCP mat TypingMind benotzen?

TypingMind ass eng vun de beschte BenotzeruewerflĂ€che fir LLM-Chat, well et mĂ©i KI-Modeller, Prompts, Plugins, KI-Agenten, API-SchlĂ«sselen a MCP-Tools an engem AarbechtsberĂ€ich zesummebrĂ©ngt. Wann OpenRouter Image Analysis verbonnen ass, kĂ«nnt Dir seng MCP-Tools mat Äre bevorzugte Modeller benotzen a glĂ€ichzĂ€iteg Är Chataarbecht an TypingMind organisĂ©ieren.

Wéi verbannen ech OpenRouter Image Analysis MCP mat TypingMind?

OpenRouter Image Analysis leeft iwwer de lokale MCP-Connector vun TypingMind. Dat eegent sech am beschten, wann de MCP-Server ZougrĂ«ff op lokal Fichieren, Desktop-Apps, Kommandozeilen-Tools oder privat Ressourcen op Ärem Computer brauch.

WĂ©i eng Tools stellt OpenRouter Image Analysis MCP an TypingMind zur VerfĂŒgung?

OpenRouter Image Analysis stellt MCP-Funktiounen zur VerfĂŒgung, dĂ©i Dir op der Plugins-SĂ€it vun TypingMind aktivĂ©iere kĂ«nnt, fir se am Chat ze benotzen oder KI-Agenten zouzeweisen.

Muss ech meng API-Schlëssele mat TypingMind deelen, fir OpenRouter Image Analysis MCP ze benotzen?

Nee. TypingMind setzt op lokal Veraarbechtung a lĂ©isst Iech d'Kontroll iwwer Är Modellubidder, API-SchlĂ«sselen, Prompts a MCP-Konfiguratioun. Wann OpenRouter Image Analysis eng AuthentifizĂ©ierung verlaangt, setzt dĂ©i nĂ©ideg Headeren, OAuth-Astellungen oder lokal Konfiguratioun fir dee MCP-Server derbĂ€i, wann Dir d'Verbindung erstallt.

Änlech MCP-Serveren

All weisen

Elo Ären eegene KI-Workspace ariichten

AbonnĂ©iert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukĂŒnfteg GewĂ«nnspiller informĂ©iert ze ginn 👇