camera-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@camera-mcp Take a photo with my webcam"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
camera-mcp
通过 ffmpeg / DirectShow,把本机摄像头能力暴露给 Claude 的 MCP server。
让 Claude 可以直接:列出摄像头 → 拍照 → 录像 → 停止录像,全程本地处理,文件落到磁盘。
功能
工具 | 说明 |
| 列出本机所有 DirectShow 视频设备 |
| 用指定摄像头拍一张 JPEG |
| 后台开始录像(libx264 / mp4),返回 |
| 优雅停止录像(写 q → ffmpeg 自动收尾,写入 moov 索引) |
| 列出当前所有进行中的录像 |
Related MCP server: Webcam MCP
环境要求
Windows(用了 DirectShow,Linux/macOS 需要换
avfoundation/v4l2)Node.js ≥ 18
ffmpeg(在 PATH 里,或自行改成绝对路径)
# Windows 用 winget 装 ffmpeg
winget install ffmpeg安装 & 构建
cd camera
npm install
npm run build构建产物在 dist/index.js,可执行项 camera-mcp。
配置到 Claude Code
在 ~/.claude/mcp.json(或项目级 .mcp.json)里加:
{
"mcpServers": {
"camera": {
"command": "node",
"args": ["C:/Users/hj158/mcp-servers/camera/dist/index.js"]
}
}
}启动后用 claude mcp list 应该能看到 camera: ... √ Connected。
使用示例
帮我拍一张照片
Claude 会调:
take_photo(device="HD Webcam", path="./photos/test.jpg", quality=2)用 ToDesk Camera 录一段 30 秒视频
start_recording(device="ToDesk Camera", path="./videos/demo.mp4")
# → recording_id: rec_xxxxxxxx_1
# ... 30 秒后 ...
stop_recording(recording_id="rec_xxxxxxxx_1")工具参数
take_photo
参数 | 类型 | 必填 | 说明 |
| string | ✅ | 设备名(必须来自 |
| string | 保存路径,默认 | |
| number | JPEG 质量 1-31,数字越小质量越高,默认 2 |
start_recording
参数 | 类型 | 必填 | 说明 |
| string | ✅ | 设备名 |
| string | 默认 | |
| string | 默认 | |
| number | 1-60,默认 30 |
stop_recording
参数 | 类型 | 必填 | 说明 |
| string | ✅ |
|
工作原理
设备枚举:调
ffmpeg -list_devices true -f dshow -i dummy,正则匹配"..." (video)行拍照:spawn ffmpeg,
-frames:v 1 -q:v <quality>截单帧录像:spawn ffmpeg 保持长连接,用
Map<recording_id, ChildProcess>跟踪;停止时往 stdin 写q,让 ffmpeg 走正常退出流程(否则 mp4 moov 索引缺失,很多播放器打不开)
已知限制
Windows-only(DirectShow);跨平台需要按平台分支选择 input format
多进程隔离:每次拍照/录像都新 spawn 一个 ffmpeg,启动开销约 300-500ms
录像启动 500ms 后才检查 exit code,极端情况下启动失败可能要等一下才能发现
License
MIT
Available Tools
5 toolslist_camerasA
列出本机所有可用的摄像头设备名(Windows DirectShow)
Inputs: no named parameters.
list_recordingsA
列出当前所有正在进行的录像
Inputs: no named parameters.
start_recordingB
开始用指定摄像头录像(后台运行,返回 recording_id 用于停止)
Inputs: device (required), fps, path, resolution.
stop_recordingB
停止指定 recording_id 的录像(让 ffmpeg 优雅退出,正确写入 mp4 索引)
Inputs: recording_id (required).
take_photoB
用指定摄像头拍一张照片,保存到本地
Inputs: device (required), path, quality.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool maps to a distinct resource+action: enumerate cameras, capture a still photo, begin a recording, end a recording by id, and enumerate active recordings. There is no overlap between take_photo (one-shot still) and start_recording (ongoing session), and the start/stop/list triple is cleanly separated by recording_id.
All five tools follow a strict snake_case verb_noun pattern (list_cameras, take_photo, start_recording, stop_recording, list_recordings). Verb choices (list/take/start/stop) are conventional and predictable.
Five tools is well-scoped for a local camera capture server: discovery, photo, and the recording lifecycle, with nothing extraneous. Every tool clearly earns its place and there is no filler.
The core lifecycle is covered: camera discovery, one-shot photo, and start/stop/list for recordings. Minor gaps remain — no tool to list or retrieve previously saved photos/recordings, and no way to configure output path or format — but agents can work around these via local filesystem access.
Maintenance
Related MCP Connectors
MCP server for Clipkit — gives AI agents a video toolbox via the Clipkit schema.
MCP server exposing the YourImageShare upload API (upload/list/delete) as tools for AI agents.
Give your Grok Bot a phone: an MCP server to see and use your phone. Also works with Claude.
Shared memory MCP server for Claude Code, Codex, Gemini CLI and Cursor. Cited, editable.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that enables AI assistants to access and control webcams through OpenCV, allowing for image capture and camera setting manipulation.20-
- AlicenseNot gradedqualityDmaintenanceAn MCP server that provides LLM agents with direct access to webcam hardware for capturing high-resolution photos and recording video sequences. It enables autonomous agents to monitor environments and interact with the physical world through standard Model Context Protocol tools.6MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that enables interaction with local camera devices to capture and process images. It allows LLMs to access video devices with configurable settings such as resolution, orientation, and image format.1MIT
- AlicenseAqualityDmaintenanceAn MCP (Model Context Protocol) server for controlling OBS Studio via the built-in obs-websocket plugin. Lets Claude control your scenes, recording, streaming, audio, and more.2611 npm1MIT