MCP 图像提取器
MCP 服务器用于提取图像并将其转换为 base64 以进行 LLM 分析。
该 MCP 服务器为 AI 助手提供以下工具:
- 从本地文件提取图像
- 从 URL 中提取图像
- 处理 base64 编码的图像
它在 Cursor 中的样子:
适用案例:
- 分析剧作家测试结果:屏幕截图
对于 Cursor 或其他客户端
手动安装
这将使mcp-image-extractor
命令在全球范围内可用。
使用 .cursor/mcp.json 文件
对于本地开发或在特定项目中工作时,您可以在项目根目录中添加.cursor/mcp.json
文件:
或者,如果您已经通过 npm link 安装:
光标用户的重要提示:如果您看到“无法创建客户端”错误,请尝试以下替代方法:
选项 1:使用直接 GitHub 安装
然后在
.cursor/mcp.json
中进行配置:选项 2:克隆并在本地运行
然后在
.cursor/mcp.json
中进行配置:
可用工具
从文件中提取图像
从本地文件中提取图像并将其转换为 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 输出的大小并优化上下文窗口的使用。
示例用法
以下是如何使用 Claude 工具的示例:
Claude 会自动使用extract_image_from_file
工具来加载和分析图像内容。
Claude 将自动使用extract_image_from_url
工具来获取和分析图像内容。
Docker
使用 Docker 构建并运行:
执照
麻省理工学院
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
模型上下文协议服务器,从 URL 或 base64 数据中提取图像并将其转换为适合 LLM 分析的格式,从而允许 AI 模型处理和理解视觉内容。
Related Resources
Related MCP Servers
- -securityFlicense-qualityA Model Context Protocol server that enables LLMs to extract and use content from unstructured documents across a wide variety of file formats.Last updated -2Python
- -securityAlicense-qualityA Model Context Protocol (MCP) server that enables Claude or other LLMs to fetch content from URLs, supporting HTML, JSON, text, and images with configurable request parameters.Last updated -PythonMIT License
- -securityAlicense-qualityA Model Context Protocol server that enables fetching and processing images from URLs, local file paths, and numpy arrays, returning them as base64-encoded strings with proper MIME types.Last updated -1PythonMIT License
- -securityFlicense-qualityA Model Context Protocol server that enables LLMs to fetch and process web content in multiple formats (HTML, JSON, Markdown, text) with automatic format detection.Last updated -TypeScript