chroma
A Model Context Protocol server providing vector database capabilities through Chroma, enabling semantic document search, metadata filtering, and document management with persistent storage.
A Model Context Protocol server providing vector database capabilities through Chroma, enabling semantic document search, metadata filtering, and document management with persistent storage.
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.
The server provides document storage and retrieval through Chroma's vector database:
- Stores documents with content and metadata
- Persists data in src/chroma/data
directory
- Supports semantic similarity search
The server implements CRUD operations and search functionality:
create_document
: Create a new documentdocument_id
, content
metadata
(key-value pairs)Error: Already exists, Invalid input
read_document
: Retrieve a document by ID
document_id
Error: Not found
update_document
: Update an existing document
document_id
, content
metadata
Error: Not found, Invalid input
delete_document
: Remove a document
document_id
Error: Not found
list_documents
: List all documents
limit
, offset
search_similar
: Find semantically similar documentsquery
num_results
, metadata_filter
, content_filter
uv venv
uv sync --dev --all-extras
Add the server configuration to your Claude Desktop config:
Windows: C:Users<username>AppDataRoamingClaudeclaude_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"
]
}
}
}
The server stores data in:
- Windows: src/chroma/data
- MacOS/Linux: src/chroma/data
Start the server:
uv run chroma
Use MCP tools to interact with the server:
# Create a document
create_document({
"document_id": "ml_paper1",
"content": "Convolutional neural networks improve image recognition accuracy.",
"metadata": {
"year": 2020,
"field": "computer vision",
"complexity": "advanced"
}
})
# Search similar documents
search_similar({
"query": "machine learning models",
"num_results": 2,
"metadata_filter": {
"year": 2020,
"field": "computer vision"
}
})
The server provides clear error messages for common scenarios:
- Document already exists [id=X]
- Document not found [id=X]
- Invalid input: Missing document_id or content
- Invalid filter
- Operation failed: [details]
Run the MCP Inspector for interactive testing:
npx @modelcontextprotocol/inspector uv --directory C:/MCP/server/community/chroma run chroma
Use the inspector's web interface to:
Update dependencies:
uv compile pyproject.toml
Build package:
uv build
Contributions are welcome! Please read our Contributing Guidelines for details on: - Code style - Testing requirements - Pull request process
This project is licensed under the MIT License - see the LICENSE file for details.