Hi team!
I discovered a reproducible bug in PGVectorRetriever that prevents using
the pgvector backend in vector-mcp.
Error
When calling create_collection (or any tool using pgvector),
the server crashes with:
AttributeError: 'list' object has no attribute 'items'
Stack trace ends in:
sentence_transformers/models/Transformer.forward
trans_features = {key: value for key, value in features.items()}
AttributeError: 'list' object has no attribute 'items'
Root cause
In vector_mcp/retriever/pgvector_retriever.py, inside __init__:
self.embed_dim = len(
self.embedding_function(["The quick brown fox jumps over the lazy dog."])[0]
)
Here self.embedding_function is a SentenceTransformer instance.
The forward pass expects a dict of features, not a list.
Because of this, initialization of PGVectorRetriever fails.