This MCP server implements the Model Context Protocol to provide vector database capabilities through Chroma. It enables semantic document search, metadata filtering, and document management with persistent storage, allowing your applications to store, retrieve, and search documents based on their meaning.
Install the required dependencies using the UV package manager:
uv venv
uv sync --dev --all-extras
Add the server configuration to your Claude Desktop config file:
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"
]
}
}
}
The server stores data persistently in the src/chroma/data
directory on all platforms.
Start the MCP server with the following command:
uv run chroma
The server provides the following document operations:
create_document({
"document_id": "ml_paper1",
"content": "Convolutional neural networks improve image recognition accuracy.",
"metadata": {
"year": 2020,
"field": "computer vision",
"complexity": "advanced"
}
})
Required parameters:
document_id
: Unique identifier for the documentcontent
: Text content of the documentOptional parameters:
metadata
: Key-value pairs for document metadataread_document({
"document_id": "ml_paper1"
})
Required parameters:
document_id
: Identifier of the document to retrieveupdate_document({
"document_id": "ml_paper1",
"content": "Updated content about convolutional neural networks.",
"metadata": {
"year": 2021,
"field": "computer vision",
"complexity": "intermediate"
}
})
Required parameters:
document_id
: Identifier of the document to updatecontent
: New text contentOptional parameters:
metadata
: Updated metadata fieldsdelete_document({
"document_id": "ml_paper1"
})
Required parameters:
document_id
: Identifier of the document to deletelist_documents({
"limit": 10,
"offset": 0
})
Optional parameters:
limit
: Maximum number of documents to returnoffset
: Number of documents to skipFind documents that are semantically similar to a query:
search_similar({
"query": "machine learning models",
"num_results": 2,
"metadata_filter": {
"year": 2020,
"field": "computer vision"
}
})
Required parameters:
query
: Text to match semanticallyOptional parameters:
num_results
: Maximum number of results to returnmetadata_filter
: Filter results by metadata fieldscontent_filter
: Additional filter for document contentThe server provides detailed 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]
For interactive testing, you can use the MCP Inspector:
npx @modelcontextprotocol/inspector uv --directory C:/MCP/server/community/chroma run chroma
The inspector provides a web interface to test operations, verify functionality, and monitor server logs.
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "chroma" '{"command":"uv","args":["--directory","C:/MCP/server/community/chroma","run","chroma"]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"chroma": {
"command": "uv",
"args": [
"--directory",
"C:/MCP/server/community/chroma",
"run",
"chroma"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"chroma": {
"command": "uv",
"args": [
"--directory",
"C:/MCP/server/community/chroma",
"run",
"chroma"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect