imagefeatures-mcp
An MCP server that provides classic computer vision feature extraction tools (color, texture, shape) for image analysis, enabling LLMs to perform precise mathematical image comparisons and quality assessments.
README
imagefeatures-mcp 🖼️
Give LLMs "mathematical eyes" for image analysis.
An MCP (Model Context Protocol) server that wraps the imagefeatures library, exposing classic computer vision features as tools that Claude and other LLMs can use.
Why This Exists
| LLM Vision | imagefeatures MCP |
|---|---|
| "A sunset photo with warm colors" | #FF6B35 (45.2%), #2D3436 (30.1%) — exact hex codes |
| "Looks sharp to me" (often wrong) | Texture entropy: 1.2 → blur score: 0.78 |
| Slow on 10,000 images | Extract once, query instantly |
LLMs see semantics ("a dog on a beach"). imagefeatures sees statistics (color histograms, texture patterns, edge orientations). Combine them for agents that reason about both content AND composition.
What You Can Build
1. Visual Similarity Search
Find images similar by color, texture, or combined features:

Same query image returns different results based on which feature you prioritize — CEDD finds structural matches, Color Histogram finds palette matches, LBP finds texture matches.
2. Color-Based Organization
Sort images by dominant hue for color-organized galleries:

Images automatically sorted: grayscale → warm tones → greens → blues → reds
3. Vibe-Based Filtering
Filter by visual "mood" categories derived from mathematical features:

"Blue/Water" and "Green/Nature" tags computed from color + texture analysis, not AI labeling
Installation
# Install the MCP server
pip install imagefeatures-mcp
# Or install from source
pip install git+https://github.com/kelkalot/imagefeatures-mcp.git
Dependencies:
- imagefeatures — the underlying feature extraction library
- mcp — Model Context Protocol SDK
- numpy, pillow
Quick Start
Claude Desktop
Add to your Claude Desktop config:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"imagefeatures": {
"command": "python",
"args": ["-m", "imagefeatures_mcp"]
}
}
}
Restart Claude Desktop. You can now ask:
"What are the dominant colors in this photo?"
"Find similar images in my ~/Photos folder"
"Sort these images by color"
"Which of these photos are blurry?"
Programmatic Usage
# Run the server directly
python -m imagefeatures_mcp
# Test with MCP Inspector
npx @modelcontextprotocol/inspector python -m imagefeatures_mcp
Available Tools
analyze_image
Analyze an image's visual composition using mathematical features.
analyze_image(image_path, preset="quick")
Presets:
| Preset | Features | Dimensions | Use Case |
|---|---|---|---|
quick |
ColorHistogram, EdgeHistogram | 144 | Fast overview |
color |
ColorHistogram, ColorMoments, DominantColors, OpponentHistogram | 605 | Color analysis |
texture |
LBP, Tamura, Haralick, Gabor | 328 | Texture analysis |
shape |
EdgeHistogram, HOG, HuMoments | 231 | Shape/edge analysis |
combined |
CEDD, FCTH, JCD | 504 | Best for similarity |
full |
All 22 features | 3,058 | Comprehensive |
compare_images
Compare two images mathematically.
compare_images(image_a, image_b, feature="CEDD", metric="cosine")
Features: Any of the 22 available (CEDD, JCD, ColorHistogram, PHOG, etc.)
Metrics: cosine, euclidean, l1, jsd, tanimoto
find_similar_in_folder
Find visually similar images in a folder.
find_similar_in_folder(query_image, folder_path, top_k=5, feature="JCD")
get_dominant_colors
Extract dominant colors with exact hex codes.
get_dominant_colors(image_path, num_colors=5)
check_image_quality
Detect blur and quality issues using texture analysis.
check_image_quality(image_path)
sort_by_color
Sort all images in a folder by dominant hue.
sort_by_color(folder_path)
filter_by_vibe
Filter images by visual category.
filter_by_vibe(folder_path, vibe="blue_water")
Vibes: blue_water, green_nature, warm_sunset, cool_moody, high_contrast, soft_minimal, grayscale, vibrant
extract_features
Get raw feature vectors for ML pipelines.
extract_features(image_path, features="CEDD,PHOG,DominantColors")
list_features
List all 22 available features with descriptions.
Available Features
The imagefeatures library provides 22 classic computer vision descriptors totaling 3,058 dimensions:
Color Features (741 dims)
| Feature | Dims | Description |
|---|---|---|
ColorHistogram |
64 | RGB/HSV/Luminance histogram |
ColorMoments |
9 | Mean, std, skewness per channel |
OpponentHistogram |
512 | Opponent color space histogram |
FuzzyColorHistogram |
72 | Fuzzy HSV quantization |
DominantColors |
20 | K-means extracted dominant colors |
ScalableColor |
64 | MPEG-7 Haar-based color descriptor |
Texture Features (620 dims)
| Feature | Dims | Description |
|---|---|---|
LocalBinaryPatterns |
256 | Classic LBP histogram |
RotationInvariantLBP |
36 | Rotation-invariant LBP |
Gabor |
48 | Multi-scale Gabor wavelets |
Tamura |
18 | Coarseness, contrast, directionality |
Haralick |
6 | GLCM texture features |
Centrist |
256 | Census transform histogram |
Shape Features (861 dims)
| Feature | Dims | Description |
|---|---|---|
EdgeHistogram |
80 | MPEG-7 edge directions |
PHOG |
630 | Pyramid histogram of oriented gradients |
HOG |
144 | Histogram of oriented gradients |
HuMoments |
7 | Shape-invariant Hu moments |
Layout Features (76 dims)
| Feature | Dims | Description |
|---|---|---|
ColorLayout |
12 | MPEG-7 DCT color layout |
LuminanceLayout |
64 | DCT luminance descriptor |
Combined Features (760 dims)
| Feature | Dims | Description |
|---|---|---|
CEDD |
144 | Color + edge directivity |
FCTH |
192 | Fuzzy color + texture |
JCD |
168 | Joint CEDD + FCTH |
AutoColorCorrelogram |
256 | Spatial color correlation |
Recommended for Common Tasks
| Task | Recommended Feature |
|---|---|
| General similarity search | JCD or CEDD |
| Color matching | DominantColors + ColorHistogram |
| Texture analysis | Gabor + Tamura |
| Shape matching | PHOG or HuMoments |
| Duplicate detection | JCD (fast, effective) |
Example Workflows
"Vibe-Based" Asset Search
User: "Find marketing images that feel calm and professional"
Claude's strategy:
1. filter_by_vibe(folder, "blue_water") → narrows to ~200 images
2. get_dominant_colors() → filters for brand palette match
3. check_image_quality() → removes blurry images
4. Uses native vision on finalists to confirm content
Brand Compliance Checker
User: "Do these product photos match our brand colors?"
Claude's strategy:
1. get_dominant_colors() on each image
2. Compare hex codes to brand palette (#1a73e8, #ffffff)
3. Report images that deviate > 10%
Photo Library Deduplication
User: "Find duplicate or near-duplicate photos"
Claude's strategy:
1. extract_features() with JCD for all images
2. compare_images() pairwise
3. Group images with > 90% similarity
LLM Vision vs imagefeatures
| Task | LLM Vision | imagefeatures | Winner |
|---|---|---|---|
| "What's in this image?" | ✅ Excellent | ❌ Can't do | LLM |
| Exact color hex codes | ❌ Guesses | ✅ Precise | imagefeatures |
| Blur detection | ❌ Often wrong | ✅ ~90% accurate | imagefeatures |
| Search 10,000 images | Slow, expensive | Fast, free | imagefeatures |
| "What emotion does this convey?" | ✅ Excellent | ❌ Can't do | LLM |
| Consistent, reproducible | ❌ Variable | ✅ Deterministic | imagefeatures |
Best approach: Use both. imagefeatures for precision/scale, LLM vision for understanding.
Development
# Clone the repo
git clone https://github.com/kelkalot/imagefeatures-mcp.git
cd imagefeatures-mcp
# Install in development mode
pip install -e ".[dev]"
# Run tests
pytest
# Run the server locally
python -m imagefeatures_mcp
Related Projects
- imagefeatures — The underlying feature extraction library
- MCP — Model Context Protocol specification
- LIRE — Java library that inspired imagefeatures
License
MIT
Citation
If you use this in research, please cite:
@software{imagefeatures_mcp,
title = {imagefeatures-mcp: MCP Server for Classic Image Features},
author = {Michael A. Riegler},
url = {https://github.com/kelkalot/imagefeatures-mcp},
year = {2025}
}
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。