npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

postgres-pgvector-memory-mcp

v1.0.0

Published

MCP server for semantic memory storage using local Postgres with pgvector

Readme

Postgres Memory MCP Server

[!IMPORTANT] Prerequisites for Use

To ensure efficient operation and connectivity with Postgres, please verify the following:

  1. Rule Configuration: You must add the defined operational rules to your editor or extension's system prompt (e.g., .clinerules). See System Prompts.
  2. MCP Configuration: The mcp.json file must be strictly configured as detailed in the MCP Client Configuration section.
  3. Tool Authorization: For users of Cline, Roo Code, Kilo Code, or similar extensions: You must enable all tool permissions (check all boxes) upon initialization. Failure to approve these tools will prevent the server from authenticating and connecting to the Postgres instance.

An MCP server that provides semantic memory storage using a local PostgreSQL database with the pgvector extension. This enables your AI assistant to store, retrieve, and search memories using vector embeddings.

Features

  • Semantic Search: Uses OpenAI-compatible embeddings (Xenova/all-MiniLM-L6-v2) to find relevant memories.
  • Local Postgres: Runs entirely on your local machine using Docker or a local Postgres instance.
  • Memory Management: Store, list, delete, and inspect memories.
  • Project Isolation: Memories are scoped by project_id.

Prerequisites

  1. Docker Desktop: Ensure Docker is installed and running.
  2. Node.js: Version 18 or higher.

Installation

1. Start Postgres with pgvector

This server is designed to work with the Docker container provided in the following repository, which includes Postgres configured with the pgvector extension: https://github.com/cbuntingde/post-pgvector-docker

You can use the docker-compose.yml from that repository (or create one like below):

services:
  db:
    image: pgvector/pgvector:pg16
    restart: always
    ports:
      - "5432:5432"
    environment:
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: password
      POSTGRES_DB: postgres
    volumes:
      - pgdata:/var/lib/postgresql/data

volumes:
  pgdata:

Run it:

docker-compose up -d

2. Configure the MCP Server

npx postgres-pgvector-memory-mcp setup

This interactive setup will:

  1. Ask for your Postgres Connection String (default: postgresql://postgres:password@localhost:5432/postgres).
  2. Connect to the database.
  3. Automatically apply the database schema (create memories table and vector extension).

3. Add to your MCP Client

Add the following to your mcp.json or MCP settings:

{
  "mcpServers": {
    "postgres-memory": {
      "command": "node",
      "args": [
        "c:/mcpservers/post-pgvector-mcp/dist/index.js"
      ],
      "env": {
        "POSTGRES_URL": "postgresql://postgres:password@localhost:5432/postgres"
      }
    }
  }
}

Tools

  • store_memory: Save a snippet of information with a category.
  • search_memories: Find memories semantically related to a query.
  • list_memories: recent memories for a project.
  • delete_memory: Remove a memory by ID.
  • get_project_stats: Count memories for a project.

Development

  1. Install dependencies:

    npm install
  2. Build:

    npm run build
  3. Run locally:

    npm run dev

License

MIT