跳到主要内容
BetaVision & Automation

MCP for OpenCV — Connect AI Agents to OpenCV

视觉结果只有可复现才有价值。流水线被声明为带版本号的图结构,参数固定、输入带哈希、产物存档。

Read-only by default8 typed toolsCheckpointed writes
Technical specification
运行时
Python 3.11+ with OpenCV 4.x / 5.x
传输方式
stdio and streamable HTTP
安装方式
pip install dccmcp-opencv
后端
CPU and CUDA-execution-provider builds
输入类型
Image folders, video files, RTSP streams, capture devices
支持平台
Linux, macOS, Windows
Last reviewed
2026-09-12
概述

什么是 MCP for OpenCV?

MCP for OpenCV is a local MCP server plus a OpenCV plugin that connects AI agents to a real OpenCV session. Agents discover 8 typed tools — including image.read, image.process, calibration.calibrate and detect.pattern — and call them to inspect, create, modify and validate work inside the live application.

Unlike generated OpenCV scripts, every call is validated against your current document, classified as read, write or execute, and recorded in an audit log. OpenCV stays open, the document stays live, and destructive operations are checkpointed so they can be rolled back.

It works with Claude Code, Codex, Cursor, GitHub Copilot, Claude Desktop, Gemini CLI, Trae, Doubao, Qwen Code, CodeBuddy, Custom MCP clients, ML pipeline runners over stdio or streamable HTTP.

  • 运行时: Python 3.11+ with OpenCV 4.x / 5.x
  • 传输方式: stdio and streamable HTTP
  • 安装方式: pip install dccmcp-opencv
为什么会失败

没有契约时,让 Agent 驱动 OpenCV 会出什么问题

01

Notebook 实验永远变不成流水线

Agent 写了一段很聪明的检测代码,三周后没人能复现当时的阈值、预处理顺序,或者它到底跑在哪批图上。

02

视觉参数是看不见的

阈值、卷积核大小、色彩空间转换都藏在代码里,结果既无法扫描对比,也无法验收签核。

03

失败是静默的

一条处理 4000 张图、其中 40 张失败的流水线,看起来是成功的——除非有人去数产物。

如何工作

MCP for OpenCV 如何保住设计意图、结构与可追溯性

面向 OpenCV 工作负载的 MCP Server,把图像处理、检测、标定与视频巡检变成类型化、可复现的流水线操作,而不是一次性的 notebook 单元格。

流水线即带版本的图

操作被组合成具名、带版本的图。参数是产物的一部分,因此任一运行都能被精确重放。

确定性的产物

输入带哈希,输出带清单,运行报告会列出每一张失败的图与原因。

标定是一等工具

棋盘格、ChArUco 与圆点标定都作为类型化工具暴露,返回内外参矩阵与重投影误差。

对视觉输出做回归

每个流水线版本都保存基准输出,因此改变预处理导致检测结果变化会在到达客户之前被捕获。

工具参考

MCP for OpenCV 工具清单与风险等级

Agent 在连接时就能发现这份清单。你可以决定哪些自动放行、哪些需要人工确认、哪些在生产文件中直接禁用。

工具名与参数签名保持英文——它们是 Agent 实际调用的接口。

  • image.readLoad images with explicit color space, depth and orientation handling.read
  • image.processComposable blur, threshold, morphology, edge and color-space operations.execute
  • calibration.calibrateChessboard, ChArUco and circle-grid calibration returning camera matrices and error.execute
  • detect.patternMarker, contour, blob and template detection with typed result schemas.execute
  • pipeline.composeBuild a named, versioned pipeline graph from primitive operations.write
  • pipeline.runExecute a pipeline over a dataset and emit a manifest with per-item status.execute
  • video.inspectProbe frame rate, codec, dropped frames and stream health, or sample frames.read
  • regression.compareCompare current outputs against stored goldens with tolerance reporting.read
安装

四步安装 MCP for OpenCV

全部本地运行。服务默认只绑定回环地址,且只暴露你在 OpenCV 中批准的工具。

预发布。 以下命令描述的是我们即将发布的接口,软件包尚未发布。 Get notified when MCP for OpenCV launches.

STEP 01

安装软件包

把服务装进与你的视觉依赖相同的环境,以便复用现有的 OpenCV 构建。

pip install dccmcp-opencv
STEP 02

启动服务

用存放流水线与数据集的目录作为工作区启动服务。

dccmcp-opencv serve --workspace ./vision
STEP 03

注册客户端

把 Claude Code、Codex、Cursor、OpenClaw 或任何其他 MCP 客户端指向该服务。Agent 随后可以发现你已有的流水线,再决定是否新建。

{
  "mcpServers": {
    "opencv": { "command": "dccmcp-opencv", "args": ["serve"] }
  }
}
STEP 04

设置资源上限

限制并发数与内存,避免长时间扫描把工作站或共享构建机拖垮。

dccmcp-opencv limits --workers 4 --max-memory 8Gi

MCP for OpenCV works with the agents you already use

  • Claude Code
  • Codex
  • Cursor
  • GitHub Copilot
  • Claude Desktop
  • Gemini CLI
  • Trae
  • Doubao
  • Qwen Code
  • CodeBuddy
  • Custom MCP clients
  • ML pipeline runners

Any other MCP-compatible client works too — one config entry, stdio by default.

Read the docs
常见问题

团队在安装前最常问的问题

如果没有覆盖到你的问题,直接写信给我们——技术问题我们给技术回答。
  • 不会。它包装你环境中已有的 OpenCV 构建,在其上增加一个类型化、可复现的接口。现有代码可以通过自定义工具暴露出来。

  • 它可以挂接 RTSP 流与采集设备做巡检与抽帧。对于硬实时控制回路,请把生成的流水线放到你自己的进程里运行,用 DCCMCP 做配置与验证。

  • 每次运行都会写出清单,列出已处理、已跳过与失败的条目及原因,让部分失败可见而不是静默。

  • 支持,通过 CUDA 版 OpenCV 构建。服务在启动时会报告可用的执行提供者,让 Agent 知道自己能请求什么。

  • 可以。任何带类型签名的 Python 可调用对象都能通过插件 API 注册为自定义工具,包括你自己的模型与硬件集成。

npx dccmcp-blender@latest serve

Put an agent inside your real tools — without putting your pipeline at risk

Install an integration, set a policy, and let your agent inspect, build and validate work in Blender, Maya, Houdini, 3ds Max, Rhino, ZBrush, Photoshop, FreeCAD, QGIS or OpenCV. Free to start, local by default.

macOS · Windows · Linux — no cloud dependency required