mcp-vision-analyze

mcp-vision-analyze

Provides AI vision analysis via OpenRouter, enabling image understanding from local paths or URLs. Supports OCR, error diagnosis, and chart/UI analysis using Gemini models.

Category
访问服务器

README

🔍 MCP Vision Analyze

A lightweight Model Context Protocol (MCP) server for AI image vision analysis. Powered by OpenRouter (Google Gemini, Grok, and more).

Works with: Claude Desktop, Claude Code CLI, Antigravity, Cursor, Pi Agent, Windsurf, Cline, VS Code, and any MCP-compatible client.


✨ Features

  • 🖼️ Analyze images from local file paths or HTTP(S) URLs
  • 🧠 Powered by Google Gemini models via OpenRouter
  • 💰 Ultra cheap — ~$0.0001 per image (free tier available)
  • 📝 Extract text from screenshots (OCR)
  • 🐛 Diagnose error messages in screenshots
  • 📊 Analyze charts, diagrams, and UI designs
  • 🚀 No rate limits — production ready
  • 🔒 Secure — API keys stay local, never stored externally

📦 Pricing (OpenRouter)

Model Input Output Best For
google/gemini-2.5-flash-lite $0.10/M tokens $0.40/M tokens Default — cheapest
google/gemini-3.1-flash-lite $0.25/M tokens $1.50/M tokens Better quality
google/gemini-3-flash-preview $0.50/M tokens $3.00/M tokens Best reasoning
google/gemini-3.7-flash $0.38/M tokens $1.88/M tokens Latest model
x-ai/grok-4.5 $2.00/M tokens $6.00/M tokens Grok vision

💡 1 image analysis ≈ 1,300 input tokens + 150 output tokens ≈ $0.0001 💡 Free tier available — no credit card needed to start


🚀 Quick Start

1. Get an API Key

Sign up at OpenRouter and get your API key from openrouter.ai/keys.

2. Install

# Option A: Use directly with npx (recommended)
npx mcp-vision-analyze

# Option B: Clone and install manually
git clone https://github.com/rezkycodes/mcp-vision-analyze.git
cd mcp-vision-analyze
npm install

3. Configure Your MCP Client

Choose your client below. Set OPENROUTER_API_KEY in the env block.

Claude Desktop (claude_desktop_config.json)

{
  "mcpServers": {
    "vision-analyze": {
      "command": "npx",
      "args": ["-y", "mcp-vision-analyze"],
      "env": {
        "OPENROUTER_API_KEY": "sk-or-v1-your-openrouter-key"
      }
    }
  }
}

Claude Code CLI

claude mcp add vision-analyze \
  -e OPENROUTER_API_KEY=sk-or-v1-your-openrouter-key \
  -- npx -y mcp-vision-analyze

# Or add to .mcp.json in your project root

Or add to .mcp.json in your project root:

{
  "mcpServers": {
    "vision-analyze": {
      "command": "npx",
      "args": ["-y", "mcp-vision-analyze"],
      "env": {
        "OPENROUTER_API_KEY": "sk-or-v1-your-openrouter-key"
      }
    }
  }
}

Antigravity

Add via Settings → MCP, or edit ~/.gemini/antigravity/mcp_config.json:

{
  "mcpServers": {
    "vision-analyze": {
      "command": "npx",
      "args": ["-y", "mcp-vision-analyze"],
      "env": {
        "OPENROUTER_API_KEY": "sk-or-v1-your-openrouter-key"
      }
    }
  }
}

Pi Agent (~/.pi/agent/mcp.json)

{
  "vision-analyze": {
    "transport": "stdio",
    "command": "npx",
    "args": ["-y", "mcp-vision-analyze"],
    "env": {
      "OPENROUTER_API_KEY": "sk-or-v1-your-openrouter-key"
    },
    "directTools": true
  }
}

Cursor (.cursor/mcp.json)

{
  "mcpServers": {
    "vision-analyze": {
      "command": "npx",
      "args": ["-y", "mcp-vision-analyze"],
      "env": {
        "OPENROUTER_API_KEY": "sk-or-v1-your-openrouter-key"
      }
    }
  }
}

VS Code (~/.config/Code/User/mcp.json)

{
  "servers": {
    "vision-analyze": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "mcp-vision-analyze"],
      "env": {
        "OPENROUTER_API_KEY": "sk-or-v1-your-openrouter-key"
      }
    }
  }
}

OpenCode (~/.config/opencode/opencode.json)

{
  "mcp": {
    "vision-analyze": {
      "type": "local",
      "command": ["node", "/path/to/index.js"],
      "environment": {
        "OPENROUTER_API_KEY": "sk-or-v1-your-openrouter-key"
      },
      "enabled": true
    }
  }
}

🛠️ Usage

Once configured, the vision_analyze tool becomes available:

Basic — Analyze a Screenshot

{
  "image_url": "/path/to/screenshot.png",
  "prompt": "What is shown in this screenshot?"
}

Extract Text (OCR)

{
  "image_url": "/path/to/photo.png",
  "prompt": "Extract all text from this image"
}

Diagnose an Error

{
  "image_url": "/path/to/error.png",
  "prompt": "What error is shown and how to fix it?"
}

Use a Different Model

{
  "image_url": "/path/to/image.png",
  "prompt": "Analyze this chart",
  "model": "google/gemini-3-flash-preview"
}

Use Grok Vision

{
  "image_url": "/path/to/image.png",
  "prompt": "Describe this image",
  "model": "x-ai/grok-4.5"
}

📁 Project Structure

mcp-vision-analyze/
├── index.js            # MCP server (OpenRouter only)
├── package.json        # npm metadata
├── .env.example        # Config template
├── .env                # Your API keys (git-ignored)
├── .gitignore          # Git ignore rules
├── LICENSE             # MIT
└── README.md           # This file

🔧 Environment Variables

Variable Required Default Description
VISION_PROVIDER No openrouter Provider (only openrouter supported)
OPENROUTER_API_KEY ✅ Yes OpenRouter API key
OPENROUTER_MODEL No google/gemini-2.5-flash-lite OpenRouter model

📦 Available Models

Model Cost (input/output per M) Quality
google/gemini-2.5-flash-lite $0.10 / $0.40 ⭐⭐⭐⭐ Best value
google/gemini-3.1-flash-lite $0.25 / $1.50 ⭐⭐⭐⭐ Great
google/gemini-3-flash-preview $0.50 / $3.00 ⭐⭐⭐⭐⭐ Best
google/gemini-3.7-flash $0.38 / $1.88 ⭐⭐⭐⭐⭐ Latest
x-ai/grok-4.5 $2.00 / $6.00 ⭐⭐⭐⭐ Grok

🤝 Supported Image Formats

  • JPEG / JPG
  • PNG
  • GIF
  • WebP
  • BMP (auto-converted)
  • SVG (auto-rasterized)

❓ FAQ

How much does it cost?

~$0.0001 per image analysis. Free tier available — no credit card needed.

Can I use Grok for vision?

Yes! Set model: "x-ai/grok-4.5". Grok is not free on OpenRouter.

Does it work offline?

No. Internet connection required for API calls.

Is my image data stored?

No. Images are processed in-memory and sent directly to OpenRouter. Nothing is stored on disk.


📄 License

MIT


🙏 Credits

Inspired by the vision_analyze tool from Hermes Agent.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选
mcp-server-qdrant

mcp-server-qdrant

这个仓库展示了如何为向量搜索引擎 Qdrant 创建一个 MCP (Managed Control Plane) 服务器的示例。

官方
精选