Problem
Currently, getCollectionName() in context.js generates collection names as code_chunks_<md5-hash> based on the absolute path:
getCollectionName(codebasePath) {
const normalizedPath = path.resolve(codebasePath);
const hash = crypto.createHash('md5').update(normalizedPath).digest('hex');
const prefix = isHybrid ? 'hybrid_code_chunks' : 'code_chunks';
return `${prefix}_${hash.substring(0, 8)}`;
}
This makes it impossible to identify which collection belongs to which project in the Zilliz Cloud console. For example, code_chunks_a1b2c3d4 gives no indication that it's the sda-service project.
Proposed Solution
Allow users to configure a human-readable collection name, falling back to the current hash-based naming. Options:
- Use the folder name by default:
code_chunks_sda_service instead of code_chunks_a1b2c3d4
- Add an env var like
COLLECTION_NAME_STRATEGY=folder|hash (default: folder)
- Add a parameter to
index_codebase tool: collectionName (optional)
Using the folder basename (path.basename(codebasePath)) would make collection management much more intuitive in the Zilliz Cloud console, especially when managing multiple indexed codebases.
Environment
@zilliz/claude-context-mcp via npx
- Zilliz Cloud Serverless (AWS eu-central-1)
- Gemini embeddings
Problem
Currently,
getCollectionName()incontext.jsgenerates collection names ascode_chunks_<md5-hash>based on the absolute path:This makes it impossible to identify which collection belongs to which project in the Zilliz Cloud console. For example,
code_chunks_a1b2c3d4gives no indication that it's thesda-serviceproject.Proposed Solution
Allow users to configure a human-readable collection name, falling back to the current hash-based naming. Options:
code_chunks_sda_serviceinstead ofcode_chunks_a1b2c3d4COLLECTION_NAME_STRATEGY=folder|hash(default:folder)index_codebasetool:collectionName(optional)Using the folder basename (
path.basename(codebasePath)) would make collection management much more intuitive in the Zilliz Cloud console, especially when managing multiple indexed codebases.Environment
@zilliz/claude-context-mcpvia npx