MCP Servers

A collection of Model Context Protocol servers, templates, tools and more.

One-command Postgres MCP Server backed by PGlite (WASM)

Created 5/31/2026
Updated about 6 hours ago
Repository documentation and setup instructions

pglite-mcp

One-command Postgres MCP Server backed by PGlite (WASM).

Zero install, zero config — an embedded Postgres database with pgvector that AI agents can query via the Model Context Protocol. Think "SQLite for Postgres, but with MCP built-in."

npx pglite-mcp --extensions vector

3MB. No Docker. No Postgres install. Just a single command.

Why?

Every AI agent eventually needs a database. Vector search, structured data, session state — you name it. But spinning up Postgres is painful: Docker, pgvector extension, auth config, connection strings.

pglite-mcp bundles PGlite (WASM Postgres) + pgvector + MCP server into a single command. Your agent gets a full Postgres database with vector search, instantly.

Quick Start

# Basic — in-memory Postgres
npx pglite-mcp

# With pgvector and persistent storage
npx pglite-mcp --db ./my-data --extensions vector

# With pgvector and pgcrypto
npx pglite-mcp --db ./my-data --extensions vector,pgcrypto

Supported Extensions

| Extension | Description | |-----------|-------------| | vector | pgvector — vector similarity search (exact & ANN, L2/cosine/inner product) | | age | Apache AGE — graph database with OpenCypher support | | postgis | PostGIS — geospatial data types and functions | | pgcrypto | Cryptographic functions (hashing, encryption, UUID generation) | | uuid-ossp | UUID generation (v1, v3, v4, v5) | | pg_trgm | Trigram-based text similarity and fuzzy search | | hstore | Key-value store within a single PostgreSQL value | | citext | Case-insensitive text type | | unaccent | Remove accents from text for search | | ltree | Hierarchical tree-structured data type | | fuzzystrmatch | Fuzzy string matching (Levenshtein, Soundex, Metaphone) | | tablefunc | Table functions (crosstab, etc.) | | btree_gin / btree_gist | GIN/GiST index support for B-tree operators | | earthdistance | Great-circle distance calculations | | intarray | Integer array functions and operators | | isn | International Standard Numbers (ISBN, ISSN, UPC, EAN13) | | cube | Multi-dimensional cube data type | | seg | Line segment / floating point interval data type | | bloom | Bloom filter index access method |

MCP Configuration

Add to your MCP client config:

Claude Desktop (claude_desktop_config.json):

{
  "mcpServers": {
    "pglite": {
      "command": "npx",
      "args": ["-y", "pglite-mcp", "--db", "./pglite-data", "--extensions", "vector"]
    }
  }
}

Cursor (.cursor/mcp.json):

{
  "mcpServers": {
    "pglite": {
      "command": "npx",
      "args": ["-y", "pglite-mcp", "--db", "./pglite-data", "--extensions", "vector"]
    }
  }
}

Hermes Agent:

hermes config set mcp_servers.pglite.command "npx"
hermes config set mcp_servers.pglite.args '["-y", "pglite-mcp", "--db", "./pglite-data", "--extensions", "vector"]'
hermes config set mcp_servers.pglite.enabled true

How It Works

┌─────────────────┐     stdio (MCP)     ┌──────────────┐
│  AI Agent        │ ◄────────────────► │  MCP Server   │
│  (Claude, GPT)   │                    │  (Zed/Anthropic)│
└─────────────────┘                    └──────┬───────┘
                                              │ PG wire protocol
                                              │ (localhost:5432)
                                      ┌──────▼───────┐
                                      │   PGlite     │
                                      │  (WASM PG)   │
                                      │ + pgvector   │
                                      └──────────────┘
  1. PGlite — A 3MB WASM build of PostgreSQL that runs in Node.js
  2. pglite-socket — Exposes PGlite over the Postgres wire protocol on a TCP port
  3. Postgres MCP Server — The standard MCP server for PostgreSQL (read-only queries, schema inspection)
  4. pglite-mcp — Ties them together: starts PGlite → launches MCP server → agent can query

Options

| Flag | Default | Description | |------|---------|-------------| | --db, -d | memory:// | Database directory for persistent storage | | --port, -p | 5432 | PGlite wire-protocol port | | --host | 127.0.0.1 | Bind address | | --extensions, -e | (none) | Comma-separated extensions | | --help | | Show help |

License

MIT

Related

Quick Setup
Installation guide for this server

Install Package (if required)

npx @modelcontextprotocol/server-pglite-mcp

Cursor configuration (mcp.json)

{ "mcpServers": { "alitrack-pglite-mcp": { "command": "npx", "args": [ "alitrack-pglite-mcp" ] } } }