The MCP-Chroma server provides an interface for working with ChromaDB, a vector database for embeddings. It allows you to manage collections and documents through a set of tools using the Model-Controller-Protocol (MCP) interface.
To install the MCP-Chroma server, clone the repository and build it using Cargo:
git clone https://github.com/yourusername/mcp-chroma.git
cd mcp-chroma
cargo build --release
Create a .chroma_env
file in your project directory with configuration parameters:
CHROMA_CLIENT_TYPE=ephemeral
CHROMA_HOST=localhost
CHROMA_PORT=8000
Option | Environment Variable | Description | Default |
---|---|---|---|
--client-type |
CHROMA_CLIENT_TYPE |
Type of client (ephemeral, persistent, http, cloud) | ephemeral |
--data-dir |
CHROMA_DATA_DIR |
Directory for persistent storage | None |
--host |
CHROMA_HOST |
Host for HTTP client | None |
--port |
CHROMA_PORT |
Port for HTTP client | None |
--ssl |
CHROMA_SSL |
Use SSL for HTTP client | true |
--tenant |
CHROMA_TENANT |
Tenant for cloud client | None |
--database |
CHROMA_DATABASE |
Database for cloud client | None |
--api-key |
CHROMA_API_KEY |
API key for cloud client | None |
--dotenv-path |
CHROMA_DOTENV_PATH |
Path to .env file | .chroma_env |
# Run with default configuration
./mcp-chroma
# Run with specific client type
./mcp-chroma --client-type http --host localhost --port 8000
# Run with persistent storage
./mcp-chroma --client-type persistent --data-dir ./chroma_data
chroma_list_collections
: List all collectionschroma_create_collection
: Create a new collectionchroma_peek_collection
: Preview documents in a collectionchroma_get_collection_info
: Get metadata about a collectionchroma_get_collection_count
: Count documents in a collectionchroma_modify_collection
: Update collection propertieschroma_delete_collection
: Delete a collectionchroma_add_documents
: Add documents to a collectionchroma_query_documents
: Search for similar documentschroma_get_documents
: Retrieve documents from a collectionchroma_update_documents
: Update existing documentschroma_delete_documents
: Delete documents from a collectionprocess_thought
: Process thoughts in an ongoing session{
"collection_name": "my_documents",
"metadata": {
"description": "A collection of example documents"
}
}
{
"collection_name": "my_documents",
"query_texts": ["What are the benefits of vector databases?"],
"n_results": 3
}
Configure MCP-Chroma with Claude using:
{
"mcpServers": {
"chroma": {
"command": "mcp-chroma",
"args": [
"--client-type",
"http",
"--host",
"localhost",
"--port",
"8000"
],
"env": {
"CHROMA_API_KEY": "<YOUR_API_KEY>"
}
}
}
}
Add the following to your .vscode/mcp.json
file:
{
"mcp": {
"inputs": [
{
"type": "promptString",
"id": "chroma_api_key",
"description": "ChromaDB API Key",
"password": true
}
],
"servers": {
"chroma": {
"command": "mcp-chroma",
"args": [
"--client-type",
"http",
"--host",
"localhost",
"--port",
"8000"
],
"env": {
"CHROMA_API_KEY": "${input:chroma_api_key}"
}
}
}
}
}
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 > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
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 explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.