Chroma MCP server

Integrates with Chroma vector database to enable collection management, document operations, and vector search capabilities for knowledge bases and context-aware conversations.
Back to servers
Setup instructions
Provider
Chroma
Release date
Mar 17, 2025
Language
Python
Package
Stats
19.4K downloads
219 stars

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.

Installation and Setup

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).

Setting Up with Claude Desktop

Ephemeral Client (In-Memory)

For testing and development, use an ephemeral client that stores data in memory:

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

Persistent Client (File-Based)

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"
    ]
}

Cloud Client (Chroma Cloud)

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"
    ]
}

HTTP Client (Self-Hosted)

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"
    ]
}

Using Environment Variables

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" 

Using Chroma MCP Server

The Chroma MCP Server provides a variety of tools for managing collections and documents.

Collection Management

List Collections

Use chroma_list_collections to view all collections with pagination support.

Create Collection

Use chroma_create_collection to create a new collection with optional HNSW configuration.

View Collection Information

  • 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

Modify or Delete Collections

  • chroma_modify_collection - Update a collection's name or metadata
  • chroma_delete_collection - Delete a collection

Document Operations

Add Documents

Use chroma_add_documents to add documents with optional metadata and custom IDs.

Query Documents

Use chroma_query_documents for semantic search with advanced filtering options.

Retrieve Documents

Use chroma_get_documents to retrieve documents by IDs or filters with pagination.

Update or Delete Documents

  • chroma_update_documents - Update existing documents' content, metadata, or embeddings
  • chroma_delete_documents - Delete specific documents from a collection

Embedding Functions

Chroma 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.

How to install this MCP server

For Claude Code

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.

For Cursor

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.

Adding an MCP server to Cursor globally

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"
            ]
        }
    }
}

Adding an MCP server to a project

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.

How to use the MCP server

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.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.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

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later