farshid-mcp-imageProcessing

farshid-mcp-imageProcessing

A comprehensive OpenCV image-processing MCP server offering ~40 tools for webcam capture, image I/O, transforms, color manipulation, filtering, edge detection, object detection, and more.

Category
访问服务器

README

<!-- mcp-name: io.github.pirahansiah/farshid-mcp-imageProcessing -->

farshid-mcp-imageProcessing

A comprehensive OpenCV image-processing MCP server for VS Code Copilot Agent Mode (or any MCP client). Exposes ~40 tools across webcam capture, image I/O, transforms, color, filtering, edges, thresholding, morphology, contours/shapes, feature matching, object detection (faces / eyes / bodies / QR), drawing, image arithmetic, template matching, and video processing.

  • PyPI: farshid-mcp-imageProcessing
  • MCP Registry: io.github.pirahansiah/farshid-mcp-imageProcessing
  • Python: 3.14+
  • OS: latest Windows 11, latest macOS, latest mainstream Linux (Ubuntu 24.04+/Fedora 41+)

Install (PyPI)

pip install farshid-mcp-imageProcessing
farshid-mcp-imageprocessing          # runs the stdio MCP server

Register in VS Code

Add this to your user or workspace mcp.json:

{
  "servers": {
    "imageProcessing": {
      "command": "farshid-mcp-imageprocessing",
      "type": "stdio"
    }
  }
}

Or, if you cloned the repo and want to run from source with the local .venv:

git clone https://github.com/pirahansiah/farshid-mcp-imageProcessing
cd farshid-mcp-imageProcessing
# Windows (PowerShell):
py -3.14 -m venv .venv ; .\.venv\Scripts\Activate.ps1
# macOS / Linux:
python3.14 -m venv .venv && source .venv/bin/activate

pip install -U pip
pip install -e .

opencv-contrib-python is used so the bundled Haar cascades and extra algorithms are available.

Quick start: the /cv Copilot prompt

This repo ships a workspace prompt file at .github/prompts/cv.prompt.md. In VS Code Copilot Chat (Agent mode), type:

/cv take image from webcam and save it as gray scale 240 * 240

The agent will call webcam_save, image_to_grayscale, and image_resize from this server to produce the requested file under ./.farshid/cv/.

Tool catalog

Webcam / capture

  • webcam_capture(camera_index=0) → returns a PNG image
  • webcam_save(output_path="", camera_index=0)
  • webcam_preview(camera_index=0, seconds=10) (local desktop window)
  • webcam_record(output_path, seconds=5, camera_index=0, fps=20)

Image I/O & info

  • image_show(path) — return image to chat
  • image_info(path) — shape, dtype, mean, file size
  • image_convert(input_path, output_path, quality=95)

Geometric transforms

  • image_resize(... width|height|scale, interpolation)
  • image_crop(input_path, output_path, x, y, width, height)
  • image_rotate(input_path, output_path, angle, scale=1, keep_size=False)
  • image_flip(input_path, output_path, direction)
  • image_pad(... top, bottom, left, right, border_type, color)

Color

  • image_to_grayscale
  • color_convert(target=gray|hsv|hls|lab|ycrcb|rgb|bgr)
  • adjust_brightness_contrast
  • histogram_equalize(method=clahe|global)
  • histogram_data(bins=32)

Filtering

  • blur_gaussian(ksize, sigma)
  • blur_median(ksize)
  • blur_bilateral(d, sigma_color, sigma_space)
  • sharpen(amount)
  • denoise(strength)

Edges / gradients

  • edges_canny(threshold1, threshold2)
  • edges_sobel(ksize)
  • edges_laplacian(ksize)

Thresholding & morphology

  • threshold(method=otsu|binary|binary_inv|adaptive_mean|adaptive_gaussian)
  • morphology(op=erode|dilate|open|close|gradient|tophat|blackhat)

Contours & shapes

  • find_contours(input_path, output_path?, thresh, min_area)
  • detect_circles(...) — Hough
  • detect_lines(...) — Probabilistic Hough
  • detect_corners(...) — Shi-Tomasi

Feature matching

  • feature_match(image1, image2, output_path?) — ORB + BFMatcher

Object detection (Haar)

  • detect_faces
  • detect_eyes
  • detect_bodies
  • detect_qrcode

Drawing

  • draw_rectangle, draw_circle, draw_line, draw_text

Composition / arithmetic

  • image_blend(image1, image2, output_path, alpha)
  • image_diff(image1, image2, output_path?) → mean/max diff
  • image_concat(images, output_path, direction)
  • template_match(image_path, template_path, output_path?, threshold)

Video

  • video_info(path)
  • video_extract_frames(video_path, output_dir, every_n, max_frames, ext)
  • video_thumbnail(video_path, output_path, time_seconds)

Build & publish

pip install -U build twine mcp-publisher
python -m build
twine upload dist/*
mcp-publisher login github
mcp-publisher publish .mcp/server.json

OS notes

  • Windows 11 (latest): webcam works out of the box; ensure Settings → Privacy & security → Camera → Let desktop apps access your camera is On.
  • macOS (latest): the first webcam call triggers a system Camera permission prompt; grant it to the terminal/VS Code process.
  • Linux (latest): requires a working /dev/video* device. Headless servers without a display cannot use webcam_preview (it opens an OpenCV window).

Notes

  • Never use print() in tool functions: stdout is the MCP protocol channel. Use sys.stderr (the _log helper at the bottom of server.py).
  • webcam_preview opens a real desktop window — only works where the server has a display (not over plain SSH or in a headless container).
  • All paths support ~ expansion. Output directories are created automatically.
  • Tools that return annotated images take an optional output_path; when omitted they only return the JSON metadata.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选