attribute-classifier-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@attribute-classifier-mcpDetect objects in /data/test.jpg and classify each one's material and color"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Attribute Classifier MCP Server
π― YOLO Detection β Object Cropping β CNN Attribute Classification β JSON Results
A Model Context Protocol (MCP) server that combines YOLO object detection with per-attribute CNN classifiers. Detects objects in images, crops them, and classifies each object's visual attributes (material, color, has_armrest, etc.) using dedicated CNN models.
β¨ Features
Feature | Description |
π¦ Object Cropping | Crop objects from images using YOLO txt bbox annotations |
ποΈ Dataset Organization | Organize cropped images by attribute value for CNN training |
π§ CNN Training | Train dedicated CNN classifiers per attribute (ResNet, MobileNet, EfficientNet) |
π Full Pipeline Inference | YOLO detect β crop β multi-attribute CNN classify β JSON output |
π Hot-swap Models | Register/replace attribute models without restarting |
π Attribute Discovery | Auto-discover attributes from X-AnyLabeling JSON annotations |
β‘ Batch Processing | Process multiple images in one call |
βοΈ Configurable | YAML config for paths, training params, YOLO settings |
Related MCP server: Kolosal Vision MCP
π Quick Start
Installation
# Clone the repository
git clone https://github.com/your-username/attribute-classifier-mcp.git
cd attribute-classifier-mcp
# Install dependencies
pip install -r requirements.txt
# Or install as package
pip install -e .Configure MCP Client
Add to your MCP client config (e.g. Claude Desktop claude_desktop_config.json):
{
"mcpServers": {
"attribute-classifier": {
"command": "python",
"args": ["src/server.py"],
"cwd": "/path/to/attribute-classifier-mcp"
}
}
}With Docker
docker build -t attribute-classifier-mcp .
docker run -v /your/data:/app/data -v /your/models:/app/models attribute-classifier-mcpπ Complete Workflow
Step 1: Prepare Your Data
data/
βββ images/ # Original images (.jpg, .png)
βββ labels/ # YOLO txt annotations (one per image)
β βββ img001.txt # "0 0.5 0.5 0.3 0.4" (class cx cy w h)
βββ jsons/ # X-AnyLabeling JSON attributes (one per image)
β βββ img001.json # {shapes: [{label, attributes: {material: "leather"}}]}
βββ classes.txt # Class names (one per line)
βββ attributes.json # Optional: master JSON with all attributesStep 2: Crop Objects
Use the crop_objects tool to crop all annotated objects from images:
{
"tool": "crop_objects",
"arguments": {
"images_dir": "./data/images",
"labels_dir": "./data/labels",
"json_dir": "./data/jsons",
"classes_file": "./data/classes.txt"
}
}Step 3: Organize by Attribute
Organize crops into classification datasets:
{
"tool": "organize_dataset",
"arguments": {
"cropped_dir": "./data/cropped",
"attribute_name": "material",
"master_json": "./data/attributes.json"
}
}This creates:
data/datasets/material/
βββ leather/ # Images of leather objects
βββ wood/ # Images of wooden objects
βββ fabric/ # Images of fabric objects
βββ metal/ # Images of metal objectsStep 4: Train Models
Train a CNN for each attribute:
{
"tool": "train_attribute_model",
"arguments": {
"dataset_dir": "./data/datasets/material",
"attribute_name": "material",
"backbone": "resnet18",
"epochs": 50
}
}Or train all attributes at once:
{
"tool": "train_all_attributes",
"arguments": {
"datasets_dir": "./data/datasets"
}
}Step 5: Inference
Run the full pipeline on new images:
{
"tool": "detect_and_classify",
"arguments": {
"image_path": "./test.jpg"
}
}Output:
{
"image": "test.jpg",
"image_size": {"width": 1920, "height": 1080},
"total_objects": 2,
"detections": [
{
"index": 0,
"class_name": "chair",
"confidence": 0.92,
"bbox": {"x1": 100, "y1": 200, "x2": 400, "y2": 600},
"attributes": {
"material": {
"attribute": "material",
"predicted_value": "leather",
"confidence": 0.95,
"all_probabilities": {
"leather": 0.95,
"wood": 0.03,
"fabric": 0.02
}
},
"has_armrest": {
"attribute": "has_armrest",
"predicted_value": "yes",
"confidence": 0.88,
"all_probabilities": {"yes": 0.88, "no": 0.12}
}
}
}
]
}π οΈ All MCP Tools (16 total)
Data Preparation
Tool | Description |
| Crop objects from images using YOLO txt bbox annotations |
| Organize crops by attribute value into classification folders |
| Discover all attribute names and values from JSON annotations |
Training
Tool | Description |
| Train a CNN classifier for one attribute |
| Train CNN classifiers for all discovered attributes |
Inference
Tool | Description |
| Full pipeline: YOLO β crop β CNN classify β JSON |
| Classify a pre-cropped image through attribute models |
| Process multiple images through the full pipeline |
Model Management
Tool | Description |
| Register/replace a CNN model for an attribute |
| Remove a model from the registry |
| List all registered attribute models |
| Get detailed info about a specific model |
Configuration
Tool | Description |
| Update server configuration |
| Get current configuration |
| Map detected classes to their attributes |
| Run complete pipeline: crop β organize β train |
π§ Configuration
Edit config/default_config.yaml or pass a custom config:
python src/server.py /path/to/my_config.yamlKey Config Options
# Paths
paths:
images_dir: "./data/images"
labels_dir: "./data/labels"
json_dir: "./data/jsons"
master_json: "./data/attributes.json"
# Training
training:
backbone: "resnet18" # resnet18/34/50, mobilenet_v2, efficientnet_b0
epochs: 50
batch_size: 32
device: "auto" # auto, cpu, cuda
# YOLO
yolo:
model: "yolov8n.pt"
confidence: 0.5π Hot-swap Models
Replace any attribute's model at runtime:
{
"tool": "register_model",
"arguments": {
"attribute_name": "material",
"model_path": "./models/material_efficientnet_b0_best.pth"
}
}π Supported Annotation Formats
YOLO TXT (for bounding boxes)
0 0.5125 0.4833 0.3250 0.4167
1 0.2500 0.7500 0.2000 0.3000X-AnyLabeling JSON (for attributes)
{
"shapes": [
{
"label": "chair",
"points": [[100, 200], [400, 600]],
"shape_type": "rectangle",
"flags": {"has_armrest": true},
"attributes": {"material": "leather", "seat_count": "1"}
}
]
}π License
MIT License
This server cannot be deployed
Maintenance
Related MCP Connectors
Virtual try-on and on-model AI fashion photography: catalog search, try-on grids, HD delivery.
Image/video analysis: NSFW detection, object detection, thumbnails
AI product photography for fashion sellers: Shopify photo audits, seasonal guides, AI try-on.
Analyze images from multiple angles to extract detailed insights or quick summaries. Describe visuβ¦
Related MCP Servers
- FlicenseAqualityNot gradedmaintenanceEnables AI agents to analyze images through vision AI providers (Gemini, OpenAI, Claude), performing tasks like image description, object detection with bounding boxes, region-specific analysis, and precise color extraction without consuming context window with raw pixels.4-
- AlicenseAqualityDmaintenanceProvides AI-powered image analysis and OCR capabilities using the Kolosal Vision API. Supports analyzing images from URLs, local files, or base64 data with natural language queries for object detection, scene description, text extraction, and visual assessment.16 npmMIT
- 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.52 npmMIT
- AlicenseAqualityDmaintenanceProvides advanced image analysis capabilities including object recognition, OCR text extraction, and multi-turn visual dialogues using OpenAI-compatible APIs. It supports both local files and Base64 inputs with additional features for session persistence and web-based configuration management.3MIT