MCP Connector

Process images and videos with OpenCV

An MCP server giving AI assistants OpenCV tools for image and video processing and detection.

Works with github

Maintainer of this project? Claim this page to edit the listing.


90
Spark score
out of 100
Updated 7 months ago
Version 1.0.0
Models
universal

Add to Favorites

Why it matters

Empower AI assistants with advanced computer vision capabilities using OpenCV for image and video analysis, including object detection, face recognition, and edge detection.

Outcomes

What it gets done

01

Perform object detection using DNN models like YOLO.

02

Detect and recognize faces in images.

03

Analyze video frames for object tracking and motion detection.

04

Apply various image processing filters and edge detection techniques.

Install

Add it to your toolbox

Run in your project directory:

curl -fsSL https://spark.entire.vc/get/vb-opencv | bash

Capabilities

Tools your agent gets

save_image_tool

Saves an image to a file

convert_color_space_tool

Converts an image between color spaces (BGR, RGB, GRAY, HSV, etc.)

resize_image_tool

Resizes an image to specified dimensions

crop_image_tool

Crops a region of an image

get_image_stats_tool

Gets statistical information about an image

apply_filter_tool

Applies various filters to an image (blur, Gaussian, median, bilateral)

detect_edges_tool

Detects edges in an image using various methods (Canny, Sobel, Laplacian, Scharr)

apply_threshold_tool

Applies thresholding to an image (binary, adaptive, etc.)

+7 tools

Overview

OpenCV MCP Server

An MCP server exposing OpenCV computer vision tools - filtering, edge/feature detection, and face/object detection - to AI assistants. Use it when an AI assistant needs to process or analyze images and video directly, from basic filters to face and object detection.

What it does

An MCP server that gives AI assistants OpenCV computer vision capabilities for processing images and video: object detection, face recognition, edge detection, and video analysis, exposed as a set of chainable tools.

When to use - and when NOT to

Use this when an AI assistant needs to manipulate or analyze images or video directly - resizing, filtering, detecting edges, contours, or shapes, matching templates or features, detecting faces or objects, or extracting and analyzing video frames. Object and face detection require pre-trained models (YOLO weights, Haar cascade, or DNN face-detection models) placed in the models directory first - it is not a ready-to-detect solution without supplying those model files yourself.

Capabilities

  • Basic image handling: save_image_tool, convert_color_space_tool (BGR/RGB/GRAY/HSV and more), get_image_stats_tool.
  • Image processing: resize_image_tool, crop_image_tool, apply_filter_tool (blur, Gaussian, median, bilateral), apply_threshold_tool.
  • Edge and shape analysis: detect_edges_tool (Canny, Sobel, Laplacian, Scharr), detect_contours_tool, find_shapes_tool (circles, lines).
  • Matching and features: match_template_tool, detect_features_tool (SIFT, ORB, BRISK), match_features_tool.
  • Detection: detect_faces_tool (Haar cascades or DNN), detect_objects_tool (pre-trained DNN models such as YOLO).
  • Video processing and analysis (frame extraction, motion detection), object tracking in video, and camera integration for real-time object detection.
  • Tools can be chained together by feeding one tool's output_path into the next tool as its input.

How to install

Install with pip install opencv-mcp-server, or via uvx (install uv first with brew install uv), or from source: clone the repo, create and activate a virtual environment with python -m venv .venv and source .venv/bin/activate (or .venv\Scripts\activate on Windows), then run pip install -e .. For Claude Desktop:

{
    "mcpServers": {
        "opencv": {
            "command": "uvx",
            "args": [
                "opencv-mcp-server"
            ]
        }
    }
}

Optional environment variables: MCP_TRANSPORT (transport method), OPENCV_DNN_MODELS_DIR (DNN model directory), and CV_HAAR_CASCADE_DIR (Haar cascade file directory).

Typical prompts it handles include "Resize an image to 800x600 pixels", "Apply Gaussian blur filter to reduce noise in an image", "Detect faces in a group photo", "Find objects in a street scene using the YOLO model", and "Extract every 10th frame from a video".

Who it's for

Developers building AI assistants or agents that need direct image and video processing - from basic resizing and filtering to face and object detection - without writing custom OpenCV integration code from scratch, and who are comfortable supplying their own pre-trained detection models rather than relying on ones bundled with the server.

Source README

An MCP server that provides powerful OpenCV computer vision capabilities, enabling AI assistants to process images and video for tasks such as object detection, face recognition, edge detection, and video analysis.

Installation

pip

pip install opencv-mcp-server

uvx

brew install uv

From source

git clone https://github.com/yourusername/opencv-mcp-server.git
cd opencv-mcp-server
python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
pip install -e .

Configuration

Claude Desktop

{
    "mcpServers": {
        "opencv": {
            "command": "uvx",
            "args": [
                "opencv-mcp-server"
            ]
        }
    }
}

Available Tools

Tool Description
save_image_tool Saves an image to a file
convert_color_space_tool Converts an image between color spaces (BGR, RGB, GRAY, HSV, etc.)
resize_image_tool Resizes an image to specified dimensions
crop_image_tool Crops a region of an image
get_image_stats_tool Gets statistical information about an image
apply_filter_tool Applies various filters to an image (blur, Gaussian, median, bilateral)
detect_edges_tool Detects edges in an image using various methods (Canny, Sobel, Laplacian, Scharr)
apply_threshold_tool Applies thresholding to an image (binary, adaptive, etc.)
detect_contours_tool Detects and optionally draws contours in an image
find_shapes_tool Finds basic shapes in an image (circles, lines)
match_template_tool Finds a template in an image
detect_features_tool Detects features in an image using SIFT, ORB, BRISK methods
match_features_tool Matches features between two images
detect_faces_tool Detects faces in an image using Haar cascades or DNN
detect_objects_tool Detects objects using pre-trained DNN models (e.g., YOLO)

Capabilities

  • Basic image handling and processing (reading, saving, conversion)
  • Image processing and enhancement (resizing, cropping, applying filters)
  • Edge detection and contour analysis
  • Advanced computer vision capabilities (feature detection, object detection)
  • Face detection and recognition
  • Video processing and analysis (frame extraction, motion detection)
  • Object tracking in video
  • Camera integration for real-time object detection

Environment Variables

Optional

  • MCP_TRANSPORT - Transport method
  • OPENCV_DNN_MODELS_DIR - Directory for storing DNN models
  • CV_HAAR_CASCADE_DIR - Directory for storing Haar cascade files

Usage Examples

Resize an image to 800x600 pixels
Apply Gaussian blur filter to reduce noise in an image
Detect faces in a group photo
Find objects in a street scene using the YOLO model
Extract every 10th frame from a video

Resources

Notes

The server requires pre-trained models (YOLO weights, face detection models) that should be placed in the models directory for object and face detection functions. Tools can be chained together by using the output_path from one tool as input to another.

FAQ

Common questions

Discussion

Questions & comments ยท 0

Sign In Sign in to leave a comment.