Create a new document with content and optional metadata
Retrieve a document by ID
Update an existing document's content and/or metadata
Remove a document from the database
List all documents with optional pagination
Find semantically similar documents based on a query
Chroma Vector Database provides powerful vector database capabilities through a Model Context Protocol server. It enables semantic document search, metadata filtering, and comprehensive document management with persistent storage. With this MCP, you can store, retrieve, and search documents based on semantic similarity rather than just keyword matching. The server maintains document content and metadata in a persistent database, allowing for complex queries across your document collection.
Chroma Vector Database is a Model Context Protocol (MCP) server that provides vector database capabilities for semantic document search and management. It allows you to store documents with content and metadata, and then search them based on semantic similarity rather than just keyword matching.
uv venv
uv sync --dev --all-extras
Windows: C:\Users\<username>\AppData\Roaming\Claude\claude_desktop_config.json
MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Add the following configuration (adjust the path as needed):
{
"mcpServers": {
"chroma": {
"command": "uv",
"args": [
"--directory",
"PATH_TO_YOUR_PROJECT_DIRECTORY",
"run",
"chroma"
]
}
}
}
uv run chroma
The server stores data in the src/chroma/data
directory. This ensures that your documents persist between server restarts.
You can create documents with content and optional metadata:
create_document({
"document_id": "ml_paper1",
"content": "Convolutional neural networks improve image recognition accuracy.",
"metadata": {
"year": 2020,
"field": "computer vision",
"complexity": "advanced"
}
})
Find semantically similar documents:
search_similar({
"query": "machine learning models",
"num_results": 2,
"metadata_filter": {
"year": 2020,
"field": "computer vision"
}
})
You can retrieve, update, and delete documents using their IDs:
read_document({
"document_id": "ml_paper1"
})
update_document({
"document_id": "ml_paper1",
"content": "Updated content about convolutional neural networks.",
"metadata": {
"year": 2021,
"field": "computer vision",
"complexity": "intermediate"
}
})
delete_document({
"document_id": "ml_paper1"
})
List all documents with optional pagination:
list_documents({
"limit": 10,
"offset": 0
})
For interactive testing, you can use the MCP Inspector:
npx @modelcontextprotocol/inspector uv --directory PATH_TO_YOUR_PROJECT_DIRECTORY run chroma
This provides a web interface to test operations, verify functionality, and monitor server logs.
The server provides clear error messages for common scenarios:
Document already exists [id=X]
: You're trying to create a document with an ID that already existsDocument not found [id=X]
: The requested document doesn't existInvalid input: Missing document_id or content
: Required parameters are missingInvalid filter
: The metadata or content filter format is incorrectOperation failed: [details]
: General operation failure with specific details