obsbotd
Enables control of OBSBOT Tiny-series cameras (gimbal, zoom, focus, AI tracking, snapshots) through MCP tools.
README
obsbotd
A Linux MCP daemon for OBSBOT Tiny-series cameras. One daemon owns the camera; every agent — Claude Code, LibreChat, custom frameworks, or anything that can POST JSON — connects to it over streamable-http.
MCP clients (any framework, or bare curl)
│ streamable-http http://127.0.0.1:8626/mcp
▼
obsbotd ──► V4L2/UVC ioctls (ctypes) gimbal, zoom, focus, status
──► vendor XU protocol wake/sleep, AI tracking, exposure
──► ffmpeg snapshots (validated), clips, preview
Why this exists
The upstream obsbot-mcp npm package did the hard part — reverse-engineering the vendor protocol and calibrating the optics — but its architecture (a stdio MCP server per agent session, a prebuilt native helper binary, single-owner IPC election between sessions) produced chronic operational pain on a multi-agent Linux machine: stale owner processes serving weeks-old code, unvalidated truncated frames, and a closed binary the bugs lived in.
obsbotd keeps the protocol knowledge and throws away the architecture:
- One daemon, many clients. No elections, no per-session processes, no stale owners. Runs as a systemd user service.
- No native binary. The V4L2/UVC layer is ~200 lines of ctypes; ioctl numbers are computed from struct sizes so a layout mistake fails loudly.
- Hotplug is free. No device handle is held between calls — every tool
call re-discovers
/dev/video*(sub-millisecond). Unplugging the camera yields{"ok": false, "camera_present": false}as a normal result; the next call after a replug just works. - Frames are validated. The camera sporadically emits truncated MJPEG frames, worst right after wake. Every snapshot is a stream-copied raw frame checked for a complete SOI..EOI, retried up to 4x, then optionally downscaled (default 640 px — snapshot pixels are LLM tokens).
- Honest errors. Every failure is a structured
{ok: false, error}an agent can act on — never an opaque tool exception. Refusal messages say what to do instead. - Atomic pan+tilt. Both axes in one
VIDIOC_S_EXT_CTRLS— uvcvideo's per-control read-modify-write otherwise cancels half the move. - Measured optics.
obsbot_aim_at_pixel/obsbot_zoom_to_fitdo visual servoing with the intrinsics-solved FOV model (67° wide HFOV, 0.957 vertical correction, magnification = 3·ratio − 2) and composed-rotation aiming inherited from upstream's calibration work.
Hardware support
Developed and hardware-verified against an OBSBOT Tiny 2 Lite on Linux (kernel uvcvideo). The Tiny 2 shares the vendor protocol and should work unchanged; other OBSBOT models are untested. Single camera per host.
Known kernel limitation: uvcvideo caches CT_PANTILT_ABSOLUTE, so gimbal
readback is the last-commanded pose, not live — the tools are labeled
accordingly, and the intended workflow verifies pointing visually.
Install
Requires Python ≥ 3.12, ffmpeg (and ffplay for the preview window), and
read/write access to the camera's /dev/video* node (the video group).
git clone https://github.com/LumenPrima/obsbotd ~/obsbotd
cd ~/obsbotd
uv venv && uv pip install -e . # or: python3 -m venv .venv && .venv/bin/pip install -e .
.venv/bin/python -m obsbotd.server # listens on 127.0.0.1:8626
As a service:
cp systemd/obsbotd.service ~/.config/systemd/user/
systemctl --user daemon-reload
systemctl --user enable --now obsbotd
loginctl enable-linger $USER # optional: run without an active login
OBSBOTD_HOST / OBSBOTD_PORT override the bind address. The default is
localhost-only and there is no authentication — do not bind it to a reachable
interface unless you understand that anyone who can reach the port can drive
the camera and take pictures.
Connect an agent
MCP-native config (Claude Code, most frameworks):
{ "mcpServers": { "obsbot": { "type": "http", "url": "http://127.0.0.1:8626/mcp" } } }
No MCP library? The server answers bare JSON-RPC POSTs with plain JSON — a
naive agent can drive it with curl. docs/AGENT-GUIDE.md
has the full integration guide, the 18-tool reference, and the rules of
engagement (no sleeps, verify motion visually, treat refusals as instructions).
Tools (18)
obsbot_snapshot · obsbot_status · obsbot_wake · obsbot_sleep ·
obsbot_gimbal_move · obsbot_gimbal_recenter · obsbot_gimbal_position ·
obsbot_zoom · obsbot_aim_at_pixel · obsbot_zoom_to_fit ·
obsbot_ai_track · obsbot_ai_track_speed · obsbot_focus ·
obsbot_exposure · obsbot_image_adjust · obsbot_image_mode ·
obsbot_record_clip · obsbot_preview
Protocol documentation
docs/spec-*.md is a complete written specification of the vendor wire
protocol (60-byte V3 frames, CRC-16/USB, opcode tables, the 60-byte status
block, selector map) and the measured optics — extracted from upstream's
source as the reimplementation reference, and useful on its own to anyone
driving these cameras. The wire layer is golden-tested against upstream's
exact frame bytes (tests/).
Tests
tests/ are hardware-free: .venv/bin/python -m pytest tests/ -q
Credits
The vendor protocol reverse engineering, hardware quirk catalog, and optical calibration all come from obsbot-mcp (MIT, © 2026 Michael Jordan). obsbotd is an independent Linux-native reimplementation of the serving architecture around that knowledge.
License
MIT — see LICENSE.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。