Skip to main content
Glama

MCP 图像提取器

MCP 服务器用于提取图像并将其转换为 base64 以进行 LLM 分析。

该 MCP 服务器为 AI 助手提供以下工具:

  • 从本地文件提取图像

  • 从 URL 中提取图像

  • 处理 base64 编码的图像

它在 Cursor 中的样子:

适用案例:

  • 分析剧作家测试结果:屏幕截图

对于 Cursor 或其他客户端

手动安装

# Clone and install 
git clone https://github.com/ifmelate/mcp-image-extractor.git
cd mcp-image-extractor
npm install
npm run build
npm link

这将使mcp-image-extractor命令在全球范围内可用。

使用 .cursor/mcp.json 文件

对于本地开发或在特定项目中工作时,您可以在项目根目录中添加.cursor/mcp.json文件:

{
  "mcpServers": {
    "image-extractor": {
      "command": "node",
      "args": ["/full/path/to/mcp-image-extractor/dist/index.js"],
      "disabled": false
    }
  }
}

或者,如果您已经通过 npm link 安装:

{
  "mcpServers": {
    "image-extractor": {
      "command": "mcp-image-extractor",
      "disabled": false
    }
  }
}

光标用户的重要提示:如果您看到“无法创建客户端”错误,请尝试以下替代方法:

选项 1:使用直接 GitHub 安装

git clone https://github.com/ifmelate/mcp-image-extractor.git
cd mcp-image-extractor
npm install
npm run build
npm link

然后在.cursor/mcp.json中进行配置:

{
  "mcpServers": {
    "image-extractor": {
      "command": "mcp-image-extractor",
      "disabled": false
    }
  }
}

选项 2:克隆并在本地运行

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

然后在.cursor/mcp.json中进行配置:

{
  "mcpServers": {
    "image-extractor": {
      "command": "node",
      "args": ["/full/path/to/mcp-image-extractor/dist/index.js"],
      "disabled": false
    }
  }
}

可用工具

从文件中提取图像

从本地文件中提取图像并将其转换为 base64。

参数:

  • file_path (必需):本地图像文件的路径

**注意:**所有图像都会自动调整为最佳尺寸(最大 512x512),以进行 LLM 分析,从而限制 base64 输出的大小并优化上下文窗口的使用。

从 URL 中提取图像

从 URL 中提取图像并将其转换为 base64。

参数:

  • url (必填):要提取的图像的 URL

**注意:**所有图像都会自动调整为最佳尺寸(最大 512x512),以进行 LLM 分析,从而限制 base64 输出的大小并优化上下文窗口的使用。

从base64提取图像

处理 base64 编码的图像以进行 LLM 分析。

参数:

  • base64 (必需):Base64 编码的图像数据

  • mime_type (可选,默认值:“image/png”):图像的 MIME 类型

**注意:**所有图像都会自动调整为最佳尺寸(最大 512x512),以进行 LLM 分析,从而限制 base64 输出的大小并优化上下文窗口的使用。

Related MCP server: Unstructured Document Processor MCP

示例用法

以下是如何使用 Claude 工具的示例:

Please extract the image from this local file: images/photo.jpg

Claude 会自动使用extract_image_from_file工具来加载和分析图像内容。

Please extract the image from this URL: https://example.com/image.jpg

Claude 将自动使用extract_image_from_url工具来获取和分析图像内容。

Docker

使用 Docker 构建并运行:

docker build -t mcp-image-extractor .
docker run -p 8000:8000 mcp-image-extractor

执照

麻省理工学院

Install Server
A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

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/ifmelate/mcp-image-extractor'

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