Pgvector MCP Server

Similarity search, hybrid search, and index management for pgvector-backed PostgreSQL tables

Local serverstdioPython

What is the Pgvector MCP Server?

Similarity search, hybrid search, and index management for pgvector-backed PostgreSQL tables

The short version

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.

More MCP options

Compare MCP servers by category, or browse hosted MCP servers if you prefer an endpoint over a local process.

Maintainer setup documentation.

Recorded tools

Check the linked publisher documentation and your connected client's tool list. Names and availability can vary with the server version and account permissions.

ToolWhat it does
list_vector_tablesDiscover every vector column in the database, with its dimensionality
describe_vector_tableColumns, indexes, and approximate row count for a table
similarity_searchk-NN search over a vector column (cosine / L2 / inner product), with structured metadata filters
hybrid_searchWeighted blend of vector similarity and Postgres full-text search (ts_rank_cd)
upsert_embeddingInsert or update a row's embedding + metadata
create_vector_indexCreate an HNSW or IVFFlat index with tunable parameters
explain_similarity_queryEXPLAIN ANALYZE a similarity query to confirm the ANN index is used

How to install the Pgvector MCP Server

{
  "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.

Configuration

VariableDescriptionRequired
DATABASE_URLEndpoint or connection string the server talks to.Yes
MCP_PGVECTOR_READ_ONLYConfiguration value read at startup.Optional
MCP_PGVECTOR_COMMAND_TIMEOUT_SECONDSConfiguration value read at startup.Optional
PGVECTOR_DATABASE_URLEndpoint or connection string the server talks to.Yes

Example prompts to try

  • “Use Pgvector to list vector tables.”
  • “Use Pgvector to describe vector table.”
  • “Use Pgvector to similarity search.”

Frequently asked questions

Similarity search, hybrid search, and index management for pgvector-backed PostgreSQL tables Confirm the tools offered by your installed version in the connected client. Tool availability and permissions depend on the server and account configuration.