Back to MCP directory
publicPublicdnsLocal runtime

image-mcp-server

一个基于GPT-4o-mini模型的图像分析MCP服务器,可处理URL或本地路径的图像内容分析

article

README

🚀 图像分析 MCP 服务器

本项目是一个MCP服务器,可接收图像的URL或本地文件路径,并借助GPT - 4o - mini模型对图像内容进行分析,为图像内容分析提供了便捷且高效的解决方案。

🚀 快速开始

本服务器可接收图像的URL或本地文件路径作为输入,使用GPT - 4o - mini模型进行高精度的图像识别和描述,还能进行图像URL的有效性检查,以及从本地文件加载图像并进行Base64编码。安装完成后,通过node index.js命令即可启动服务器。

✨ 主要特性

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

📦 安装指南

通过Smithery安装

要自动通过Smithery为Claude Desktop安装Image Analysis Server:

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

手动安装

# 克隆仓库
git clone https://github.com/champierre/image-mcp-server.git # 或者你的 forked 仓库
cd image-mcp-server

# 安装依赖
npm install

# 编译 TypeScript
npm run build

🔧 技术细节

使用此服务器需要一个OpenAI API密钥。设置以下环境变量:

OPENAI_API_KEY=your_openai_api_key

与Cline等工具一起使用时,将以下配置添加到MCP服务器配置文件中:

对于Cline

将以下内容添加到cline_mcp_settings.json

{
  "mcpServers": {
    "@champierre/image-mcp-server": {
      "command": "node index.js"
    }
  }
}

对于Claude Desktop App

将以下内容添加到config.json(Claude件的配置文件):

{
  "servers": {
    "@champierre/image-mcp-server": {
      "executablePath": "path/to/node",
      "commandLineArguments": ["index.js"]
    }
  }
}

💻 使用示例

基础用法

安装完成后,你可以通过以下命令启动服务器:

node index.js

高级用法

支持的接口:

  • GET /analyze:分析图像内容
  • POST /process-image:处理图像文件

📄 许可证

MIT

⚠️ 重要提示

在构建过程中可能会遇到类型错误。要解决此问题,请运行以下命令安装依赖项:

npm install @types/mime-types
# 或者
yarn add --dev @types/mime-types

💡 使用建议

要在开发模式下运行服务器,请执行以下命令:

npm run dev
help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client