# chroma-mcp

> MCP Server

This repository provides a Model Context Protocol (MCP) server, enabling AI models to leverage Chroma's capabilities for data retrieval using vector search, full text search, and metadata filtering, facilitating seamless

## Overview

- **Category:** Database
- **Language:** Python
- **Stars:** 585
- **Forks:** 7
- **Owner:** chroma-core
- **GitHub:** https://github.com/chroma-core/chroma-mcp
- **Created:** 2025-02-11T00:23:22+00:00
- **Updated:** 2025-03-28T22:54:52+00:00
- **Source:** https://model-context-protocol.com/servers/model-context-protocol-server-chroma-database

## Setup

## Setup

1.  To add an ephemeral client, add the following to your `claude_desktop_config.json` file:

```json
"chroma": {
    "command": "uvx",
    "args": [
        "chroma-mcp"
    ]
}
```

2.  To add a persistent client, add the following to your `claude_desktop_config.json` file:

```json
"chroma": {
    "command": "uvx",
    "args": [
        "chroma-mcp",
        "--client-type",
        "persistent",
        "--data-dir",
        "/full/path/to/your/data/directory"
    ]
}
```

This will create a persistent client that will use the data directory specified.

3.  To connect to Chroma Cloud, add the following to your `claude_desktop_config.json` file:

```json
"chroma": {
    "command": "uvx",
    "args": [
        "chroma-mcp",
        "--client-type",
        "cloud",
        "--tenant",
        "your-tenant-id",
        "--database",
        "your-database-name",
        "--api-key",
        "your-api-key"
    ]
}
```

This will create a cloud client that automatically connects to api.trychroma.com using SSL.

4.  To connect to a [self-hosted Chroma instance on your own cloud provider](https://docs.trychroma.com/
production/deployment), add the following to your `claude_desktop_config.json` file:

```json
"chroma": {
    "command": "uvx",
    "args": [
      "chroma-mcp", 
      "--client-type", 
      "http", 
      "--host", 
      "your-host", 
      "--port", 
      "your-port", 
      "--custom-auth-credentials",
      "your-custom-auth-credentials",
      "--ssl",
      "true"
    ]
}
```

This will create an HTTP client that connects to your self-hosted Chroma instance.

You can also use environment variables to configure the client:

```bash
# 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"
```

## Tools

## Available Tools

1.  Flexible Client Types (Ephemeral, Persistent, HTTP, Cloud).
2.  Collection Management (Create, modify, delete, list, get info, configure HNSW).
3.  Document Operations (Add, query, filter, retrieve, full text search).
4.  `create_collection` (Creates a collection).
5.  `peek_collection` (Peeks into a collection).
6.  `list_collections` (Lists all collections).
7.  `get_collection_info` (Gets collection information).
8.  `get_collection_count` (Gets the collection count).
9.  `modify_collection` (Modifies a collection).
10. `delete_collection` (Deletes a collection).
11. `add_documents` (Adds documents).
12. `query_documents` (Queries documents).
13. `get_documents` (Gets documents).
