Chroma MCP Server
Chroma MCP 服务器
模型上下文协议 (MCP) 服务器实现,通过 Chroma 提供矢量数据库功能。该服务器支持语义文档搜索、元数据过滤以及具有持久存储的文档管理。
要求
Python 3.8+
Chroma 0.4.0+
MCP SDK 0.1.0+
Related MCP server: Chroma MCP Server
成分
资源
服务器通过Chroma的矢量数据库提供文档存储和检索:
存储包含内容和元数据的文档
将数据保存在
src/chroma/data目录中支持语义相似性搜索
工具
服务器实现 CRUD 操作和搜索功能:
文档管理
create_document:创建新文档必需:
document_id、content可选:
metadata(键值对)返回:成功确认
错误:已存在,输入无效
read_document:通过 ID 检索文档必填:
document_id返回:文档内容和元数据
错误:未找到
update_document:更新现有文档必需:
document_id、content可选:
metadata返回:成功确认
错误:未找到,输入无效
delete_document:删除文档必填:
document_id返回:成功确认
错误:未找到
list_documents:列出所有文档可选:
limit、offset返回:包含内容和元数据的文档列表
搜索行动
search_similar:查找语义相似的文档必填:
query可选:
num_results、metadata_filter、content_filter返回:具有距离分数的相似文档的排序列表
错误:过滤器无效
特征
语义搜索:使用 Chroma 的嵌入查找基于含义的文档
元数据过滤:按元数据字段过滤搜索结果
内容过滤:基于文档内容的附加过滤
持久存储:服务器重启后数据仍保留在本地目录中
错误处理:全面的错误处理,清晰的消息
重试逻辑:瞬时故障自动重试
安装
安装依赖项:
uv venv
uv sync --dev --all-extras配置
克劳德桌面
将服务器配置添加到您的 Claude Desktop 配置中:
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"
]
}
}
}数据存储
服务器将数据存储在:
Windows:
src/chroma/dataMacOS/Linux:
src/chroma/data
用法
启动服务器:
uv run chroma使用 MCP 工具与服务器交互:
# 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"
}
})错误处理
服务器针对常见场景提供了清晰的错误消息:
Document already exists [id=X]Document not found [id=X]Invalid input: Missing document_id or contentInvalid filterOperation failed: [details]
发展
测试
运行 MCP Inspector 进行交互式测试:
npx @modelcontextprotocol/inspector uv --directory C:/MCP/server/community/chroma run chroma使用检查器的 Web 界面可以执行以下操作:
测试 CRUD 操作
验证搜索功能
检查错误处理
监控服务器日志
建筑
更新依赖项:
uv compile pyproject.toml构建包:
uv build贡献
欢迎贡献!请阅读我们的贡献指南,了解详情:
代码风格
测试要求
拉取请求流程
执照
该项目根据 MIT 许可证获得许可 - 有关详细信息,请参阅LICENSE文件。
Available Tools
6 toolscreate_documentC
Create a new document in the Chroma vector database
| Name | Required | Description | Default |
|---|---|---|---|
| content | Yes | ||
| metadata | No | ||
| document_id | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. While 'Create' implies a write operation, it doesn't disclose important behavioral traits like required permissions, whether the operation is idempotent, error handling for duplicate document_ids, or what happens if metadata is omitted. This leaves significant gaps for a mutation tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence that gets straight to the point with zero wasted words. It's appropriately sized for a basic create operation and front-loads the essential information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a mutation tool with 3 parameters, 0% schema coverage, no annotations, and no output schema, the description is insufficiently complete. It doesn't explain the return value, error conditions, or provide enough context about the parameters and their relationships to enable reliable tool invocation.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
With 0% schema description coverage for all 3 parameters, the description provides no information about parameter meanings, formats, or constraints. It doesn't explain what 'document_id' should be, what 'content' represents, or how 'metadata' should be structured, failing to compensate for the schema's lack of documentation.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Create a new document') and target resource ('in the Chroma vector database'), providing specific verb+resource information. However, it doesn't distinguish this tool from its sibling 'update_document' in terms of when to use create versus update operations, which prevents a perfect score.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives like 'update_document' or 'list_documents', nor does it mention prerequisites or constraints. It simply states what the tool does without contextual usage information.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
delete_documentB
Delete a document from the Chroma vector database by its ID
| Name | Required | Description | Default |
|---|---|---|---|
| document_id | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool deletes a document, implying a destructive mutation, but fails to disclose critical traits like whether deletion is permanent, requires specific permissions, has side effects on related data, or includes confirmation prompts. This leaves significant gaps for a destructive operation.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence with zero waste, front-loading the key action and resource. Every word earns its place, making it appropriately sized and easy to parse without unnecessary elaboration.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity as a destructive mutation with no annotations, no output schema, and low schema coverage, the description is incomplete. It lacks details on behavioral traits, error handling, return values, or usage context, making it inadequate for safe and effective tool invocation by an AI agent.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The description adds minimal meaning beyond the input schema, which has 0% description coverage. It mentions the parameter 'document_id' but does not explain its format, source, or constraints. Since schema coverage is low, the description should compensate more, but it only reiterates the parameter name without additional context, resulting in a baseline score.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the specific action ('Delete') and target resource ('a document from the Chroma vector database by its ID'), distinguishing it from sibling tools like create_document, list_documents, read_document, search_similar, and update_document. It precisely communicates what the tool does without being vague or tautological.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives, such as update_document for modifications or list_documents for verification before deletion. It lacks explicit context, prerequisites, or exclusions, leaving the agent to infer usage from the tool name alone.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_documentsB
List all documents stored in the Chroma vector database with pagination
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| offset | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions 'pagination' which is useful context, but fails to describe critical behaviors: whether this is a read-only operation (implied but not stated), what the return format looks like (e.g., list of document objects), or any limitations (e.g., performance with large datasets). For a tool with zero annotation coverage, this leaves significant gaps.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence that front-loads the core purpose ('List all documents') and adds essential context ('stored in the Chroma vector database with pagination'). Every word earns its place with zero redundancy or wasted verbiage.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's moderate complexity (list operation with pagination), no annotations, and no output schema, the description is minimally adequate. It covers the basic purpose and pagination behavior but lacks details on return values, error conditions, or interaction with sibling tools. For a read operation in a database context, this leaves the agent with incomplete information.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The description adds meaningful context beyond the input schema. While the schema documents 'limit' and 'offset' parameters with technical details (type, defaults, constraints), the description explains their purpose ('pagination'), which the schema doesn't cover (0% description coverage). This compensates well for the schema's lack of semantic information.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb ('List') and resource ('documents stored in the Chroma vector database'), making the purpose unambiguous. It distinguishes from siblings like 'read_document' (single document) and 'search_similar' (semantic search), but doesn't explicitly contrast with 'create_document' or 'update_document' which are write operations.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage for retrieving all documents with pagination, but provides no explicit guidance on when to use this tool versus alternatives like 'search_similar' for filtered results or 'read_document' for a specific document. The mention of 'pagination' suggests it's for bulk retrieval, but this is only implied rather than stated as a guideline.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
read_documentC
Retrieve a document from the Chroma vector database by its ID
| Name | Required | Description | Default |
|---|---|---|---|
| document_id | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It states the tool retrieves a document, implying a read operation, but doesn't disclose behavioral traits such as error handling (e.g., what happens if the ID doesn't exist), performance characteristics, or any rate limits. The description is minimal and lacks context beyond the basic action.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence that front-loads the key action and resource. There is no wasted language, and it directly communicates the tool's purpose without unnecessary elaboration.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given no annotations, no output schema, and low schema coverage, the description is incomplete. It doesn't explain what is returned (e.g., document content, metadata), error cases, or how it fits into the broader context of sibling tools. For a retrieval tool in a database system, more detail is needed for effective use.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema description coverage is 0%, but the description adds meaning by specifying that the parameter 'document_id' is used to retrieve a document. However, it doesn't provide details on the ID format, constraints, or examples. With only one parameter, the baseline is 4, but the lack of additional semantic context reduces it to 3.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Retrieve') and resource ('a document from the Chroma vector database'), specifying it's done by ID. It distinguishes from siblings like create_document (creation) and delete_document (deletion), but doesn't explicitly differentiate from list_documents or search_similar in terms of retrieval method.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus alternatives like list_documents (for browsing) or search_similar (for similarity-based retrieval). The description implies usage when you have a specific document ID, but lacks explicit context or exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
search_similarC
Search for semantically similar documents in the Chroma vector database
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ||
| num_results | No | ||
| content_filter | No | ||
| metadata_filter | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions 'semantically similar documents' and the database type, but fails to describe critical behaviors such as how similarity is measured, whether results are ranked, what happens with no matches, or any rate limits or permissions required. This leaves significant gaps for a search operation.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence that gets straight to the point without unnecessary words. It's appropriately sized for a basic tool description, though it could benefit from additional context to improve completeness without sacrificing brevity.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the complexity of a similarity search tool with 4 parameters, 0% schema coverage, no annotations, and no output schema, the description is inadequate. It lacks details on parameter usage, behavioral traits, return values, and differentiation from siblings, making it insufficient for an agent to use the tool effectively without additional context.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must compensate for undocumented parameters. It adds no information about the four parameters (query, content_filter, metadata_filter, num_results), their meanings, formats, or usage. The mention of 'semantically similar' hints at the query parameter's purpose but doesn't clarify semantics, leaving parameters largely unexplained.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Search for') and target resource ('semantically similar documents in the Chroma vector database'), making the purpose immediately understandable. It distinguishes from siblings like 'list_documents' by specifying semantic similarity search rather than simple listing, though it doesn't explicitly contrast with all siblings.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus alternatives like 'list_documents' or 'read_document'. The description implies usage for similarity searches but doesn't specify scenarios, prerequisites, or exclusions, leaving the agent to infer context from the tool name alone.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
update_documentC
Update an existing document in the Chroma vector database
| Name | Required | Description | Default |
|---|---|---|---|
| content | Yes | ||
| metadata | No | ||
| document_id | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool updates a document, implying mutation, but fails to describe critical behaviors such as permission requirements, whether updates are idempotent or reversible, error handling, or what happens to unspecified metadata fields. This leaves significant gaps for an agent to understand the tool's behavior.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It is appropriately sized and front-loaded, making it easy to parse quickly.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the complexity of a mutation tool with 3 parameters, 0% schema coverage, no annotations, and no output schema, the description is incomplete. It lacks details on parameters, behavioral traits, return values, and usage context, making it inadequate for an agent to reliably invoke the tool without additional assumptions.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the schema provides no parameter details. The description mentions 'update an existing document' but adds no meaning beyond the tool name—it doesn't explain what 'content', 'document_id', or 'metadata' represent, their formats, or how they interact. This fails to compensate for the lack of schema documentation.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Update') and resource ('an existing document in the Chroma vector database'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'create_document' or 'read_document' beyond the implied distinction of updating versus creating or reading.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives like 'create_document' or 'delete_document'. It lacks context about prerequisites (e.g., document must exist), exclusions, or specific scenarios where updating is appropriate over other operations.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
6 tool updates
v1.0.0- First observed
create_document - First observed
delete_document - First observed
list_documents - First observed
read_document - First observed
search_similar - First observed
update_document
TDQS
Scored across 6 tools
Each tool has a clearly distinct purpose with no overlap: create, delete, list, read, search, and update documents. The actions and targets are well-defined, making it easy for an agent to select the correct tool without confusion.
All tools follow a consistent verb_noun pattern (e.g., create_document, delete_document) using snake_case throughout. The naming is predictable and readable, with no deviations in style or convention.
With 6 tools, this server is well-scoped for managing documents in a vector database. Each tool earns its place by covering essential CRUD operations and semantic search, avoiding bloat or thinness for the domain.
The toolset provides complete CRUD/lifecycle coverage for documents (create, read, update, delete, list) and includes a semantic search function. There are no obvious gaps, enabling agents to handle all core workflows without dead ends.
Maintenance
Related MCP Connectors
Remote ChromaDB vector database MCP server with streamable HTTP transport
The Needle MCP server enables semantic search on documents stored in files like PDFs, DOCX, and XLSX by connecting AI applications to external data sources. It provides capabilities to create and manage document collections, perform natural language searches on stored content, and retrieve relevant information without requiring exact keyword matches.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
A Model Context Protocol server for Wix AI tools
Related MCP Servers
- AlicenseBqualityDmaintenanceA Model Context Protocol server that enables semantic search capabilities by providing tools to manage Qdrant vector database collections, process and embed documents using various embedding services, and perform semantic searches across vector embeddings.485 npm4MIT
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server integration that creates a persistent, searchable working memory for AI-assisted development by enabling automated context recall and knowledge persistence in Chroma, the open-source embedding database.121 PyPI25MIT
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that enables intelligent document search and retrieval from PDF collections, providing semantic search capabilities powered by OpenAI embeddings and ChromaDB vector storage.13MIT
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol (MCP) server that gives LLMs persistent, semantic memory using vector search with ChromaDB.MIT