chroma
by
MCP server for Chroma
What is chroma
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/data
directory - 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\<username>\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",
"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"
}
})
Error Handling
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]
Development
Testing
- 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:
- Test CRUD operations
- Verify search functionality
- Check error handling
- Monitor server logs
Building
- Update dependencies:
uv compile pyproject.toml
- Build package:
uv build
Contributing
Contributions are welcome! Please read our Contributing Guidelines for details on:
- Code style
- Testing requirements
- Pull request process
License
This project is licensed under the MIT License - see the LICENSE file for details.
Leave a Comment
Comments section will be available soon. Stay tuned!
Frequently Asked Questions
What is MCP?
MCP (Model Context Protocol) is an open protocol that standardizes how applications provide context to LLMs. Think of MCP like a USB-C port for AI applications, providing a standardized way to connect AI models to different data sources and tools.
What are MCP Servers?
MCP Servers are lightweight programs that expose specific capabilities through the standardized Model Context Protocol. They act as bridges between LLMs like Claude and various data sources or services, allowing secure access to files, databases, APIs, and other resources.
How do MCP Servers work?
MCP Servers follow a client-server architecture where a host application (like Claude Desktop) connects to multiple servers. Each server provides specific functionality through standardized endpoints and protocols, enabling Claude to access data and perform actions through the standardized protocol.
Are MCP Servers secure?
Yes, MCP Servers are designed with security in mind. They run locally with explicit configuration and permissions, require user approval for actions, and include built-in security features to prevent unauthorized access and ensure data privacy.
Related MCP Servers
Ableton Live MCP Server
MCP Server implementation for Ableton Live OSC control
Airbnb MCP Server
AI Agent Marketplace Index Search MCP Server
MCP Server for AI Agent Marketplace Index from DeepNLP
Algorand MCP Implementation
Algorand Model Context Protocol (Server & Client)
mcp-server-apache-airflow
pypi.org/project/mcp-server-apache-airflow/
airtable-mcp-server
๐๏ธ๐ค Airtable Model Context Protocol Server, for allowing AI systems to interact with your Airtable bases
Airtable MCP Server
Search, create and update Airtable bases, tables, fields, and records using Claude Desktop and MCP (Model Context Protocol) clients
Alphavantage MCP Server
A MCP server for the stock market data API, Alphavantage API.
Amadeus MCP Server
Amadeus MCP(Model Context Protocol) Server
Anki MCP Server
An MCP server for Anki
Submit Your MCP Server
Share your MCP server with the community
Submit Now