Skip to main content
Glama

MCP读取图像

一个使用 OpenRouter 视觉模型分析图像的 MCP 服务器。该服务器提供了一个简单的接口,允许通过 OpenRouter API 使用各种视觉模型(例如 Claude-3.5-sonnet 和 Claude-3-opus)分析图像。

安装

npm install @catalystneuro/mcp_read_images

Related MCP server: mcp-openvision

配置

服务器需要 OpenRouter API 密钥。您可以从OpenRouter获取。

将服务器添加到您的 MCP 设置文件(对于 VSCode,通常位于~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json ):

{
  "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": []
    }
  }
}

用法

服务器提供了一个单独的工具analyze_image ,可以用来分析图像:

// 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
  }
});

模型选择

按以下优先顺序选择模型:

  1. 工具调用中指定的模型( model参数)

  2. MCP 设置中指定的模型( OPENROUTER_MODEL环境变量)

  3. 默认模型(anthropic/claude-3.5-sonnet)

支持的型号

以下 OpenRouter 型号已经过测试:

  • 人类学/克劳德-3.5-十四行诗

  • 人类学/克劳德-3-作品-20240229

特征

  • 自动调整图像大小并进行优化

  • 可配置模型选择

  • 支持关于图像的自定义问题

  • 详细错误消息

  • 自动 JPEG 转换和质量优化

错误处理

服务器处理各种错误情况:

  • 无效的图片路径

  • 缺少 API 密钥

  • 网络错误

  • 无效的模型选择

  • 图像处理错误

每个错误都会返回一条描述性消息来帮助诊断问题。

发展

从源代码构建:

git clone https://github.com/catalystneuro/mcp_read_images.git
cd mcp_read_images
npm install
npm run build

执照

MIT 许可证。详情请参阅许可证

-
security - not tested
A
license - permissive license
-
quality - not tested

Resources

Looking for Admin?

Admins can modify the Dockerfile, update the server description, and track usage metrics. If you are the server author, to access the admin panel.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/catalystneuro/mcp_read_images'

If you have feedback or need assistance with the MCP directory API, please join our Discord server