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).
Before installation, ensure you have:
opencv-python
)git clone https://github.com/13rac1/videocapture-mcp.git
cd videocapture-mcp
pip install -e .
Run the MCP server:
mcp dev videocapture_mcp.py
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.
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.
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.
quick_capture(device_index: int = 0, flip: bool = False) -> Image
Quickly opens a camera, captures a single frame, and closes it.
open_camera(device_index: int = 0, name: Optional[str] = None) -> str
Opens a connection to a camera device.
capture_frame(connection_id: str, flip: bool = False) -> Image
Captures a single frame from the specified video source.
get_video_properties(connection_id: str) -> dict
Gets properties of the video source.
set_video_property(connection_id: str, property_name: str, value: float) -> bool
Sets a property of the video source.
close_connection(connection_id: str) -> bool
Closes a video connection and releases resources.
list_active_connections() -> list
Lists all active video connections.
Here's how an AI assistant might use the Video Still Capture MCP server:
To capture a single photo:
I'll take a photo using your webcam.
(The AI calls quick_capture()
behind the scenes)
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)
To modify camera properties:
Let me increase the brightness of the webcam feed.
(The AI calls set_video_property()
with the appropriate parameters)
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)
The server automatically manages camera resources. For long-running applications, it's good practice to explicitly close connections when no longer needed.
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.
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"
]
}
}
}
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.
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.