Read Images MCP server

Integrates with OpenRouter's vision models to enable image analysis and content extraction through natural language queries.
Back to servers
Provider
CatalystNeuro
Release date
Jan 27, 2025
Language
TypeScript
Stats
6 stars

The MCP Read Images server allows you to analyze images using OpenRouter vision models like Claude-3.5-sonnet and Claude-3-opus through a simple interface in your code.

Installation

Install the package using npm:

npm install @catalystneuro/mcp_read_images

Configuration

The server requires an OpenRouter API key. You can obtain one from OpenRouter.

Add the server to your MCP settings file (typically located at ~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json for VSCode users):

{
  "mcpServers": {
    "read_images": {
      "command": "read_images",
      "env": {
        "OPENROUTER_API_KEY": "your-api-key-here",
        "OPENROUTER_MODEL": "anthropic/claude-3.5-sonnet"  // optional, defaults to claude-3.5-sonnet
      },
      "disabled": false,
      "autoApprove": []
    }
  }
}

Usage

The server provides a single tool called analyze_image that you can use in your code:

Basic Usage

// Basic usage with default model
use_mcp_tool({
  server_name: "read_images",
  tool_name: "analyze_image",
  arguments: {
    image_path: "/path/to/image.jpg",
    question: "What do you see in this image?"  // optional
  }
});

Specifying a Custom Model

You can override the default model for a specific call:

use_mcp_tool({
  server_name: "read_images",
  tool_name: "analyze_image",
  arguments: {
    image_path: "/path/to/image.jpg",
    question: "What do you see in this image?",
    model: "anthropic/claude-3-opus-20240229"  // overrides default and settings
  }
});

Model Selection

The model is selected based on the following priority:

  1. Model specified in the tool call (model argument)
  2. Model specified in MCP settings (OPENROUTER_MODEL environment variable)
  3. Default model (anthropic/claude-3.5-sonnet)

Supported Models

The following OpenRouter models have been tested and are compatible:

  • anthropic/claude-3.5-sonnet
  • anthropic/claude-3-opus-20240229

Features and Error Handling

The server includes the following features:

  • Automatic image resizing and optimization
  • JPEG conversion with quality optimization
  • Detailed error messages for troubleshooting

The server handles various error cases including:

  • Invalid image paths
  • Missing API keys
  • Network errors
  • Invalid model selections
  • Image processing errors

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later