Chroma MCP Server provides data retrieval capabilities powered by Chroma, enabling AI models to create collections over generated data and user inputs, and retrieve that data using vector search, full text search, metadata filtering, and more. It serves as an implementation of the Model Context Protocol (MCP) for seamless integration between LLM applications and Chroma's embedding database.
To use the Chroma MCP Server, you'll need to configure it based on your preferred client type. There are four options available: ephemeral (in-memory), persistent (file-based), HTTP (for self-hosted instances), or cloud (for Chroma Cloud).
For testing and development, use an ephemeral client that stores data in memory:
"chroma": {
"command": "uvx",
"args": [
"chroma-mcp"
]
}
For a persistent client that saves data to disk:
"chroma": {
"command": "uvx",
"args": [
"chroma-mcp",
"--client-type",
"persistent",
"--data-dir",
"/full/path/to/your/data/directory"
]
}
To connect to Chroma Cloud:
"chroma": {
"command": "uvx",
"args": [
"chroma-mcp",
"--client-type",
"cloud",
"--tenant",
"your-tenant-id",
"--database",
"your-database-name",
"--api-key",
"your-api-key"
]
}
To connect to a self-hosted Chroma instance:
"chroma": {
"command": "uvx",
"args": [
"chroma-mcp",
"--client-type",
"http",
"--host",
"your-host",
"--port",
"your-port",
"--custom-auth-credentials",
"your-custom-auth-credentials",
"--ssl",
"true"
]
}
You can also configure the client using environment variables. The server will load variables from a .env
file or from system environment variables.
# Common variables
export CHROMA_CLIENT_TYPE="http" # or "cloud", "persistent", "ephemeral"
# For persistent client
export CHROMA_DATA_DIR="/full/path/to/your/data/directory"
# For cloud client (Chroma Cloud)
export CHROMA_TENANT="your-tenant-id"
export CHROMA_DATABASE="your-database-name"
export CHROMA_API_KEY="your-api-key"
# For HTTP client (self-hosted)
export CHROMA_HOST="your-host"
export CHROMA_PORT="your-port"
export CHROMA_CUSTOM_AUTH_CREDENTIALS="your-custom-auth-credentials"
export CHROMA_SSL="true"
# Optional: Specify path to .env file (defaults to .chroma_env)
export CHROMA_DOTENV_PATH="/path/to/your/.env"
The Chroma MCP Server provides a variety of tools for managing collections and documents.
Use chroma_list_collections
to view all collections with pagination support.
Use chroma_create_collection
to create a new collection with optional HNSW configuration.
chroma_peek_collection
- View a sample of documents in a collectionchroma_get_collection_info
- Get detailed information about a collectionchroma_get_collection_count
- Get the number of documents in a collectionchroma_modify_collection
- Update a collection's name or metadatachroma_delete_collection
- Delete a collectionUse chroma_add_documents
to add documents with optional metadata and custom IDs.
Use chroma_query_documents
for semantic search with advanced filtering options.
Use chroma_get_documents
to retrieve documents by IDs or filters with pagination.
chroma_update_documents
- Update existing documents' content, metadata, or embeddingschroma_delete_documents
- Delete specific documents from a collectionChroma MCP supports several embedding functions:
default
cohere
openai
jina
voyageai
roboflow
When using external embedding functions that require API keys, set the appropriate environment variable:
# Example for Cohere API key
export CHROMA_COHERE_API_KEY="your-api-key"
For secure storage, add these keys to a .env
file and specify its location with the --dotenv-path
flag or CHROMA_DOTENV_PATH
environment variable.
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "chroma" '{"command":"uvx","args":["chroma-mcp"]}'
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": "uvx",
"args": [
"chroma-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 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": "uvx",
"args": [
"chroma-mcp"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect