Cover image
Try Now
2025-01-02

Serveur MCP pour chroma

3 years

Works with Finder

2

Github Watches

7

Github Forks

26

Github Stars

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.

相关推荐

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • lumpenspace
  • Take an adjectivised noun, and create images making it progressively more adjective!

  • https://appia.in
  • Siri Shortcut Finder – your go-to place for discovering amazing Siri Shortcuts with ease

  • Carlos Ferrin
  • Encuentra películas y series en plataformas de streaming.

  • Yusuf Emre Yeşilyurt
  • I find academic articles and books for research and literature reviews.

  • https://zenepic.net
  • Embark on a thrilling diplomatic quest across a galaxy on the brink of war. Navigate complex politics and alien cultures to forge peace and avert catastrophe in this immersive interstellar adventure.

  • apappascs
  • Découvrez la collection la plus complète et la plus à jour de serveurs MCP sur le marché. Ce référentiel sert de centre centralisé, offrant un vaste catalogue de serveurs MCP open-source et propriétaires, avec des fonctionnalités, des liens de documentation et des contributeurs.

  • ShrimpingIt
  • Manipulation basée sur Micropython I2C de l'exposition GPIO de la série MCP, dérivée d'Adafruit_MCP230XX

  • jae-jae
  • MCP Server pour récupérer le contenu de la page Web à l'aide du navigateur sans tête du dramwright.

  • ravitemer
  • Un puissant plugin Neovim pour gérer les serveurs MCP (Protocole de contexte modèle)

  • patruff
  • Pont entre les serveurs Olllama et MCP, permettant aux LLM locaux d'utiliser des outils de protocole de contexte de modèle

  • pontusab
  • La communauté du curseur et de la planche à voile, recherchez des règles et des MCP

  • av
  • Exécutez sans effort LLM Backends, API, Frontends et Services avec une seule commande.

  • WangRongsheng
  • 🧑‍🚀 全世界最好的 LLM 资料总结 (数据处理、模型训练、模型部署、 O1 模型、 MCP 、小语言模型、视觉语言模型) | Résumé des meilleures ressources LLM du monde.

  • Mintplex-Labs
  • L'application tout-en-un desktop et Docker AI avec chiffon intégré, agents AI, constructeur d'agent sans code, compatibilité MCP, etc.

  • appcypher
  • Serveurs MCP géniaux - une liste organisée de serveurs de protocole de contexte de modèle

    Reviews

    5 (1)
    Avatar
    user_wLpbcw58
    2025-04-17

    Chroma by privetin is an outstanding tool that has significantly improved my workflow. Its seamless integration and intuitive design make it a must-have for any developer. Explore its features on GitHub and elevate your projects today! Check it out: https://github.com/privetin/chroma