MCP 服务器 - 图像
一个模型上下文协议 (MCP) 服务器,提供从 URL、本地文件路径和 NumPy 数组获取和处理图像的工具。该服务器包含一个名为 fetch_images 的工具,该工具会将图像以 base64 编码的字符串及其 MIME 类型返回。
支持我们
如果您觉得这个项目很有帮助,并且愿意支持未来的项目,不妨请我们喝杯咖啡!您的支持将帮助我们继续构建创新的人工智能解决方案。
您的贡献极大地激发了我们创建智能且用户友好的应用程序的热情。
目录
特征
- 从 URL (http/https) 获取图像
- 从本地文件路径加载图像
- 专门处理大型本地图像
- 大图像(>1MB)的自动图像压缩
- 多幅图像的并行处理
- 针对不同文件扩展名的正确 MIME 类型映射
- 全面的错误处理和日志记录
先决条件
- Python 3.10+
- uv 包管理器(推荐)
安装
- 克隆此存储库
- 使用 uv 创建并激活虚拟环境:
- 使用 uv 安装依赖项:
运行服务器
运行 MCP 服务器有两种方式:
1.直接法
直接启动 MCP 服务器:
2. 配置 Windsurf/Cursor
风帆冲浪
要将此 MCP 服务器添加到 Windsurf:
- 编辑配置文件 ~/.codeium/windsurf/mcp_config.json
- 添加以下配置:
光标
要将此 MCP 服务器添加到 Cursor:
- 打开 Cursor 并进入设置(导航栏 → 光标设置)
- 导航至功能→ MCP 服务器
- 点击 + 添加新的 MCP 服务器
- 输入以下配置:
可用工具
该服务器提供以下工具:
fetch_images :从 URL 或本地文件路径获取并处理图像 参数:image_sources:图像的 URL 或文件路径列表 返回:已处理图像的列表,包含 base64 编码和 MIME 类型
使用示例
您现在可以使用以下命令:
- “获取这些图片:[URL 或文件路径列表]”
- “加载并处理此本地图像:[file_path]”
示例
调试
如果您遇到任何问题:
- 检查所有依赖项是否正确安装
- 验证服务器正在运行并监听连接
- 对于本地图像加载问题,请确保文件路径正确且可访问
- 对于“不支持的图像类型”错误,请验证内容类型处理
- 查找服务器输出中的任何错误消息
贡献
欢迎贡献代码!欢迎提交 Pull 请求。
执照
该项目根据 MIT 许可证获得许可 - 有关详细信息,请参阅LICENSE文件。
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
模型上下文协议服务器,可以从 URL、本地文件路径和 numpy 数组中获取和处理图像,并将它们作为具有适当 MIME 类型的 base64 编码字符串返回。
Related MCP Servers
- AsecurityAlicenseAqualityModel Context Protocol server for fetching web content and processing images. This allows Claude Desktop (or any MCP client) to fetch web content and handle images appropriately.Last updated -127815JavaScriptMIT License
- AsecurityAlicenseAqualityA Model Context Protocol server that provides web content fetching and conversion capabilities.Last updated -4892JavaScriptMIT License
- -securityAlicense-qualityModel Context Protocol server that enables Claude Desktop (or any MCP client) to fetch web content and process images appropriately.Last updated -11MIT License
- AsecurityAlicenseAqualityA Model Context Protocol server that extracts images from URLs or base64 data and converts them into a format suitable for LLM analysis, allowing AI models to process and understand visual content.Last updated -3846MIT License