Webcam MCP

io.github.1019666077-bit由 GitHub 帳號 1019666077-bit 發布v0.2.1更新於 Oct 24, 2026

Give LLM agents webcam access: capture photos and record short videos over MCP.

已驗證STDIO僅桌面安全與監控媒體與設計

概覽

AI 產生的概覽

一個本機 MCP 伺服器,讓 AI 助理存取你的網路攝影機,拍攝靜態照片並錄製短片。

可以做什麼
依需求從網路攝影機拍攝一張高解析度 JPEG 照片,不需參數,解析度與攝影機索引可透過命令列選項設定。
適用情境
當助理需要透過網路攝影機觀察實體世界——描述場景、偵錯虛實整合系統或監控環境——且你願意在自己機器上授予攝影機權限時使用。
執行需求
以 Python 套件形式在本機執行(pip install botbridge-webcam-mcp),用 webcam-mcp 指令啟動;需要實體網路攝影機,macOS 上需為終端機應用程式授予攝影機權限。預設在 127.0.0.1:8000/sse 提供回環 SSE 端點,也支援 stdio。無需驗證或 API 金鑰。
安裝前請注意
SSE 傳輸沒有驗證,任何能存取該端點的人都能觸發網路攝影機;請保持在回環或 stdio。綁定到非回環位址會被拒絕,除非設定 WEBCAM_MCP_ALLOW_LAN=1,且區域網路暴露無驗證。拍攝的影像與視訊影格會回傳給所連線的助理。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Webcam MCP,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

Webcam MCP 📸

MCP server for webcam access - capture photos and video for LLM agents

[PyPI] [CI] [License: MIT]

Fork notice. This is botbridge-webcam-mcp, a fork of pavel-kirienko/webcam_mcp (MIT), maintained by 1019666077-bit. It adds an MCP Apps panel (webcam_panel). Install this distribution as botbridge-webcam-mcp; the upstream distribution on PyPI is named webcam-mcp. The Python import package is webcam_mcp.


Webcam MCP is a Model Context Protocol (MCP) server that gives LLM agents direct access to your webcam. It enables autonomous agents to capture photos and record video sequences, making it possible to debug cyberphysical systems, monitor environments, and interact with the physical world without human intervention.

[Webcam MCP demo]

Features:

  • 📸 High-Resolution Photos: Capture still images
  • 🎛️ MCP Apps panel (webcam_panel): Free in-chat buttons (拍一张 / 再拍 / 关掉); Pro placeholders only
  • 🎥 Video Recording: Record a sequence of frames over a specified duration
  • 🌐 SSE transport: loopback by default; LAN exposure is opt-in and unauthenticated
  • ⚙️ Configurable: Adjust resolution, camera index, and quality settings
  • 🔌 Cross-Platform: Works on Linux, macOS, and Windows
  • 🚀 Easy Integration: Simple MCP client configuration

Usage

Install:

bash
pip install botbridge-webcam-mcp

Start the MCP server:

bash
webcam-mcp

The server starts on http://127.0.0.1:8000/sse by default (loopback only).

You can test the server using any MCP client, e.g., MCP Inspector (install via npx @modelcontextprotocol/inspector).

CLI options

OptionTypeDefaultDescription
--hoststring127.0.0.1Server host address
--portinteger8000Server port
--camera-indexinteger0Webcam device index
--photo-widthinteger1920Default photo width in pixels
--photo-heightinteger1080Default photo height in pixels
--video-widthinteger640Default video frame width in pixels
--video-heightinteger480Default video frame height in pixels
--version--Show version and exit

Examples

bash
# Start on custom portwebcam-mcp --port 9000
# Use different camera (e.g., external USB webcam)webcam-mcp --camera-index 1
# Custom photo resolutionwebcam-mcp --photo-width 1280 --photo-height 720
# Opt-in LAN exposure (unauthenticated! see Security below)WEBCAM_MCP_ALLOW_LAN=1 webcam-mcp --host 0.0.0.0

Security

The SSE transport has no authentication. Anyone who can reach the SSE endpoint can trigger your webcam to take photos and record video.

  • Prefer stdio (desktop MCP clients use it automatically) or loopback (127.0.0.1, the default).
  • Binding --host to a non-loopback address (e.g. 0.0.0.0 or a LAN IP) prints a loud warning at startup and is refused unless you set WEBCAM_MCP_ALLOW_LAN=1.
  • Only expose the server on your LAN or a public interface if you understand the risk and have your own authentication in front of it.

MCP Client Configuration

Claude Desktop

Add to your claude_desktop_config.json:

json
{  "mcpServers": {    "webcam": {      "url": "http://localhost:8000/sse"    }  }}

Location of config file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

Other MCP Clients

Any MCP client supporting SSE transport can connect to:

http://<host>:<port>/sse

MCP Tools

take_photo

Captures a single high-resolution photo from the webcam.

Parameters: None

Returns: JPEG image

Example usage in Claude:

Can you take a photo and describe what you see?

record_video

Records video frames over a specified duration.

Parameters:

  • duration_seconds (float, optional): Recording duration in seconds
    • Minimum: 1.0 second
    • Maximum: 60.0 seconds
    • Default: 5.0 seconds

Returns: List of JPEG frames

Example usage in Claude:

Record a 10-second video and analyze any movement you detect.

Troubleshooting

Camera Permission Denied (macOS)

On macOS, you need to grant camera permissions:

  1. Open System Settings → Privacy & Security → Camera
  2. Enable camera access for Terminal (or your terminal app)
  3. Restart the terminal and try again

Camera Already in Use

If you see "Camera unavailable" errors:

  1. Close other applications using the webcam (Zoom, Skype, etc.)
  2. Check if another instance of webcam-mcp is running
  3. Try a different camera index: webcam-mcp --camera-index 1

Wrong Camera Index

To find available cameras:

python
import cv2for i in range(10):    cap = cv2.VideoCapture(i)    if cap.isOpened():        print(f"Camera {i}: Available")        cap.release()    else:        print(f"Camera {i}: Not available")

Then use --camera-index with the correct number.

Resolution Not Supported

If your camera doesn't support the requested resolution, the server will:

  • Log a warning with the actual resolution achieved
  • Continue operating with the camera's maximum supported resolution

Check logs for messages like:

WARNING: Requested resolution 1920x1080, but camera provided 1280x720

Development

bash
# Install in editable mode with dev dependenciespip install -e ".[dev]"
# Run all testspytest
# Run with verbose outputpytest -v
# Run specific test filepytest tests/test_camera.py

All tests use mocked camera hardware, so no physical webcam is required for testing.

Release

To tag and release a new version, push a new commit to main with a new __version__ string. This will trigger a new tag and a new release push to PyPI.

來源:README.md,提交 9b3188e

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

2
  1. v0.2.1最新Oct 13, 2026
  2. v0.2.0Oct 12, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分