Skip to content
Back to search

chroma-mcp

A Model Context Protocol (MCP) server implementation that provides database capabilities for Chroma

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/chroma-core--chroma-mcp/badge.svg)](/listings/chroma-core--chroma-mcp)

HTML

<a href="/listings/chroma-core--chroma-mcp"><img src="/api/listings/chroma-core--chroma-mcp/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 189 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. <p align="center">
  2. <a href="https://trychroma.com"><img src="https://user-images.githubusercontent.com/891664/227103090-6624bf7d-9524-4e05-9d2c-c28d5d451481.png" alt="Chroma logo"></a>
  3. </p>
  4. <p align="center">
  5. <b>Chroma - the open-source embedding database</b>. <br />
  6. The fastest way to build Python or JavaScript LLM apps with memory!
  7. </p>
  8. <p align="center">
  9. <a href="https://discord.gg/MMeYNTmh3x" target="_blank">
  10. <img src="https://img.shields.io/discord/1073293645303795742?cacheSeconds=3600" alt="Discord">
  11. </a> |
  12. <a href="https://github.com/chroma-core/chroma/blob/master/LICENSE" target="_blank">
  13. <img src="https://img.shields.io/static/v1?label=license&message=Apache 2.0&color=white" alt="License">
  14. </a> |
  15. <a href="https://docs.trychroma.com/" target="_blank">
  16. Docs
  17. </a> |
  18. <a href="https://www.trychroma.com/" target="_blank">
  19. Homepage
  20. </a>
  21. </p>
  22. # Chroma MCP Server
  23. [![smithery badge](https://smithery.ai/badge/@chroma-core/chroma-mcp)](https://smithery.ai/server/@chroma-core/chroma-mcp)
  24. [The Model Context Protocol (MCP)](https://modelcontextprotocol.io/introduction) is an open protocol designed for effortless integration between LLM applications and external data sources or tools, offering a standardized framework to seamlessly provide LLMs with the context they require.
  25. This 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.
  26. This is a MCP server for self-hosting your access to Chroma. If you are looking for [Package Search](https://www.trychroma.com/package-search) you can find the repository for that [here](https://github.com/chroma-core/package-search).
  27. ## Features
  28. - **Flexible Client Types**
  29. - Ephemeral (in-memory) for testing and development
  30. - Persistent for file-based storage
  31. - HTTP client for self-hosted Chroma instances
  32. - Cloud client for Chroma Cloud integration (automatically connects to api.trychroma.com)
  33. - **Collection Management**
  34. - Create, modify, and delete collections
  35. - List all collections with pagination support
  36. - Get collection information and statistics
  37. - Configure HNSW parameters for optimized vector search
  38. - Select embedding functions when creating collections
  39. - **Document Operations**
  40. - Add documents with optional metadata and custom IDs
  41. - Query documents using semantic search
  42. - Advanced filtering using metadata and document content
  43. - Retrieve documents by IDs or filters
  44. - Full text search capabilities
  45. ### Supported Tools
  46. - `chroma_list_collections` - List all collections with pagination support
  47. - `chroma_create_collection` - Create a new collection with optional HNSW configuration
  48. - `chroma_peek_collection` - View a sample of documents in a collection
  49. - `chroma_get_collection_info` - Get detailed information about a collection
  50. - `chroma_get_collection_count` - Get the number of documents in a collection
  51. - `chroma_modify_collection` - Update a collection's name or metadata
  52. - `chroma_delete_collection` - Delete a collection
  53. - `chroma_add_documents` - Add documents with optional metadata and custom IDs
  54. - `chroma_query_documents` - Query documents using semantic search with advanced filtering
  55. - `chroma_get_documents` - Retrieve documents by IDs or filters with pagination
  56. - `chroma_update_documents` - Update existing documents' content, metadata, or embeddings
  57. - `chroma_delete_documents` - Delete specific documents from a collection
  58. ### Embedding Functions
  59. Chroma MCP supports several embedding functions: `default`, `cohere`, `openai`, `jina`, `voyageai`, and `roboflow`.
  60. The embedding functions utilize Chroma's collection configuration, which persists the selected embedding function of a collection for retrieval. Once a collection is created using the collection configuration, on retrieval for future queries and inserts, the same embedding function will be used, without needing to specify the embedding function again. Embedding function persistance was added in v1.0.0 of Chroma, so if you created a collection using version <=0.6.3, this feature is not supported.
  61. When accessing embedding functions that utilize external APIs, please be sure to add the environment variable for the API key with the correct format, found in [Embedding Function Environment Variables](#embedding-function-environment-variables)
  62. ## Usage with Claude Desktop
  63. 1. To add an ephemeral client, add the following to your `claude_desktop_config.json` file:
  64. ```json
  65. "chroma": {
  66. "command": "uvx",
  67. "args": [
  68. "chroma-mcp"
  69. ]
  70. }
  71. ```
  72. 2. To add a persistent client, add the following to your `claude_desktop_config.json` file:
  73. ```json
  74. "chroma": {
  75. "command": "uvx",
  76. "args": [
  77. "chroma-mcp",
  78. "--client-type",
  79. "persistent",
  80. "--data-dir",
  81. "/full/path/to/your/data/directory"
  82. ]
  83. }
  84. ```
  85. This will create a persistent client that will use the data directory specified.
  86. 3. To connect to Chroma Cloud, add the following to your `claude_desktop_config.json` file:
  87. ```json
  88. "chroma": {
  89. "command": "uvx",
  90. "args": [
  91. "chroma-mcp",
  92. "--client-type",
  93. "cloud",
  94. "--tenant",
  95. "your-tenant-id",
  96. "--database",
  97. "your-database-name",
  98. "--api-key",
  99. "your-api-key"
  100. ]
  101. }
  102. ```
  103. This will create a cloud client that automatically connects to api.trychroma.com using SSL.
  104. **Note:** Adding API keys in arguments is fine on local devices, but for safety, you can also specify a custom path for your environment configuration file using the `--dotenv-path` argument within the `args` list, for example: `"args": ["chroma-mcp", "--dotenv-path", "/custom/path/.env"]`.
  105. 4. To connect to a [self-hosted Chroma instance on your own cloud provider](https://docs.trychroma.com/
  106. production/deployment), add the following to your `claude_desktop_config.json` file:
  107. ```json
  108. "chroma": {
  109. "command": "uvx",
  110. "args": [
  111. "chroma-mcp",
  112. "--client-type",
  113. "http",
  114. "--host",
  115. "your-host",
  116. "--port",
  117. "your-port",
  118. "--custom-auth-credentials",
  119. "your-custom-auth-credentials",
  120. "--ssl",
  121. "true"
  122. ]
  123. }
  124. ```
  125. This will create an HTTP client that connects to your self-hosted Chroma instance.
  126. ### Demos
  127. Find reference usages, such as shared knowledge bases & adding memory to context windows in the [Chroma MCP Docs](https://docs.trychroma.com/integrations/frameworks/anthropic-mcp#using-chroma-with-claude)
  128. ### Using Environment Variables
  129. You can also use environment variables to configure the client. The server will automatically load variables from a `.env` file located at the path specified by `--dotenv-path` (defaults to `.chroma_env` in the working directory) or from system environment variables. Command-line arguments take precedence over environment variables.
  130. ```bash
  131. # Common variables
  132. export CHROMA_CLIENT_TYPE="http" # or "cloud", "persistent", "ephemeral"
  133. # For persistent client
  134. export CHROMA_DATA_DIR="/full/path/to/your/data/directory"
  135. # For cloud client (Chroma Cloud)
  136. export CHROMA_TENANT="your-tenant-id"
  137. export CHROMA_DATABASE="your-database-name"
  138. export CHROMA_API_KEY="your-api-key"
  139. # For HTTP client (self-hosted)
  140. export CHROMA_HOST="your-host"
  141. export CHROMA_PORT="your-port"
  142. export CHROMA_CUSTOM_AUTH_CREDENTIALS="your-custom-auth-credentials"
  143. export CHROMA_SSL="true"
  144. # Optional: Specify path to .env file (defaults to .chroma_env)
  145. export CHROMA_DOTENV_PATH="/path/to/your/.env"
  146. ```
  147. #### Embedding Function Environment Variables
  148. When using external embedding functions that access an API key, follow the naming convention
  149. `CHROMA_<>_API_KEY="<key>"`.
  150. So to set a Cohere API key, set the environment variable `CHROMA_COHERE_API_KEY=""`. We recommend adding this to a .env file somewhere and using the `CHROMA_DOTENV_PATH` environment variable or `--dotenv-path` flag to set that location for safekeeping.

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.