About Colpali MCP Server - Python
A Python MCP server for indexing and searching image and PDF content with ColPali and Elasticsearch. It serves teams that need natural-language retrieval over visual documents, with tools for managing the image index.
Key features
- 01Semantic image search from natural-language queries
- 02Index images and PDF pages
- 03ColPali multimodal embeddings
- 04Elasticsearch-backed storage and search
- 05View index statistics and clear the index
Use cases
- 01Find diagrams or images using a text description
- 02Index images extracted from PDF documents
- 03Check or clear an existing image index
MCP support
Exposes image search, image indexing, index statistics, and index-clearing tools to MCP clients. It uses Elasticsearch as its backing store.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.
Tools
Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.
Details
From the project READMEColpali MCP Server - Python
Un serveur MCP (Model Context Protocol) pour effectuer de la recherche (retrieval) sur une base de données d'images en utilisant ColPali et Elasticsearch.
🚀 Fonctionnalités
- Recherche sémantique d'images : Trouvez des images pertinentes en utilisant des requêtes en langage naturel
- Indexation d'images et de PDFs : Indexez automatiquement des images individuelles ou des PDFs complets
- Embeddings multimodaux : Utilise ColPali pour générer des embeddings riches combinant vision et langage
- Stockage scalable : Elasticsearch pour un stockage et une recherche efficaces
- API MCP standard : Compatible avec tout client MCP
📋 Prérequis
- Python 3.10+
- Elasticsearch 8.0+
- GPU recommandé pour ColPali (fonctionne aussi sur CPU)
🔧 Installation
git clone https://github.com/camillebrl/colpali_server
cd colpali_server
make install
🎯 Utilisation
Ajoute à ton mcp.json de ton client MCP:
{
"mcpServers": {
"colpali-server": {
"command": "path to colpali_server/start_server.sh"
"env": {
"ES_HOST": "localhost:9200", # adapt to your elasticsearch hostname
"ES_USER": "elastic", # adapt to your elasticsearch username
"ES_PASSWORD": "mot_de_passe_elasticsearch" # adapt to your elasticsearch password
}
}
}
}
Utiliser avec un client MCP
Le serveur expose les outils suivants :
🔍 search_images
Recherche des images pertinentes dans la base de données.
{
"tool": "search_images",
"arguments": {
"query": "schéma d'architecture réseau",
"top_k": 5
}
}
📥 index_image
Indexe une nouvelle image dans la base de données. Note que les images d'un folder sont indexées 1 par 1 (batch size de 1). Si vous avez accès à une meilleure GPU, tester un batch_size plus grand.
{
"tool": "index_image",
"arguments": {
"image_path": "/path/to/image.png",
"source_file": "architecture.pdf",
"page_number": 3,
"metadata": {
"author": "John Doe",
"category": "network"
}
}
}
📊 get_index_stats
Obtient les statistiques de l'index.
{
"tool": "get_index_stats",
"arguments": {}
}
🗑️ clear_index
Vide complètement l'index (attention : irréversible).
{
"tool": "clear_index",
"arguments": {
"confirm": true
}
}
Debugging
Pour afficher les logs du server:
tail -n 1000 /tmp/colpali_mcp_startup.log
📚 Ressources
NOTE
Si vous avez plus de capacité GPU, modifiez le maximul top_k dans le image_rag_server.py pour le tool search_screenshots à + (en fonction de vos ressources). Car en effet, c'est le nombre max d'images que prendra le vlm mcp server tool search en entrée.
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.