Chroma MCP
Chroma MCP is a server for managing vector databases with semantic and full-text search. It enables AI apps to create, query, and manage collections using flexible clients and embedding functions.
How to Install and Use Chroma MCP
Chroma MCP is a handy tool that helps you manage and search your data using AI technology. It works as a server that connects your AI apps to a powerful database system called Chroma. Here’s a simple guide on how to install and start using Chroma MCP quickly.
Step 1: Install Chroma MCP
Before using Chroma MCP, you need to install it on your computer. You can install it using Python’s package manager, pip, which makes everything easy.
To install Chroma MCP, open your terminal or command prompt and run this command:
pip install chroma-mcp
This command downloads and installs Chroma MCP and all the tools it needs to work right.
Step 2: Running Chroma MCP Server
Once installation is done, you can run the Chroma MCP server. This creates a place where your data collections live and can be searched by your AI models.
To start the server simply, type:
chroma-mcp
This command starts the server with default settings, including an ephemeral client that keeps data in memory (which is good for testing).
Step 3: Use Different Client Types
Chroma MCP supports several types of clients to connect with the server. Each works differently depending on your needs.
- Ephemeral (in-memory): Ideal for testing since it doesn’t save data after closing.
- Persistent (file-storage): Saves data on your computer.
- HTTP client: Connects to your own self-hosted Chroma server.
- Cloud client: Links to Chroma Cloud services for easy online access.
To run a persistent client, use this command:
chroma-mcp --client-type persistent --data-dir /path/to/your/data
Make sure to change /path/to/your/data to the actual folder you want to keep your data in.
Step 4: Connecting to Chroma Cloud
If you want to use Chroma Cloud instead of hosting the database yourself, you can set up a cloud client. You need your tenant ID, database name, and API key from Chroma Cloud.
Run this command to start:
chroma-mcp --client-type cloud --tenant your-tenant-id --database your-database-name --api-key your-api-key
Replace the your-tenant-id, your-database-name, and your-api-key with your real info.
Step 5: Using Chroma MCP in Claude Desktop
You can also use Chroma MCP with a tool called Claude Desktop. Depending on the client type you want, edit the claude_desktop_config.json file inside Claude Desktop to add Chroma MCP:
For an ephemeral client, add:
"chroma": {
"command": "uvx",
"args": [
"chroma-mcp"
]
}
For a persistent client, add:
"chroma": {
"command": "uvx",
"args": [
"chroma-mcp",
"--client-type",
"persistent",
"--data-dir",
"/full/path/to/your/data/directory"
]
}
For connecting to Chroma Cloud, add:
"chroma": {
"command": "uvx",
"args": [
"chroma-mcp",
"--client-type",
"cloud",
"--tenant",
"your-tenant-id",
"--database",
"your-database-name",
"--api-key",
"your-api-key"
]
}
Change the paths and IDs to match your setup.
Step 6: Use Environment Variables
You can also control Chroma MCP using environment variables instead of command-line options. This is helpful when you want to keep sensitive keys safe.
Here’s how you can set environment variables on your system:
export CHROMA_CLIENT_TYPE="persistent"
export CHROMA_DATA_DIR="/path/to/your/data"
export CHROMA_TENANT="your-tenant-id"
export CHROMA_DATABASE="your-database-name"
export CHROMA_API_KEY="your-api-key"
Set only the ones you need based on your client type.
By following these simple steps, you can install and start using Chroma MCP to manage your data collections with ease. This opens up powerful AI search features using Chroma’s robust database system.