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.
Install the package using npm:
npm install @catalystneuro/mcp_read_images
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": []
}
}
}
The server provides a single tool called analyze_image
that you can use in your code:
// 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
}
});
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
}
});
The model is selected based on the following priority:
model
argument)OPENROUTER_MODEL
environment variable)The following OpenRouter models have been tested and are compatible:
The server includes the following features:
The server handles various error cases including:
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.
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"
]
}
}
}
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.
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.