
privetin/chroma
Data science & MLЭта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал
privetin/chroma - кандидат на сервер MCP, импортированный из https://github.com/privetin/chroma.
Обзор
privetin/chroma - кандидат на сервер MCP, импортированный из https://github.com/privetin/chroma.
Обзор (машинный перевод)
Реализация сервера Model Context Protocol (MCP), которая обеспечивает возможности векторной базы данных через Chroma. Этот сервер обеспечивает семантический поиск документов, фильтрацию метаданных и управление документами с постоянным хранением.
Требования
Python 3.8+ Хрома 0.4.0+
- MCP SDK 0.1.0+
Компоненты
###Ресурсы Сервер обеспечивает хранение и извлечение документов через векторную базу данных Chroma: Хранит документы с содержанием и метаданными
- Сохраняет данные в каталоге
src/chroma/dataПоддержка поиска семантического сходства
Инструменты
Сервер реализует операции CRUD и функции поиска:
####Управление документами
-
[[Т1]]: Создать новый документ
-
Требуется: [[Т2]], [[Т3]]
-
Необязательно:
metadata(пары ключевых значений) Возвращение: подтверждение успеха Ошибка: уже существует, недействительный вход -
[[Т5]]: Получить документ по ID
-
Обязательно:
document_idВозврат: Содержание документов и метаданные Ошибка: не найдено -
[[Т7]]: Обновление существующего документа
-
Требуется: [[Т8]], [[Т9]]
-
Необязательно: [[Т10]] Возвращение: подтверждение успеха Ошибка: не найден, недействительный вход
[[Т11]]: Удалить документ
Эта страница переведена автоматически. Технические детали смотрите в оригинале.
README
Показан фрагмент оригинального README. Открыть оригинал.
Chroma MCP Server
A Model Context Protocol (MCP) server implementation that provides vector database capabilities through Chroma. This server enables semantic document search, metadata filtering, and document management with persistent storage.
Requirements
- Python 3.8+
- Chroma 0.4.0+
- MCP SDK 0.1.0+
Components
Resources
The server provides document storage and retrieval through Chroma’s vector database:
- Stores documents with content and metadata
- Persists data in
src/chroma/datadirectory - Supports semantic similarity search
Tools
The server implements CRUD operations and search functionality:
Document Management
-
create_document: Create a new document- Required:
document_id,content - Optional:
metadata(key-value pairs) - Returns: Success confirmation
- Error: Already exists, Invalid input
- Required:
-
read_document: Retrieve a document by ID- Required:
document_id - Returns: Document content and metadata
- Error: Not found
- Required:
-
update_document: Update an existing document- Required:
document_id,content - Optional:
metadata - Returns: Success confirmation
- Error: Not found, Invalid input
- Required:
-
delete_document: Remove a document- Required:
document_id - Returns: Success confirmation
- Error: Not found
- Required:
-
list_documents: List all documents- Optional:
limit,offset - Returns: List of documents with content and metadata
- Optional:
Search Operations
search_similar: Find semantically similar documents- Required:
query - Optional:
num_results,metadata_filter,content_filter - Returns: Ranked list of similar documents with distance scores
- Error: Invalid filter
- Required:
Features
- Semantic Search: Find documents based on meaning using Chroma’s embeddings
- Metadata Filtering: Filter search results by metadata fields
- Content Filtering: Additional filtering based on document content
- Persistent Storage: Data persists in local directory between server restarts
- Error Handling: Comprehensive error handling with clear messages
- Retry Logic: Automatic retries for transient failures
Installation
- Install dependencies:
uv venv
uv sync --dev --all-extras
Configuration
Claude Desktop
Add the server configuration to your Claude Desktop config:
Windows: C:\Users\\AppData\Roaming\Claude\claude_desktop_config.json
MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"chroma": {
"command": "uv",
"args": [
"--directory",
"C:/MCP/server/community/chroma",
"run",
"chroma"
]
}
}
}
Data Storage
The server stores data in:
- Windows:
src/chroma/data - MacOS/Linux:
src/chroma/data
Usage
- Start the server:
uv run chroma
- Use MCP tools to interact with the server:
# Create a document
create_document({
"document_id": "ml_paper1",
Установка
npx @modelcontextprotocol/inspector uv --directory C:/MCP/server/community/chroma run chromaКонфигурация
{
"mcpServers": {
"chroma": {
"command": "uv",
"args": [
"--directory",
"C:/MCP/server/community/chroma",
"run",
"chroma"
]
}
}
}