VideoCapture MCP server

Provides webcam access for capturing still images with camera control features including brightness adjustment, resolution settings, and basic image transformations through OpenCV
Back to servers
Provider
13rac1
Release date
Mar 28, 2025
Language
Python
Stats
6 stars

Video Still Capture MCP provides AI assistants with the ability to access and control webcams and video sources through OpenCV. It allows language models to capture images, manipulate camera settings, and manage video connections through the Model Context Protocol (MCP).

Prerequisites

Before installation, ensure you have:

  • Python 3.10 or newer
  • OpenCV (opencv-python)
  • MCP Python SDK
  • UV (optional but recommended)

Installation

Installing 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

Using the Installation Command

You can also use the mcp CLI to install the server:

mcp install videocapture_mcp.py

This automatically configures Claude Desktop to use your videocapture MCP server.

Integrating with Claude for Desktop

macOS/Linux Configuration

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"
      ]
    }
  }
}

Replace /ABSOLUTE_PATH/videocapture-mcp with the actual absolute path to the project.

Windows Configuration

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"
      ]
    }
  }
}

Replace C:\ABSOLUTE_PATH\videocapture-mcp with the actual absolute path to the project.

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

Tool Reference

Quick Capture

quick_capture(device_index: int = 0, flip: bool = False) -> Image

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

  • 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_camera(device_index: int = 0, name: Optional[str] = None) -> str

Opens a connection to a camera device.

  • 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_frame(connection_id: str, flip: bool = False) -> Image

Captures a single frame from the specified video source.

  • 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_video_properties(connection_id: str) -> dict

Gets properties of the video source.

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

Set Video Property

set_video_property(connection_id: str, property_name: str, value: float) -> bool

Sets a property of the video source.

  • 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_connection(connection_id: str) -> bool

Closes a video connection and releases resources.

  • connection_id: ID of the connection to close
  • Returns: True if successful

List Active Connections

list_active_connections() -> list

Lists all active video connections.

  • Returns: List of active connection IDs

Example Usage

Here's how an AI assistant might use the Video Still Capture MCP server:

Taking a Quick Photo

To capture a single photo:

I'll take a photo using your webcam.

(The AI calls quick_capture() behind the scenes)

Opening a Persistent Connection

For multiple photos:

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

(The AI calls open_camera() and stores the connection ID)

Adjusting Camera Settings

To modify camera properties:

Let me increase the brightness of the webcam feed.

(The AI calls set_video_property() with the appropriate parameters)

Advanced Usage

Multiple Cameras

If your system has multiple cameras, you can specify the device index:

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

Resource Management

The server automatically manages camera resources. For long-running applications, it's good practice to explicitly close connections when no longer needed.

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

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later