ChromaDB MCP server

Provides direct access to ChromaDB vector database capabilities for semantic search and document management with customizable parameters for collection creation, document operations, and similarity searches.
Back to servers
Provider
viable
Release date
Apr 13, 2025
Language
Rust
Stats
1 star

The MCP-Chroma server provides an interface for working with ChromaDB, a vector database for embeddings. It allows you to manage collections and documents through a set of tools using the Model-Controller-Protocol (MCP) interface.

Installation

To install the MCP-Chroma server, clone the repository and build it using Cargo:

git clone https://github.com/yourusername/mcp-chroma.git
cd mcp-chroma
cargo build --release

Configuration

Environment Setup

Create a .chroma_env file in your project directory with configuration parameters:

CHROMA_CLIENT_TYPE=ephemeral
CHROMA_HOST=localhost
CHROMA_PORT=8000

Configuration Options

Option Environment Variable Description Default
--client-type CHROMA_CLIENT_TYPE Type of client (ephemeral, persistent, http, cloud) ephemeral
--data-dir CHROMA_DATA_DIR Directory for persistent storage None
--host CHROMA_HOST Host for HTTP client None
--port CHROMA_PORT Port for HTTP client None
--ssl CHROMA_SSL Use SSL for HTTP client true
--tenant CHROMA_TENANT Tenant for cloud client None
--database CHROMA_DATABASE Database for cloud client None
--api-key CHROMA_API_KEY API key for cloud client None
--dotenv-path CHROMA_DOTENV_PATH Path to .env file .chroma_env

Client Types

  1. Ephemeral: In-memory client (default)
  2. Persistent: Local storage client with persistence
  3. HTTP: Remote client via HTTP
  4. Cloud: Managed cloud client

Running the Server

# Run with default configuration
./mcp-chroma

# Run with specific client type
./mcp-chroma --client-type http --host localhost --port 8000

# Run with persistent storage
./mcp-chroma --client-type persistent --data-dir ./chroma_data

Available Tools

Collection Management

  • chroma_list_collections: List all collections
  • chroma_create_collection: Create a new collection
  • chroma_peek_collection: Preview documents in a collection
  • chroma_get_collection_info: Get metadata about a collection
  • chroma_get_collection_count: Count documents in a collection
  • chroma_modify_collection: Update collection properties
  • chroma_delete_collection: Delete a collection

Document Operations

  • chroma_add_documents: Add documents to a collection
  • chroma_query_documents: Search for similar documents
  • chroma_get_documents: Retrieve documents from a collection
  • chroma_update_documents: Update existing documents
  • chroma_delete_documents: Delete documents from a collection

Session Management

  • process_thought: Process thoughts in an ongoing session

Usage Examples

Creating a Collection

{
  "collection_name": "my_documents",
  "metadata": {
    "description": "A collection of example documents"
  }
}

Querying Documents

{
  "collection_name": "my_documents",
  "query_texts": ["What are the benefits of vector databases?"],
  "n_results": 3
}

Integration with AI Platforms

Integration with Claude

Configure MCP-Chroma with Claude using:

{
  "mcpServers": {
    "chroma": {
      "command": "mcp-chroma",
      "args": [
        "--client-type",
        "http",
        "--host",
        "localhost",
        "--port",
        "8000"
      ],
      "env": {
        "CHROMA_API_KEY": "<YOUR_API_KEY>"
      }
    }
  }
}

Integration with Cursor

Add the following to your .vscode/mcp.json file:

{
  "mcp": {
    "inputs": [
      {
        "type": "promptString",
        "id": "chroma_api_key",
        "description": "ChromaDB API Key",
        "password": true
      }
    ],
    "servers": {
      "chroma": {
        "command": "mcp-chroma",
        "args": [
          "--client-type",
          "http",
          "--host",
          "localhost",
          "--port",
          "8000"
        ],
        "env": {
          "CHROMA_API_KEY": "${input:chroma_api_key}"
        }
      }
    }
  }
}

How to add this MCP server to 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 > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-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 explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

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