MCP Image Extractor
一个模型上下文协议服务器,用于从 URL 或 base64 数据中提取图像,并将其转换为适合 LLM 分析的格式,从而使 AI 模型能够处理和理解视觉内容。
Tools
extract_image_from_file
extract_image_from_url
extract_image_from_base64
README
MCP 图像提取器
用于提取图像并将其转换为 base64 以进行 LLM 分析的 MCP 服务器。
此 MCP 服务器为 AI 助手提供以下工具:
- 从本地文件提取图像
- 从 URL 提取图像
- 处理 base64 编码的图像
<a href="https://glama.ai/mcp/servers/@ifmelate/mcp-image-extractor"> <img width="380" height="200" src="https://glama.ai/mcp/servers/@ifmelate/mcp-image-extractor/badge" alt="Image Extractor MCP server" /> </a>
在 Cursor 中的显示效果:
<img width="687" alt="image" src="https://github.com/user-attachments/assets/8954dbbd-7e7a-4f27-82a7-b251bd3c5af2" />
适用场景:
- 分析 playwright 测试结果:屏幕截图
适用于 Cursor 或其他客户端
手动安装
# 克隆并安装
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
}
}
}
Cursor 用户的重要提示:如果您看到“Failed to create client”错误,请尝试以下替代方案:
选项 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 } } }
可用工具
extract_image_from_file
从本地文件提取图像并将其转换为 base64。
参数:
file_path(必需): 本地图像文件的路径
注意: 所有图像都会自动调整大小到最佳尺寸(最大 512x512),以便进行 LLM 分析,从而限制 base64 输出的大小并优化上下文窗口的使用。
extract_image_from_url
从 URL 提取图像并将其转换为 base64。
参数:
url(必需): 要提取的图像的 URL
注意: 所有图像都会自动调整大小到最佳尺寸(最大 512x512),以便进行 LLM 分析,从而限制 base64 输出的大小并优化上下文窗口的使用。
extract_image_from_base64
处理 base64 编码的图像以进行 LLM 分析。
参数:
base64(必需): Base64 编码的图像数据mime_type(可选, 默认值: "image/png"): 图像的 MIME 类型
注意: 所有图像都会自动调整大小到最佳尺寸(最大 512x512),以便进行 LLM 分析,从而限制 base64 输出的大小并优化上下文窗口的使用。
使用示例
以下是如何从 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
许可证
MIT
推荐服务器
AIO-MCP Server
🚀 集成了 AI 搜索、RAG 和多服务(GitLab/Jira/Confluence/YouTube)的一体化 MCP 服务器,旨在增强 AI 驱动的开发工作流程。来自 Folk。
Knowledge Graph Memory Server
为 Claude 实现持久性记忆,使用本地知识图谱,允许 AI 记住用户的信息,并可在自定义位置存储,跨对话保持记忆。
https://github.com/Streen9/react-mcp
react-mcp 与 Claude Desktop 集成,能够根据用户提示创建和修改 React 应用程序。
any-chat-completions-mcp
将 Claude 与任何 OpenAI SDK 兼容的聊天完成 API 集成 - OpenAI、Perplexity、Groq、xAI、PyroPrompts 等。
Exa MCP Server
一个模型上下文协议服务器,它使像 Claude 这样的人工智能助手能够以安全和受控的方式,使用 Exa AI 搜索 API 执行实时网络搜索。
AI 图像生成服务
可以用于 Cursor 集成 MCP 服务器。
MCP Web Research Server
一个模型上下文协议服务器,使 Claude 能够通过集成 Google 搜索、提取网页内容和捕获屏幕截图来进行网络研究。
MySQL MCP Server
允许人工智能助手通过受控界面列出表格、读取数据和执行 SQL 查询,从而使数据库探索和分析更安全、更有条理。
browser-use MCP server
一个由人工智能驱动的浏览器自动化服务器,它实现了模型上下文协议,从而能够使用自然语言控制网页浏览器,以执行诸如导航、表单填写和视觉交互等任务。
mcp-codex-keeper
作为开发知识的守护者,为 AI 助手提供精心策划的最新文档和最佳实践访问权限。