Fire in da houseTop Tip:Paying $100+ per month for Perplexity, MidJourney, Runway, ChatGPT and other tools is crazy - get all your AI tools in one site starting at $15 per month with Galaxy AI Fire in da houseCheck it out free

chroma

MCP.Pizza Chef: privetin

The Chroma MCP server is a Python-based implementation of a Model Context Protocol server that leverages Chroma's vector database technology. It provides advanced semantic document search, metadata filtering, and comprehensive document management capabilities. The server supports CRUD operations on documents, storing both content and metadata persistently in a local directory. Designed for seamless integration with MCP clients, it enables efficient retrieval and management of documents based on semantic similarity, making it ideal for AI workflows requiring contextual document access and manipulation.

Use This MCP server To

Perform semantic search on large document collections Store and manage documents with metadata Filter documents by metadata attributes Persistently save documents for long-term access Retrieve documents by unique document ID Create, update, and delete documents programmatically Enable AI agents to access contextual document data

README

Chroma MCP Server

A Model Context Protocol (MCP) server implementation that provides vector database capabilities through Chroma. This server enables semantic document search, metadata filtering, and document management with persistent storage.

Requirements

  • Python 3.8+
  • Chroma 0.4.0+
  • MCP SDK 0.1.0+

Components

Resources

The server provides document storage and retrieval through Chroma's vector database:

  • Stores documents with content and metadata
  • Persists data in src/chroma/data directory
  • Supports semantic similarity search

Tools

The server implements CRUD operations and search functionality:

Document Management
  • create_document: Create a new document

    • Required: document_id, content
    • Optional: metadata (key-value pairs)
    • Returns: Success confirmation
    • Error: Already exists, Invalid input
  • read_document: Retrieve a document by ID

    • Required: document_id
    • Returns: Document content and metadata
    • Error: Not found
  • update_document: Update an existing document

    • Required: document_id, content
    • Optional: metadata
    • Returns: Success confirmation
    • Error: Not found, Invalid input
  • delete_document: Remove a document

    • Required: document_id
    • Returns: Success confirmation
    • Error: Not found
  • list_documents: List all documents

    • Optional: limit, offset
    • Returns: List of documents with content and metadata
Search Operations
  • search_similar: Find semantically similar documents
    • Required: query
    • Optional: num_results, metadata_filter, content_filter
    • Returns: Ranked list of similar documents with distance scores
    • Error: Invalid filter

Features

  • Semantic Search: Find documents based on meaning using Chroma's embeddings
  • Metadata Filtering: Filter search results by metadata fields
  • Content Filtering: Additional filtering based on document content
  • Persistent Storage: Data persists in local directory between server restarts
  • Error Handling: Comprehensive error handling with clear messages
  • Retry Logic: Automatic retries for transient failures

Installation

  1. Install dependencies:
uv venv
uv sync --dev --all-extras

Configuration

Claude Desktop

Add the server configuration to your Claude Desktop config:

Windows: C:\Users\<username>\AppData\Roaming\Claude\claude_desktop_config.json

MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "chroma": {
      "command": "uv",
      "args": [
        "--directory",
        "C:/MCP/server/community/chroma",
        "run",
        "chroma"
      ]
    }
  }
}

Data Storage

The server stores data in:

  • Windows: src/chroma/data
  • MacOS/Linux: src/chroma/data

Usage

  1. Start the server:
uv run chroma
  1. Use MCP tools to interact with the server:
# Create a document
create_document({
    "document_id": "ml_paper1",
    "content": "Convolutional neural networks improve image recognition accuracy.",
    "metadata": {
        "year": 2020,
        "field": "computer vision",
        "complexity": "advanced"
    }
})

# Search similar documents
search_similar({
    "query": "machine learning models",
    "num_results": 2,
    "metadata_filter": {
        "year": 2020,
        "field": "computer vision"
    }
})

Error Handling

The server provides clear error messages for common scenarios:

  • Document already exists [id=X]
  • Document not found [id=X]
  • Invalid input: Missing document_id or content
  • Invalid filter
  • Operation failed: [details]

Development

Testing

  1. Run the MCP Inspector for interactive testing:
npx @modelcontextprotocol/inspector uv --directory C:/MCP/server/community/chroma run chroma
  1. Use the inspector's web interface to:
    • Test CRUD operations
    • Verify search functionality
    • Check error handling
    • Monitor server logs

Building

  1. Update dependencies:
uv compile pyproject.toml
  1. Build package:
uv build

Contributing

Contributions are welcome! Please read our Contributing Guidelines for details on:

  • Code style
  • Testing requirements
  • Pull request process

License

This project is licensed under the MIT License - see the LICENSE file for details.

chroma FAQ

What are the system requirements for the Chroma MCP server?
The server requires Python 3.8 or higher, Chroma version 0.4.0 or above, and MCP SDK 0.1.0 or newer.
How does the Chroma MCP server store documents?
Documents are stored with their content and metadata persistently in the 'src/chroma/data' directory using Chroma's vector database.
What operations does the Chroma MCP server support?
It supports CRUD operations including creating, reading, updating, and deleting documents, as well as semantic similarity search and metadata filtering.
Can the Chroma MCP server handle semantic search?
Yes, it provides semantic similarity search capabilities to find documents based on content meaning, not just keywords.
Is the data stored by the Chroma MCP server persistent?
Yes, all documents and metadata are saved persistently on disk to ensure long-term availability.
How does the server handle document metadata?
Metadata can be added as key-value pairs during document creation or update, and can be used for filtering during searches.
What happens if I try to create a document with an existing ID?
The server returns an error indicating the document already exists to prevent duplicates.
Which LLM providers can integrate with the Chroma MCP server?
The server is compatible with models from OpenAI, Anthropic Claude, and Google Gemini through the MCP protocol.