Skip to content

Conversation

lprhodes
Copy link

Summary

This PR adds support for unnamed vectors in Qdrant collections, allowing the MCP server to work with existing Qdrant databases that use the default vector field instead of named vector fields.

Problem

When using Qdrant collections created with unnamed vectors (common when using embeddings like Google Gemini), the MCP server would fail with the error:

Vector with name fast-all-minilm-l6-v2 is not configured in this collection

Solution

  • Added a new USE_UNNAMED_VECTORS environment variable that enables unnamed vector support
  • Created an UnnamedVectorProvider wrapper class that signals to use unnamed vectors
  • Modified QdrantConnector to handle both named and unnamed vector operations
  • Updated documentation with examples and configuration instructions

Usage

To use with unnamed vectors, simply set the environment variable:

QDRANT_URL="http://localhost:6333" \
COLLECTION_NAME="my-collection" \
EMBEDDING_MODEL="sentence-transformers/all-MiniLM-L6-v2" \
USE_UNNAMED_VECTORS="true" \
uvx mcp-server-qdrant

Testing

The changes maintain backward compatibility - existing users with named vectors will see no change. Only users who explicitly enable USE_UNNAMED_VECTORS=true will use the new functionality.

Related Issues

This addresses user feedback about incompatibility with existing Qdrant collections that use unnamed vectors.

🤖 Generated with Claude Code

lprhodes and others added 5 commits July 31, 2025 13:08
- Add USE_UNNAMED_VECTORS environment variable to enable unnamed vector support
- Create UnnamedVectorProvider wrapper class for embedding providers
- Modify QdrantConnector to handle both named and unnamed vector operations
- Update README with documentation and examples for unnamed vectors
- Support existing Qdrant collections that use default vector fields

This allows the MCP server to work with Qdrant databases that were created
without specifying vector names, which is common when using embeddings
like Google Gemini directly.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
…compatibility

- Add model_config = {'extra': 'ignore'} to all BaseSettings classes
- This ensures environment variables are properly loaded without validation errors
- Add test script to verify unnamed vectors functionality

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add __main__.py entry point for module execution
- This allows the module to be run with 'python -m mcp_server_qdrant'
- Fixes 'No module named mcp_server_qdrant.__main__' error

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Support both 'text' and 'document' fields for content
- Use entire payload as metadata if 'metadata' field is not present
- Store content in both 'text' and 'document' fields for compatibility
- Fixes KeyError when searching collections created by other applications

This ensures compatibility with various Qdrant collection schemas,
especially those created by applications like Diolog that use 'text'
instead of 'document' for content storage.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add COLLECTION_NAMES environment variable for comma-separated list of collections
- Update QdrantSettings to parse multiple collection names
- Modify tool registration to require collection_name parameter when multiple collections are configured
- Update tool descriptions to list available collections
- Add documentation for multiple collections usage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant