image-mcp-server

image-mcp-server

site icon
2025.04.04 6
JavaScript图像分析图像识别图像描述内容生成
image-mcp-server 是一个基于 GPT-4o-mini 模型的图像分析 MCP 服务器,能够接收图像 URL 或本地文件路径,并对图像内容进行详细分析。该服务器具有高精度的图像识别和描述能力,适用于需要图像内容分析的场景。
View on GitHub

Overview

基本能力

产品定位

image-mcp-server 是一个图像分析服务,专门用于接收图像 URL 或本地文件路径,并利用 GPT-4o-mini 模型对图像内容进行详细分析。

核心功能

  • 接收图像 URL 或本地文件路径作为输入,提供图像内容的详细分析
  • 使用 GPT-4o-mini 模型进行高精度的图像识别和描述
  • 图像 URL 有效性检查
  • 从本地文件加载图像并进行 Base64 编码

适用场景

  • 需要自动分析图像内容的应用程序
  • 图像识别和描述任务
  • 图像内容提取和处理

工具列表

  • analyze_image: 接收图像 URL 并分析其内容
  • analyze_image_from_path: 接收本地文件路径并分析其内容

常见问题解答

  • 路径转换问题: 当服务器运行在 WSL 或 Windows 上时,AI 助手需要负责路径的转换。
  • 类型错误: 在构建时可能会遇到 mime-types 模块的类型定义缺失错误,但这不影响服务器执行。可以通过安装 @types/mime-types 解决。

使用教程

使用依赖

  • 需要 Node.js 环境
  • 需要 OpenAI API 密钥

安装教程

通过 Smithery 安装

npx -y @smithery/cli install @champierre/image-mcp-server --client claude

手动安装

git clone https://github.com/champierre/image-mcp-server.git
cd image-mcp-server
npm install
npm run build

配置

设置环境变量:

OPENAI_API_KEY=your_openai_api_key

调试方式

npm run dev

MCP 服务器配置

对于 Cline

cline_mcp_settings.json 中添加:

{
  "mcpServers": {
    "image-analysis": {
      "command": "node",
      "args": ["/path/to/image-mcp-server/dist/index.js"],
      "env": {
        "OPENAI_API_KEY": "your_openai_api_key"
      }
    }
  }
}

对于 Claude Desktop App

claude_desktop_config.json 中添加:

{
  "mcpServers": {
    "image-analysis": {
      "command": "node",
      "args": ["/path/to/image-mcp-server/dist/index.js"],
      "env": {
        "OPENAI_API_KEY": "your_openai_api_key"
      }
    }
  }
}

许可证

该项目遵循 MIT 开源许可条款,请参阅 MIT 了解完整条款。