OpenRouter图像分析
STDIO使用OpenRouter视觉模型分析图像
使用OpenRouter视觉模型分析图像
An MCP server for analyzing images using OpenRouter vision models. This server provides a simple interface to analyze images using various vision models like Claude-3.5-sonnet and Claude-3-opus through the OpenRouter API.
npm install @catalystneuro/mcp_read_images
The server requires an OpenRouter API key. You can get one from OpenRouter.
Add the server to your MCP settings file (usually located at ~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
for VSCode):
{ "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": [] } } }
The server provides a single tool analyze_image
that can be used to analyze images:
// 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 } }); // Using a specific model for this 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 } });
The model is selected in the following order of precedence:
model
argument)OPENROUTER_MODEL
environment variable)The following OpenRouter models have been tested:
The server handles various error cases:
Each error will return a descriptive message to help diagnose the issue.
To build from source:
git clone https://github.com/catalystneuro/mcp_read_images.git cd mcp_read_images npm install npm run build
MIT License. See LICENSE for details.