Similarity search, hybrid search, and index management for pgvector-backed PostgreSQL tables
Similarity search, hybrid search, and index management for pgvector-backed PostgreSQL tables. That is what the pgvector mcp server brings to an AI assistant: the same capability, reachable through the Model Context Protocol rather than a separate app or dashboard.
Generic Postgres MCP servers expose raw SQL or schema introspection; this one speaks pgvector specifically — nearest-neighbor search, distance metrics, and ANN index tuning are first-class tools, not something the model has to hand-write SQL for.
The server publishes 7 tools. What each one is for:
list_vector_tables — Discover every vector column in the database, with its dimensionalitydescribe_vector_table — Columns, indexes, and approximate row count for a tablesimilarity_search — k-NN search over a vector column (cosine / L2 / inner product), with structured metadata filtershybrid_search — Weighted blend of vector similarity and Postgres full-text search (ts_rank_cd)upsert_embedding — Insert or update a row's embedding + metadatacreate_vector_index — Create an HNSW or IVFFlat index with tunable parametersexplain_similarity_query — EXPLAIN ANALYZE a similarity query to confirm the ANN index is usedmcp-server-pgvector on PyPI is all you need. Most clients run it directly, so configuration is a few lines and a restart.
Configuration is passed through the environment: DATABASE_URL, MCP_PGVECTOR_READ_ONLY, MCP_PGVECTOR_COMMAND_TIMEOUT_SECONDS, PGVECTOR_DATABASE_URL. Treat anything key-shaped as a real credential — scope it to the minimum the server needs, and rotate it if it ever lands in a shared config.
This sits in the database access group, where several servers overlap in what they claim to do but differ sharply once you actually set them up. Pgvector's toolset — list_vector_tables, describe_vector_table, similarity_search and 4 more — is a fair guide to whether it matches your workflow. It is maintained by mittalpk; worth a glance at recent repository activity before you build anything load-bearing on it.
We check each listing at SyncDev against the project's documentation before it goes live — if something here drifts out of date, it is a bug worth reporting.
| Tool | What it does |
|---|---|
| list_vector_tables | Discover every vector column in the database, with its dimensionality |
| describe_vector_table | Columns, indexes, and approximate row count for a table |
| similarity_search | k-NN search over a vector column (cosine / L2 / inner product), with structured metadata filters |
| hybrid_search | Weighted blend of vector similarity and Postgres full-text search (ts_rank_cd) |
| upsert_embedding | Insert or update a row's embedding + metadata |
| create_vector_index | Create an HNSW or IVFFlat index with tunable parameters |
| explain_similarity_query | EXPLAIN ANALYZE a similarity query to confirm the ANN index is used |
{
"mcpServers": {
"pgvector": {
"command": "uvx",
"args": ["mcp-server-pgvector"],
"env": {
"DATABASE_URL": "postgresql://user:password@localhost:5432/mydb",
"MCP_PGVECTOR_READ_ONLY": "false",
"MCP_PGVECTOR_COMMAND_TIMEOUT_SECONDS": "30"
}
}
}
}Configuration as documented by the project. Restart the client after saving.
| Variable | Description | Required |
|---|---|---|
| DATABASE_URL | Endpoint or connection string the server talks to. | Yes |
| MCP_PGVECTOR_READ_ONLY | Configuration value read at startup. | Optional |
| MCP_PGVECTOR_COMMAND_TIMEOUT_SECONDS | Configuration value read at startup. | Optional |
| PGVECTOR_DATABASE_URL | Endpoint or connection string the server talks to. | Yes |
Read-only SQL access to Postgres — let your assistant inspect schemas and answer questions from real data.
Manage your whole Supabase project in conversation — database, auth, storage, Edge Functions and branches.
Query, modify and analyse local SQLite databases in conversation — the fastest way to chat with a data file.
Metabase ships its own MCP endpoint — search your BI content, build and run queries, and save questions and dashboards without leaving the chat.
Official MongoDB server covering data, schemas and Atlas management — from find queries to spinning up clusters.
Serverless Postgres with database branching — point your assistant at Neon and let it work on disposable copies.