Purpose
chroma-mcp is a Model Context Protocol (MCP) server implementation that provides database capabilities for Chroma, an open-source embedding database. MCP is an open protocol used to enable seamless integration between LLM applications and external data sources or tools, providing LLMs with the context they need. This server provides data retrieval capabilities through Chroma, enabling AI models to create collections based on generated data and user input, and to retrieve data through vector search, full-text search, metadata filtering, and other methods. It is used for self-hosted access to Chroma.
Main Capabilities
Flexible Client Types
- Ephemeral (in-memory): for testing and development
- Persistent: file-based storage
- HTTP client: for self-hosted Chroma instances
- Cloud client: for Chroma Cloud integration (automatically connects to api.trychroma.com)
Collection Management
- Create, modify, and delete collections
- Support paginated listing of all collections
- Get collection information and statistics
- Configure HNSW parameters to optimize vector search
- Select an embedding function when creating a collection
Document Operations
- Add documents, optionally with metadata and custom IDs
- Query documents using semantic search
- Advanced filtering using metadata and document content
- Retrieve documents by ID or filter
- Full-text search capabilities
Supported Tools
- chroma_list_collections: list all collections with pagination
- chroma_create_collection: create a new collection, optionally with HNSW configuration
- chroma_peek_collection: view a sample of documents in a collection
- chroma_get_collection_info: get detailed information about a collection
- chroma_get_collection_count: get the number of documents in a collection
- chroma_modify_collection: update a collection name or metadata
- chroma_delete_collection: delete a collection
- chroma_add_documents: add documents, optionally with metadata and custom IDs
- chroma_query_documents: query documents using semantic search and advanced filtering
- chroma_get_documents: retrieve documents by ID or filter, with pagination support
- chroma_update_documents: update the content, metadata, or embeddings of existing documents
- chroma_delete_documents: delete specific documents from a collection
Embedding Functions
Chroma MCP supports multiple embedding functions: default, cohere, openai, jina, voyageai, and roboflow. Embedding functions use Chroma's collection configuration, which persists the embedding function selected for a collection so it can be retrieved. Once a collection is created with a collection configuration, the same embedding function will be used in later retrievals for queries and insertions, without needing to be specified again. Embedding function persistence was added in Chroma v1.0.0, so this feature is not supported if collections were created using versions <=0.6.3. When accessing embedding functions that use external APIs, be sure to add environment variables for API keys in the correct format; see Embedding Function Environment Variables for details.
Usage
Using with Claude Desktop
- Add an ephemeral client: add the corresponding configuration in the claude_desktop_config.json file.
- Add a persistent client: add the corresponding configuration in the claude_desktop_config.json file. This will create a persistent client using the specified data directory.
- Connect to Chroma Cloud: add the corresponding configuration in the claude_desktop_config.json file. This will create a cloud client that automatically connects to api.trychroma.com using SSL.
- Note: Adding the API key in the parameters on a local device is fine, but for security, you can also specify the path to the environment configuration file using the --dotenv-path parameter in the args list, for example: "args": ["chroma-mcp", "--dotenv-path", "/custom/path/.env"].
- Connect to a self-hosted Chroma instance: add the corresponding configuration in the claude_desktop_config.json file. This will create an HTTP client that connects to a self-hosted Chroma instancesemantic search and advanced filtering to query documents
- chroma_get_documents: retrieve documents by ID or filter, with pagination support
- chroma_update_documents: update the content, metadata, or embeddings of existing documents
- chroma_delete_documents: delete specific documents from a collection
Embedding Functions
Chroma MCP supports multiple embedding functions: default, cohere, openai, jina, voyageai, and roboflow. Embedding functions use Chroma's collection configuration, which persists the embedding function selected for a collection so it can be retrieved. Once a collection is created with a collection configuration, the same embedding function will be used in later retrievals for queries and insertions, without needing to be specified again. Embedding function persistence was added in Chroma v1.0.0, so this feature is not supported if collections were created using versions <=0.6.3. When accessing embedding functions that use external APIs, be sure to add environment variables for API keys in the correct format; see Embedding Function Environment Variables for details.
Usage
Using with Claude Desktop
- Add an ephemeral client: add the corresponding configuration in the claude_desktop_config.json file.
- Add a persistent client: add the corresponding configuration in the claude_desktop_config.json file. This will create a persistent client using the specified data directory.
- Connect to Chroma Cloud: add the corresponding configuration in the claude_desktop_config.json file. This will create a cloud client that automatically connects to api.trychroma.com using SSL.
- Note: Adding the API key in the parameters on a local device is fine, but for security, you can also specify the path to the environment configuration file using the --dotenv-path parameter in the args list, for example: "args": ["chroma-mcp", "--dotenv-path", "/custom/path/.env"].
- Connect to a self-hosted Chroma instance: add the corresponding configuration in the claude_desktop_config.json file. This will create an HTTP client that connects to a self-hosted Chroma instance.
Using Environment Variables
You can also configure the client using environment variables. The server will automatically load variables from the path specified by --dotenv-path (by default, .chroma_env in the working directory) or from system environment variables. Command-line arguments take precedence over environment variables. When using an external embedding function that accesses an API key, follow the naming convention CHROMA_<>_API_KEY="<key>". For example, to set the Cohere API key, set the environment variable CHROMA_COHERE_API_KEY="". It is recommended to add it to a .env file and set that location using the CHROMA_DOTENV_PATH environment variable or the --dotenv-path flag so it can be kept secure.
Use Cases
- Provide Chroma-based retrieval capabilities for LLM applications
- Integrate a Chroma database in MCP clients such as Claude Desktop
- Build a shared knowledge base
- Add memory to the context window
- Testing and development (temporary client)
- File storage (persistent client)
- Self-hosted Chroma instance (HTTP client)
- Chroma Cloud integration (cloud client)
Limitations
- Embedding function persistence is supported only in Chroma v1.0.0 and later; collections created with versions <=0.6.3 do not support this feature.
- Accessing external embedding functions requires configuring the corresponding API key environment variables.
- For more information such as billing, pricing, and platform support, the materials do not currently provide it.