
MCP服务器允许LLM在代理模式下随时分析图像
概览
MCP服务器用于提取和转换为base64进行LLM分析。 该MCP服务器为AI助手提供工具:- 从本地文件中提取图像 - 从URL中提取图像- 处理base64编码图像 适用案例:- 分析剧作家测试结果:截图 推荐的安装MCP服务器的方法是直接在你的.cursor/mcp.json文件中使用npx: 这种方法:- 自动安装最新版本 - 无需全局安装 - 在不同环境中可靠地工作 如果你更愿意使用本地安装包,可以克隆仓库并指向构建文件: 这将使mcp-image-extractor命令全局可用。 : 如果你看到“创建客户端失败”错误,可以尝试上面的本地路径安装方法,或者确保你使用的是可执行文件的正确路径。
概述(AI 翻译)
MCP服务器用于提取和转换为base64进行LLM分析。
该MCP服务器为AI助手提供工具:
- 从本地文件中提取图像
- 从URL中提取图片
- Process base64编码图像
光标显示的样子:
适用案例:
- 分析剧作家测试结果:截图
安装
推荐:在mcp.json中使用npx(最简单)
推荐安装MCP服务器的方法是直接在你的.cursor/mcp.json文件中使用npx:
这种方法:
- 自动安装最新版本
- 无需全局安装
- 在不同环境中可靠运行
替代方案:本地路径安装
如果你更愿意使用本地安装包,可以克隆仓库并指向构建文件:
手动安装
这样 mcp-image-extractor 命令将全局可用。
然后在.cursor/mcp.json中配置:
光标用户排查:如果出现“创建客户端失败”错误,请尝试上面的本地路径安装方法,或者确保你使用的是正确的可执行程序路径。
可用工具
extract_image_from_file
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
MCP Image Extractor
MCP server for extracting and converting images to base64 for LLM analysis.
This MCP server provides tools for AI assistants to:
- Extract images from local files
- Extract images from URLs
- Process base64-encoded images
How it looks in Cursor:
Suitable cases:
- analyze playwright test results: screenshots
Installation
Recommended: Using npx in mcp.json (Easiest)
The recommended way to install this MCP server is using npx directly in your .cursor/mcp.json file:
{
"mcpServers": {
"image-extractor": {
"command": "npx",
"args": [
"-y",
"mcp-image-extractor"
]
}
}
}
This approach:
- Automatically installs the latest version
- Does not require global installation
- Works reliably across different environments
Alternative: Local Path Installation
If you prefer to use a local installation of the package, you can clone the repository and point to the built files:
{
"mcpServers": {
"image-extractor": {
"command": "node",
"args": ["/full/path/to/mcp-image-extractor/dist/index.js"],
"disabled": false
}
}
}
Manual Installation
# Clone and install
git clone https://github.com/ifmelate/mcp-image-extractor.git
cd mcp-image-extractor
npm install
npm run build
npm link
This will make the mcp-image-extractor command available globally.
Then configure in .cursor/mcp.json:
{
"mcpServers": {
"image-extractor": {
"command": "mcp-image-extractor",
"disabled": false
}
}
}
Troubleshooting for Cursor Users: If you see “Failed to create client” error, try the local path installation method above or ensure you’re using the correct path to the executable.
Available Tools
extract_image_from_file
Extracts an image from a local file and converts it to base64.
Parameters:
file_path(required): Path to the local image file
Note: All images are automatically resized to optimal dimensions (max 512x512) for LLM analysis to limit the size of the base64 output and optimize context window usage.
extract_image_from_url
Extracts an image from a URL and converts it to base64.
Parameters:
url(required): URL of the image to extract
Note: All images are automatically resized to optimal dimensions (max 512x512) for LLM analysis to limit the size of the base64 output and optimize context window usage.
extract_image_from_base64
Processes a base64-encoded image for LLM analysis.
Parameters:
base64(required): Base64-encoded image datamime_type(optional, default: “image/png”): MIME type of the image
安装
npx -y mcp-image-extractor配置
{
"mcpServers": {
"image-extractor": {
"command": "npx",
"args": [
"-y",
"mcp-image-extractor"
]
}
}
}