MCP Connector

Capture Images from Webcams

Give an AI assistant webcam access via OpenCV - still-frame capture, connection management, and camera property control.

Works with opencv

91
Spark score
out of 100
Updated Mar 2025
Version 1.0.0
Models
claudeuniversal

Add to Favorites

Why it matters

Integrate AI assistants with webcam hardware to capture still images. This asset allows AI to interact with cameras for tasks like quick photo capture or adjusting camera settings.

Outcomes

What it gets done

01

Capture single frames from a webcam.

02

Open and manage camera connections.

03

Read and set camera properties (e.g., brightness, resolution).

04

Access multiple cameras by index.

Install

Add it to your toolbox

Run in your project directory:

curl -fsSL https://spark.entire.vc/get/vb-video-still-capture | bash

Capabilities

Tools your agent gets

quick_capture

Quickly opens the camera, captures a single frame, and closes it

open_camera

Opens a connection to the camera

capture_frame

Captures a single frame from the specified video source

get_video_properties

Gets video source properties (width, height, fps, etc.)

set_video_property

Sets video source properties (brightness, contrast, resolution)

close_connection

Closes the video connection and releases resources

list_active_connections

List of all active video connections

Overview

Video Still Capture MCP Server

A Python MCP server giving AI assistants webcam still-image capture via OpenCV, with connection management and camera property control. Use it when an assistant needs to take a photo through a webcam on request - not for continuous video recording or streaming.

What it does

Video Still Capture MCP is a Python MCP server that gives AI assistants access to webcams and video sources through OpenCV. It captures single still images from a camera, manages open camera connections, reads and adjusts video properties like brightness, contrast, and resolution, and applies basic transformations like horizontal flipping. It does not record video - only still-frame capture. The server automatically manages camera resources so connections are properly released when it shuts down, though for long-running applications it's good practice to explicitly close connections when they're no longer needed rather than relying on shutdown cleanup.

When to use - and when NOT to

Use this when you want an assistant to take a photo through your webcam on request, either as a quick one-off capture or through a persistent connection for multiple captures, and optionally tune camera settings beforehand. If a system has multiple cameras, a specific one can be targeted by its device index when opening a connection (e.g. index 1 for the second webcam). It suits desktop workflows where the AI needs visual input from a live camera. It is not the right tool if you need continuous video recording or streaming - it exposes still-frame capture only, and it requires a webcam that isn't already in use by another application. If the camera isn't found, check that it's connected and free; some systems also require explicit OS-level permission to access the camera.

Capabilities

  • quick_capture(device_index, flip): opens a camera, captures one frame, and closes it in a single call.
  • open_camera(device_index, name): opens a persistent connection to a camera device, returning a connection ID.
  • capture_frame(connection_id, flip): captures a single frame from an already-open connection.
  • get_video_properties(connection_id): returns properties like width, height, and fps for a connection.
  • set_video_property(connection_id, property_name, value): sets a property such as brightness or resolution.
  • close_connection(connection_id): closes a connection and releases resources.
  • list_active_connections(): lists all currently open connection IDs.

How to install

Requires Python 3.10+, OpenCV (opencv-python), and the MCP Python SDK. Clone and install from source:

git clone https://github.com/13rac1/videocapture-mcp.git
cd videocapture-mcp
pip install -e .

For Claude Desktop, edit claude_desktop_config.json and add an mcpServers entry with command: uv, args running mcp[cli] plus numpy and opencv-python, pointed at the absolute path of videocapture_mcp.py. Alternatively, use mcp install videocapture_mcp.py to configure Claude Desktop automatically.

Who it's for

Anyone who wants an AI assistant to take a photo through a connected webcam on request - for quick snapshots, camera-setting adjustments, or working with multiple cameras on the same system.

Source README

Video Still Capture MCP

A Model Context Protocol server for accessing and controlling webcams via OpenCV

Overview

Video Still Capture MCP is a Python implementation of the Model Context Protocol (MCP) that provides AI assistants with the ability to access and control webcams and video sources through OpenCV. This server exposes a set of tools that allow language models to capture images, manipulate camera settings, and manage video connections. There is no video capture.

Examples

Here are some examples of the Video Still Capture MCP server in action:

Orange Example

Left: Claude's view of the image Right: Actual webcam capture

Magnet Example

Left: Claude's view of the image Right: Actual webcam capture

Installation

Prerequisites

Installation from source

git clone https://github.com/13rac1/videocapture-mcp.git
cd videocapture-mcp
pip install -e .

Run the MCP server:

mcp dev videocapture_mcp.py

Integrating with Claude for Desktop

macOS/Linux

Edit your Claude Desktop configuration:

# Mac
nano ~/Library/Application\ Support/Claude/claude_desktop_config.json
# Linux
nano ~/.config/Claude/claude_desktop_config.json 

Add this MCP server configuration:

{
  "mcpServers": {
    "VideoCapture ": {
      "command": "uv",
      "args": [
        "run",
        "--with",
        "mcp[cli]",
        "--with",
        "numpy",
        "--with",
        "opencv-python",
        "mcp",
        "run",
        "/ABSOLUTE_PATH/videocapture_mcp.py"
      ]
    }
  }
}

Ensure you replace /ABSOLUTE_PATH/videocapture-mcp with the project's absolute path.

Windows

Edit your Claude Desktop configuration:

nano $env:AppData\Claude\claude_desktop_config.json

Add this MCP server configuration:

{
  "mcpServers": {
    "VideoCapture": {
      "command": "uv",
      "args": [
        "run",
        "--with",
        "mcp[cli]",
        "--with",
        "numpy",
        "--with",
        "opencv-python",
        "mcp",
        "run",
        "C:\ABSOLUTE_PATH\videocapture-mcp\videocapture_mcp.py"
      ]
    }
  }
}

Ensure you replace C:\ABSOLUTE_PATH\videocapture-mcp with the project's absolute path.

Using the Installation Command

Alternatively, you can use the mcp CLI to install the server:

mcp install videocapture_mcp.py

This will automatically configure Claude Desktop to use your videocapture MCP server.

Once integrated, Claude will be able to access your webcam or video source when requested. Simply ask Claude to take a photo or perform any webcam-related task.

Features

  • Quick Image Capture: Capture a single image from a webcam without managing connections
  • Connection Management: Open, manage, and close camera connections
  • Video Properties: Read and adjust camera settings like brightness, contrast, and resolution
  • Image Processing: Basic image transformations like horizontal flipping

Tools Reference

quick_capture

Quickly open a camera, capture a single frame, and close it.

quick_capture(device_index: int = 0, flip: bool = False) -> Image
  • device_index: Camera index (0 is usually the default webcam)
  • flip: Whether to horizontally flip the image
  • Returns: The captured frame as an Image object

open_camera

Open a connection to a camera device.

open_camera(device_index: int = 0, name: Optional[str] = None) -> str
  • device_index: Camera index (0 is usually the default webcam)
  • name: Optional name to identify this camera connection
  • Returns: Connection ID for the opened camera

capture_frame

Capture a single frame from the specified video source.

capture_frame(connection_id: str, flip: bool = False) -> Image
  • connection_id: ID of the previously opened video connection
  • flip: Whether to horizontally flip the image
  • Returns: The captured frame as an Image object

get_video_properties

Get properties of the video source.

get_video_properties(connection_id: str) -> dict
  • connection_id: ID of the previously opened video connection
  • Returns: Dictionary of video properties (width, height, fps, etc.)

set_video_property

Set a property of the video source.

set_video_property(connection_id: str, property_name: str, value: float) -> bool
  • connection_id: ID of the previously opened video connection
  • property_name: Name of the property to set (width, height, brightness, etc.)
  • value: Value to set
  • Returns: True if successful, False otherwise

close_connection

Close a video connection and release resources.

close_connection(connection_id: str) -> bool
  • connection_id: ID of the connection to close
  • Returns: True if successful

list_active_connections

List all active video connections.

list_active_connections() -> list
  • Returns: List of active connection IDs

Example Usage

Here's how an AI assistant might use the Webcam MCP server:

  1. Take a quick photo:

    I'll take a photo using your webcam.
    

    (The AI would call quick_capture() behind the scenes)

  2. Open a persistent connection:

    I'll open a connection to your webcam so we can take multiple photos.
    

    (The AI would call open_camera() and store the connection ID)

  3. Adjust camera settings:

    Let me increase the brightness of the webcam feed.
    

    (The AI would call set_video_property() with the appropriate parameters)

Advanced Usage

Resource Management

The server automatically manages camera resources, ensuring all connections are properly released when the server shuts down. For long-running applications, it's good practice to explicitly close connections when they're no longer needed.

Multiple Cameras

If your system has multiple cameras, you can specify the device index when opening a connection:

# Open the second webcam (index 1)
connection_id = open_camera(device_index=1)

Troubleshooting

  • Camera Not Found: Ensure your webcam is properly connected and not in use by another application
  • Permission Issues: Some systems require explicit permission to access the camera
  • OpenCV Installation: If you encounter issues with OpenCV, refer to the official installation guide

FAQ

Common questions

Discussion

Questions & comments · 0

Sign In Sign in to leave a comment.