Vision Context MCP Server
Allows extracting 3D entities from images and passing them to Blender MCP to create primitives and render 3D scenes.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Vision Context MCP Server
A comprehensive Model Context Protocol (MCP) server that provides visual analysis tools for images and videos, generating structured context for LLMs and 3D model generation.
šÆ Purpose
This server bridges the gap between visual content and AI understanding by:
Extracting Visual Context: Analyze images to understand composition, objects, depth, and spatial relationships
Generating LLM-Ready Context: Produce structured JSON that LLMs can use for reasoning
3D Scene Description: Create descriptions optimized for 3D model and scene generation
Video Analysis: Temporal analysis including scene detection and motion tracking
Related MCP server: Vision MCP Server
š ļø Tools Overview
Image Analysis Tools
Tool | Description | Use Case |
| Edge detection (Canny, HED, MLSD, SoftEdge) | Shape extraction, 3D modeling |
| Depth estimation (MiDaS, ZoeDepth, DPT) | Spatial understanding, layering |
| Human pose detection with keypoints | Character modeling, animation |
| Semantic segmentation (ADE20K) | Scene parsing, object identification |
| Object detection with 3D positioning | Entity extraction |
| Comprehensive image analysis | Full understanding |
| 3D-optimized descriptions | Prompting 3D tools |
| 3D entity extraction | Direct 3D engine integration |
Video Analysis Tools
Tool | Description | Use Case |
| Frame extraction at configurable rate | Frame-by-frame analysis |
| Scene cut detection | Video segmentation |
| Motion pattern analysis | Activity detection |
| Comprehensive video analysis | Full video understanding |
| Extract specific frame by timestamp | Moment analysis |
š¦ Installation
Requirements
Python 3.10+
OpenCV
NumPy
PyTorch (optional, for advanced models)
Transformers (optional, for DETR/DPT)
Install
# Clone the repository
git clone https://github.com/yourusername/vision-context-mcp.git
cd vision-context-mcp
# Install with pip
pip install -e .
# Or install with all optional dependencies
pip install -e ".[all]"MCP Configuration
Add to your MCP settings (e.g., cline_mcp_settings.json):
{
"mcpServers": {
"vision-context": {
"command": "uvx",
"args": ["vision-context-mcp"],
"env": {}
}
}
}Or for development:
{
"mcpServers": {
"vision-context": {
"command": "python",
"args": ["-m", "vision_context_mcp.server"],
"cwd": "/path/to/vision-context-mcp",
"env": {}
}
}
}š Quick Start
Basic Image Analysis
# Via MCP tool call
result = await mcp.call_tool("build_image_context", {
"image_path": "/path/to/image.jpg"
})Returns comprehensive JSON with:
Edge analysis and contours
Depth estimation and spatial regions
Semantic segmentation and scene type
Object detection with positions
Pose detection (if people present)
3D Description Generation
description = await mcp.call_tool("describe_for_3d", {
"image_path": "/path/to/scene.jpg",
"detail_level": "detailed"
})Output example:
A 3D scene representing outdoor with foreground, midground, background depth layers
containing person, car, tree. person is standing. car measures approximately 200x150 pixels.Video Analysis
context = await mcp.call_tool("get_video_context", {
"video_path": "/path/to/video.mp4"
})Returns video metadata, scene segments, and motion analysis.
š Tool Details
analyze_edges
Detects edges and contours in images.
Methods:
canny: Fast, reliable edge detectionhed: Deep learning-based, captures fine detailsmlsd: Optimized for straight lines (architecture)softedge: Artistic, smooth edges
Returns:
{
"edge_density": 0.15,
"contour_count": 42,
"contours": [
{
"area": 5000,
"perimeter": 300,
"bounding_box": {"x": 100, "y": 150, "width": 80, "height": 60}
}
]
}analyze_depth
Estimates depth maps from single images.
Models:
midas: Balanced performance (default)zoedepth: Metric depth, more accuratedpt: Highest quality, slower
Returns:
{
"spatial_regions": [
{"name": "foreground", "percentage": 25.5, "centroid": {"x": 320, "y": 240}},
{"name": "midground", "percentage": 45.0},
{"name": "background", "percentage": 29.5}
],
"focal_analysis": {
"focal_depth": 128,
"focus_quality": "sharp"
}
}analyze_segmentation
Performs semantic segmentation using ADE20K (150 classes).
Returns:
{
"scene_type": "living_room",
"detected_regions": [
{"class_name": "sofa", "percentage": 15.2, "bounding_box": {...}},
{"class_name": "floor", "percentage": 30.5}
],
"spatial_relationships": [
{"object1": "sofa", "object2": "floor", "relationship": "above"}
]
}detect_objects
Detects objects with COCO classes (80 categories).
Returns:
{
"objects": [
{
"label": "person",
"confidence": 0.95,
"bounding_box": {"x": 100, "y": 50, "width": 80, "height": 200},
"depth": {"normalized_depth": 0.35}
}
]
}extract_entities_3d
Extracts objects as 3D entities.
Returns:
{
"entities": [
{
"id": "entity_person_320_240",
"label": "person",
"primitive_type": "humanoid",
"position": {"x": 0.5, "y": 0.5, "z": 0.35},
"dimensions": {"width": 0.1, "height": 0.3, "depth": 0.05},
"properties": {"animate": true, "category": "human"}
}
]
}š§ Advanced Usage
Combining with Blender MCP
Extract 3D entities from image
Pass entities to Blender MCP for rendering
# Get entities
entities = await mcp.call_tool("extract_entities_3d", {
"image_path": "/path/to/scene.jpg"
})
# Create in Blender
for entity in entities["entities"]:
await blender_mcp.call_tool("create_primitive", {
"type": entity["primitive_type"],
"position": entity["position"],
"scale": entity["dimensions"]
})Integration with LLMs
The build_image_context tool produces structured JSON perfect for LLM reasoning:
context = await mcp.call_tool("build_image_context", {
"image_path": "/path/to/image.jpg"
})
# Pass to LLM
response = await llm.generate(f"""
Analyze this image context and suggest improvements for 3D recreation:
{json.dumps(context, indent=2)}
""")š Project Structure
vision-context-mcp/
āāā src/vision_context_mcp/
ā āāā __init__.py
ā āāā server.py # MCP server implementation
ā āāā preprocessors/
ā ā āāā __init__.py
ā ā āāā edges.py # Edge detection
ā ā āāā depth.py # Depth estimation
ā ā āāā pose.py # Pose detection
ā ā āāā segmentation.py # Semantic segmentation
ā āāā analyzers/
ā āāā __init__.py
ā āāā entity_extractor.py # 3D entity extraction
ā āāā image_analyzer.py # Image context builder
ā āāā video_analyzer.py # Video analysis
āāā pyproject.toml
āāā README.mdš Dependencies
Core
mcp>=1.0.0- Model Context Protocolopencv-python>=4.8.0- Image processingnumpy>=1.24.0- Numerical operationsPillow>=10.0.0- Image handling
Optional (for advanced features)
torch>=2.0.0- Deep learningtransformers>=4.35.0- DETR, DPT modelscontrolnet-aux>=0.0.7- ControlNet preprocessorsmediapipe>=0.10.0- Pose detection fallback
š¤ Integration Examples
With Cline/VS Code
// .vscode/mcp.json
{
"servers": {
"vision-context": {
"command": "uvx",
"args": ["vision-context-mcp"]
}
}
}With Claude Desktop
// claude_desktop_config.json
{
"mcpServers": {
"vision-context": {
"command": "python",
"args": ["-m", "vision_context_mcp.server"],
"cwd": "/path/to/vision-context-mcp"
}
}
}š Example Prompts
For Image Analysis
Use build_image_context on /path/to/image.jpg and tell me what would be needed
to recreate this scene in a 3D game engine.For 3D Generation
Use describe_for_3d with comprehensive detail on /path/to/reference.jpg,
then suggest how to improve the description for better 3D model generation.For Video Analysis
Use get_video_context on /path/to/video.mp4 to understand its structure,
then identify the most interesting frames for detailed analysis.š Troubleshooting
Model Download Issues
Models are downloaded on first use. If downloads fail:
Check internet connection
Set
HF_HOMEenvironment variable for cache locationUse
TORCH_HOMEfor PyTorch model cache
Memory Issues
Large images or videos may consume significant memory:
Resize images before processing
Use lower
fpsfor video frame extractionSet
max_frameslimit for videos
Import Errors
If you get import errors for optional dependencies:
pip install vision-context-mcp[all]š License
MIT License - see LICENSE file for details.
š Acknowledgments
Intel for DPT depth estimation models
Facebook AI for DETR object detection
ControlNet for preprocessor implementations
HuggingFace for model hosting
Anthropic for MCP specification
š® Contributing
Contributions welcome! Please:
Fork the repository
Create a feature branch
Add tests for new functionality
Submit a pull request
Made with ā¤ļø for the MCP ecosystem
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogā¦
This server cannot be deployed
Maintenance
Related MCP Connectors
Turn any LLM multimodal; generate images, voices, videos, 3D models, music, and more.
Video scene understanding for AI agents via the Primate Vision API.
Extract structured insights from videos, podcasts, articles, and PDFs with multi-model AI
Video, audio, and image processing for AI agents: convert, transcribe, upscale - 150+ operations.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI-powered image and video analysis using Google Gemini and Vertex AI models. Supports analyzing single or multiple images, detecting objects with bounding boxes, and video content analysis through natural language prompts.420 npmMIT
- AlicenseAqualityDmaintenanceEnables AI agents to analyze images, extract text, compare images, and analyze video through any OpenAI-compatible vision model.421MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to analyze images and videos, and generate optimized prompts for AI video generation systems.MIT
- AlicenseAqualityBmaintenanceProvides image and video analysis capabilities for LLMs, with local preprocessing (ffmpeg/OpenCV) and any OpenAI-compatible vision model for understanding and Q&A.4MIT