Colpali MCP Server - Python

by camillebrl

155 downloads Not rated yet MIT license

About

Colpali MCP Server - Python is an MCP server for semantic image retrieval using ColPali and Elasticsearch. It indexes images or PDF pages and enables natural language search queries against the indexed content.

Details

License
MIT license

Explore

- Semantic image search using natural language queries
- Automatic indexing of images and PDFs
- Multimodal embeddings combining vision and language (ColPali)
- Scalable storage with Elasticsearch
- Standard MCP API compatible with any MCP client

git clone https://github.com/camillebrl/colpali_server
cd colpali_server
make install

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

- Documentation MCP
- ColPali Paper
- Elasticsearch Guide

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.