GM

groundlight/mcp-vision

部署与 DevOps

本页由 AI 翻译,技术细节请以原文为准。 查看原文

64 stars 14 forks 质量 59 趋势 0MIT

Groundlight/MCP-Vision 是从 https://github.com/groundlight/mcp-vision. 导入的 MCP 服务器候选

概览

Groundlight/MCP-Vision 是从 https://github.com/groundlight/mcp-vision. 导入的 MCP 服务器候选

概述(AI 翻译)

一个模型上下文协议(MCP)服务器,将HuggingFace计算机视觉模型(如零样本物体检测)作为工具展示,增强大型语言或视觉语言模型的视觉能力。

该仓库正在积极开发中。请参见下文,了解目前可用的工具详情。

安装

克隆仓库:

构建本地 Docker 镜像:

配置 Claude 桌面

将此加到你的claude_desktop_config.json中:

如果你的本地环境能访问NVIDIA GPU:

或者,仅限 CPU:

在CPU上运行时,默认的大尺寸物体检测模型使得推理和推理需要很长时间。考虑用一个较小的模型作为DEFAULT_OBJDET_MODEL(你也可以直接告诉Claude使用特定模型)。

(测试版) 可以直接运行公共 docker 镜像而不本地构建,但下载时间可能会干扰 Claude 对服务器的加载。

工具

以下工具目前可通过 mcp-vision 服务器使用:

  1. locate_objects
  • 描述:利用可用的零样本物体检测流水线,在图像中检测和定位物体 通过HuggingFace(参考列表 [[https://huggingface.

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

mcp-vision by

A Model Context Protocol (MCP) server exposing HuggingFace computer vision models such as zero-shot object detection as tools, enhancing the vision capabilities of large language or vision-language models.

This repo is in active development. See below for details of currently available tools.

Installation

Clone the repo:

git clone [email protected]:groundlight/mcp-vision.git

Build a local docker image:

cd mcp-vision
make build-docker

Configuring Claude Desktop

Add this to your claude_desktop_config.json:

If your local environment has access to a NVIDIA GPU:

"mcpServers": {
  "mcp-vision": {
    "command": "docker",
    "args": ["run", "-i", "--rm", "--runtime=nvidia", "--gpus", "all", "mcp-vision"],
	"env": {}
  }
}

Or, CPU only:

"mcpServers": {
  "mcp-vision": {
    "command": "docker",
    "args": ["run", "-i", "--rm", "mcp-vision"],
	"env": {}
  }
}

When running on CPU, the default large-size object detection model make take a long time to laod and run inference. Consider using a smaller model as DEFAULT_OBJDET_MODEL (you can tell Claude directly to use a specific model too).

(Beta) It is possible to run the public docker image directly without building locally, however the download time may interfere with Claude’s loading of the server.

"mcpServers": {
  "mcp-vision": {
    "command": "docker",
    "args": ["run", "-i", "--rm", "--runtime=nvidia", "--gpus", "all", "groundlight/mcp-vision:latest"],
	"env": {}
  }
}

Tools

The following tools are currently available through the mcp-vision server:

  1. locate_objects
  • Description: Detect and locate objects in an image using one of the zero-shot object detection pipelines available through HuggingFace (list for reference [https://huggingface.co/models?pipeline_tag=zero-shot-object-detection&sort=trending]).
  • Input: image_path (string) URL or file path, candidate_labels (list of strings) list of possible objects to detect, hf_model (optional string), will use "google/owlvit-large-patch14" by default, which could be slow on a non-GPU machine
  • Returns: List of dicts in HF object-detection format
  1. zoom_to_object
  • Description: Zoom into an object in the image, allowing you to analyze it more closely. Crop image to the object bounding box and return the cropped image. If many objects are present in the image, will return the ‘best’ one as represented by object score.
在 GitHub 查看完整 README

安装

docker run -i --rm --runtime=nvidia --gpus all mcp-vision
新手?先看 mcpskill.org 教程 →

配置

"mcpServers": { "mcp-vision": { "command": "docker", "args": ["run", "-i", "--rm", "--runtime=nvidia", "--gpus", "all", "mcp-vision"], "env": {} } }