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

@node2flow/postgrest-mcp

v1.0.0

Published

MCP server for PostgREST — 10 tools for CRUD operations, filtering, resource embedding, and RPC on PostgreSQL databases via REST API

Downloads

19

Readme

@node2flow/postgrest-mcp

MCP server for PostgREST — 10 tools for CRUD operations, filtering, resource embedding, and RPC on PostgreSQL databases via REST API.

PostgREST is a standalone web server that turns your PostgreSQL database directly into a RESTful API. This MCP server lets AI assistants interact with any PostgREST instance.

Features

  • 10 MCP Tools — Schema discovery, CRUD, filtering, resource embedding, RPC
  • PostgREST Filter Syntax — Full support for eq, gt, like, in, is, fts, or, and, not
  • Resource Embedding — JOIN related tables via select syntax
  • Multiple Transports — stdio (Claude Desktop/Cursor), Streamable HTTP, Cloudflare Worker
  • JWT Authentication — Optional Bearer token for protected databases

Tools

| # | Tool | Description | Read-Only | |---|------|-------------|-----------| | 1 | pg_get_schema | Get OpenAPI schema — lists tables, views, functions | Yes | | 2 | pg_describe_table | Get column details for a table/view | Yes | | 3 | pg_list_records | Query records with filters, select, order, pagination | Yes | | 4 | pg_count_records | Count records (exact, planned, or estimated) | Yes | | 5 | pg_call_function | Call PostgreSQL functions via RPC | No | | 6 | pg_insert_records | Insert one or more records | No | | 7 | pg_update_records | Update records matching a filter | No | | 8 | pg_upsert_records | Upsert (insert or update on conflict) | No | | 9 | pg_delete_records | Delete records matching a filter | No | | 10 | pg_replace_record | Full replace (PUT) a single record | No |

Quick Start

Claude Desktop / Cursor (stdio)

{
  "mcpServers": {
    "postgrest": {
      "command": "npx",
      "args": ["-y", "@node2flow/postgrest-mcp"],
      "env": {
        "POSTGREST_URL": "http://localhost:3000",
        "POSTGREST_TOKEN": "your-jwt-token"
      }
    }
  }
}

HTTP Mode

POSTGREST_URL=http://localhost:3000 POSTGREST_TOKEN=your-jwt npx @node2flow/postgrest-mcp --http

Cloudflare Worker

https://postgrest-mcp-community.node2flow.net/mcp?POSTGREST_URL=http://your-server:3000&POSTGREST_TOKEN=your-jwt

Configuration

| Parameter | Required | Description | |-----------|----------|-------------| | POSTGREST_URL | Yes | PostgREST server URL (e.g. http://localhost:3000) | | POSTGREST_TOKEN | No | JWT token for authenticated requests |

Note: If your PostgREST server has an anonymous role configured (db-anon-role), schema and read operations work without a token.

Filter Syntax

PostgREST uses a powerful filter syntax on query parameters:

# Comparison
age=gt.18                    # greater than
status=eq.active             # equals
price=lte.100               # less than or equal

# Pattern matching
name=ilike.*john*            # case-insensitive LIKE
email=like.*@gmail.com       # case-sensitive LIKE

# Lists and NULL
id=in.(1,2,3)               # IN list
deleted_at=is.null           # NULL check

# Logic
or=(age.lt.18,age.gt.65)    # OR conditions
not.status=eq.inactive       # NOT

# Full-text search
content=fts.postgresql       # full-text search

# Array/JSONB
tags=cs.{tech,api}           # array contains

Resource Embedding (JOINs)

Query related tables using the select parameter:

# Embed related table
select=*,orders(*)

# Specific columns from related table
select=id,name,orders(id,total,status)

# Renamed embed
select=id,author:user_id(name,email)

# Filter on embedded resource
filter: orders.status=eq.completed
select: id,name,orders(*)

Examples

Explore database structure

Tool: pg_get_schema
→ Returns all tables, views, and functions

Query with filters

Tool: pg_list_records
  table: "users"
  select: "id,name,email,orders(id,total)"
  filter: "status=eq.active&created_at=gt.2024-01-01"
  order: "created_at.desc"
  limit: 20

Insert records

Tool: pg_insert_records
  table: "users"
  records: {"name": "Alice", "email": "[email protected]"}
  return: "representation"

Update with filter

Tool: pg_update_records
  table: "users"
  filter: "id=eq.1"
  data: {"name": "Alice Updated"}
  return: "representation"

Call a function

Tool: pg_call_function
  function_name: "get_user_stats"
  params: {"user_id": 1}
  method: "GET"

What is PostgREST?

PostgREST is a standalone web server that:

  • Automatically turns PostgreSQL tables into CRUD endpoints
  • Turns views into read-only endpoints
  • Turns functions into RPC endpoints
  • Uses PostgreSQL's Row Level Security (RLS) for authorization
  • Generates an OpenAPI specification automatically

License

MIT