feat: make collection_name parameter optional in MCP tools#89
Open
wggcch wants to merge 1 commit intoqdrant:masterfrom
Open
feat: make collection_name parameter optional in MCP tools#89wggcch wants to merge 1 commit intoqdrant:masterfrom
wggcch wants to merge 1 commit intoqdrant:masterfrom
Conversation
Allow collection_name to be optional in both qdrant-store and qdrant-find tools, enabling multi-collection usage while maintaining backward compatibility. - Make collection_name optional with None default in tool functions - Use configured default collection when collection_name is None - Allow explicit collection override when collection_name is provided - Remove make_partial_function calls that hid collection parameter - Add comprehensive tests covering all usage scenarios - Update README.md to reflect optional parameter behavior This completes the multi-collection support originally added in qdrant#26 by making the collection parameter always visible and optional rather than hidden when a default collection is configured. Fixes the limitation where users with COLLECTION_NAME set could not access multiple collections with the same embedding configuration.
mahmoudimus
pushed a commit
to mahmoudimus/mcp-server-qdrant
that referenced
this pull request
Nov 17, 2025
This commit consolidates changes from PRs qdrant#92, qdrant#75, qdrant#77, qdrant#90, qdrant#20, qdrant#89, qdrant#78, qdrant#76, and qdrant#68: Infrastructure & Configuration (PR qdrant#75, qdrant#77): - Upgrade Dockerfile to Python 3.13-slim - Use UV 0.8.3 from official image - Add FASTMCP_HOST="0.0.0.0" for container networking - Add SettingsConfigDict for proper None value parsing New Embedding Providers (PR qdrant#76, qdrant#92): - Add Model2Vec support for fast, lightweight embeddings - Add OpenAI-compatible API support (oai_compat) - New settings: OAI_COMPAT_ENDPOINT, OAI_COMPAT_API_KEY, OAI_COMPAT_VEC_SIZE Unnamed Vectors & Multiple Collections (PR qdrant#78): - Add support for Qdrant unnamed vectors - Create UnnamedVectorProvider wrapper - Add USE_UNNAMED_VECTORS and COLLECTION_NAMES settings - Update qdrant.py to handle both named and unnamed vectors - Add __main__.py for python -m execution Hybrid Search (PR qdrant#90): - Implement hybrid search combining dense and sparse vectors - Add find_hybrid() method with RRF and DBSF fusion methods - New tool: qdrant-hybrid-find - Add SPARSE_EMBEDDING_MODEL setting - Support configurable limits for dense, sparse, and final results Optional Collection Names (PR qdrant#89): - Make collection_name parameter optional in store() and find() - Use default collection when not specified - Simplify tool usage with fallback to COLLECTION_NAME env var Additional Tools (PR qdrant#68): - Add qdrant-get-point: Retrieve point by ID - Add qdrant-delete-point: Delete point by ID - Add qdrant-update-point-payload: Update point metadata - Add qdrant-get-collections: List all collections - Add qdrant-get-collection-details: Get collection info - Implement corresponding methods in QdrantConnector Documentation: - Update README with all new features - Document new embedding providers - Add examples for unnamed vectors and multiple collections - Update environment variables table - Document hybrid search functionality - Expand tools documentation Dependencies: - Add model2vec==0.6.0 - Add openai>=1.109.1
This was referenced Nov 17, 2025
Closed
mahmoudimus
added a commit
to mahmoudimus/mcp-server-qdrant
that referenced
this pull request
Nov 17, 2025
This commit consolidates changes from PRs qdrant#92, qdrant#75, qdrant#77, qdrant#90, qdrant#20, qdrant#89, qdrant#78, qdrant#76, and qdrant#68: Infrastructure & Configuration (PR qdrant#75, qdrant#77): - Upgrade Dockerfile to Python 3.13-slim - Use UV 0.8.3 from official image - Add FASTMCP_HOST="0.0.0.0" for container networking - Add SettingsConfigDict for proper None value parsing New Embedding Providers (PR qdrant#76, qdrant#92): - Add Model2Vec support for fast, lightweight embeddings - Add OpenAI-compatible API support (oai_compat) - New settings: OAI_COMPAT_ENDPOINT, OAI_COMPAT_API_KEY, OAI_COMPAT_VEC_SIZE Unnamed Vectors & Multiple Collections (PR qdrant#78): - Add support for Qdrant unnamed vectors - Create UnnamedVectorProvider wrapper - Add USE_UNNAMED_VECTORS and COLLECTION_NAMES settings - Update qdrant.py to handle both named and unnamed vectors - Add __main__.py for python -m execution Hybrid Search (PR qdrant#90): - Implement hybrid search combining dense and sparse vectors - Add find_hybrid() method with RRF and DBSF fusion methods - New tool: qdrant-hybrid-find - Add SPARSE_EMBEDDING_MODEL setting - Support configurable limits for dense, sparse, and final results Optional Collection Names (PR qdrant#89): - Make collection_name parameter optional in store() and find() - Use default collection when not specified - Simplify tool usage with fallback to COLLECTION_NAME env var Additional Tools (PR qdrant#68): - Add qdrant-get-point: Retrieve point by ID - Add qdrant-delete-point: Delete point by ID - Add qdrant-update-point-payload: Update point metadata - Add qdrant-get-collections: List all collections - Add qdrant-get-collection-details: Get collection info - Implement corresponding methods in QdrantConnector Documentation: - Update README with all new features - Document new embedding providers - Add examples for unnamed vectors and multiple collections - Update environment variables table - Document hybrid search functionality - Expand tools documentation Dependencies: - Add model2vec==0.6.0 - Add openai>=1.109.1 Co-authored-by: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Makes the
collection_nameparameter optional in bothqdrant-storeandqdrant-findMCP tools, enabling true multi-collection usage while maintaining full backward compatibility.Problem
Previously, when
COLLECTION_NAMEenvironment variable was configured, thecollection_nameparameter was completely hidden from the MCP tools viamake_partial_functioncalls. This created a limitation where users with a default collection configured could not access multiple collections with the same embedding configuration.Related Issues & Context
Previous Implementation (PR #21 - closed): An alternative multi-collection approach was proposed but closed in favor of the current architecture in PR #26. Our implementation builds on the accepted foundation.
Solution
Changes Made
Made
collection_nameoptional in both tool function signatures:str | Nonewith defaultNoneImplemented intelligent defaulting:
collection_nameisNone→ use configured default collectioncollection_nameis provided → use the specified collectioneffective_collection = collection_name or self.qdrant_settings.collection_nameRemoved parameter hiding:
make_partial_functioncalls that hid the collection parameterUpdated documentation:
Comprehensive Testing
Added 10 thorough test cases covering:
Backward Compatibility
✅ Fully backward compatible:
collection_nameget the same behaviorBenefits
For Users With Default Collection Configured
collection_nameisNone) OR override with any custom collectionFor Users Without Default Collection
Multi-Collection Scenarios
Now supports the originally requested use case:
Testing
All 34 tests pass including:
Implementation Details
Technical Changes
storeandfindfunctions inmcp_server.pyMCP Best Practices
This implementation follows MCP guidelines:
Impact
This change completes the multi-collection support that was partially implemented in PR #26, making it fully usable for real-world multi-collection scenarios while maintaining the convenience of default collections.
Closes the gap between "multi-collection support exists" and "multi-collection support is actually accessible to users."