OpenRouter Image Analysis logo

OpenRouter Image Analysis

Community
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! ๐Ÿ“ธโœจ

PublisherJonathanJude
Repositoryopenrouter-image-mcp
LanguageTypeScript
Forks
2
Stars
12
Available tools
0
Transport typestdio
Categories
LicenseMIT
Links
  • Connect tools to AI workflows

    OpenRouter Image Analysis exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    12 stars and 2 forks from the linked 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

Installation

TypingMind
Prerequisites:

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"
      }
    }
  }
}

Use OpenRouter Image Analysis MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once OpenRouter Image Analysis is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add OpenRouter Image Analysis as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the OpenRouter Image Analysis MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "openrouter-image-analysis": {
      "command": "npx",
      "args": [
        "-y",
        "openrouter-image-mcp"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the OpenRouter Image Analysis MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the OpenRouter Image Analysis MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use OpenRouter Image Analysis to help me with this task?
OpenRouter Image Analysis
Sure. I read it.
Here is what I found using OpenRouter Image Analysis.

Frequently asked questions

What is the OpenRouter Image Analysis MCP server used for?

OpenRouter Image Analysis is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use OpenRouter Image Analysis MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use OpenRouter Image Analysis with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use OpenRouter Image Analysis MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With OpenRouter Image Analysis connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect OpenRouter Image Analysis MCP to TypingMind?

OpenRouter Image Analysis runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does OpenRouter Image Analysis MCP provide in TypingMind?

OpenRouter Image Analysis exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use OpenRouter Image Analysis MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If OpenRouter Image Analysis requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter ๐Ÿ‘‡