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

mcp-postgres-rw

v1.0.2

Published

MCP server for PostgreSQL with both read and write support (INSERT, UPDATE, DELETE, DDL). Unlike the official server-postgres, this one allows write operations.

Readme

mcp-postgres-rw

EN | RU

npm version npm downloads license node

A Model Context Protocol (MCP) server for PostgreSQL with full read and write support.

Why this package? The official @modelcontextprotocol/server-postgres only allows SELECT queries. mcp-postgres-rw adds an execute tool so your AI assistant can also run INSERT, UPDATE, DELETE, and DDL statements.

Tools

| Tool | Description | |------|-------------| | query | Run a read-only SQL query (SELECT) — wrapped in a read-only transaction | | execute | Execute a write SQL statement (INSERT, UPDATE, DELETE, CREATE, DROP, …) |

Installation

Claude Code (CLI)

claude mcp add --transport stdio -- postgres npx -y mcp-postgres-rw postgresql://user:password@host:5432/dbname

Restart Claude Code — query and execute tools will be available.

Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

{
  "mcpServers": {
    "postgres": {
      "command": "npx",
      "args": ["-y", "mcp-postgres-rw", "postgresql://user:password@host:5432/dbname"]
    }
  }
}

Cursor / Windsurf / other MCP clients

Add to your MCP config file:

{
  "mcpServers": {
    "postgres": {
      "command": "npx",
      "args": ["-y", "mcp-postgres-rw", "postgresql://user:password@host:5432/dbname"]
    }
  }
}

Usage example

Once connected, you can ask your AI assistant things like:

  • "Show me all users registered in the last 7 days" → uses query
  • "Insert a new product with name 'Widget' and price 9.99" → uses execute
  • "Delete orders older than 2023" → uses execute

Security note

The execute tool runs statements directly against your database with the permissions of the provided connection string. Use a dedicated database user with only the privileges your workflow requires.

Requirements

  • Node.js 18+
  • PostgreSQL

RU

npm version npm downloads license

MCP-сервер для PostgreSQL с поддержкой чтения и записи.

Зачем этот пакет? Официальный @modelcontextprotocol/server-postgres разрешает только SELECT-запросы. mcp-postgres-rw добавляет инструмент execute, чтобы ИИ-ассистент мог также выполнять INSERT, UPDATE, DELETE и DDL-команды.

Инструменты

| Инструмент | Описание | |------------|----------| | query | Выполнить SQL-запрос на чтение (SELECT) — в read-only транзакции | | execute | Выполнить SQL-запрос на запись (INSERT, UPDATE, DELETE, CREATE, DROP, …) |

Установка

Claude Code (CLI)

claude mcp add --transport stdio -- postgres npx -y mcp-postgres-rw postgresql://user:password@host:5432/dbname

Перезапустить Claude Code — будут доступны инструменты query и execute.

Claude Desktop

Добавить в ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) или %APPDATA%\Claude\claude_desktop_config.json (Windows):

{
  "mcpServers": {
    "postgres": {
      "command": "npx",
      "args": ["-y", "mcp-postgres-rw", "postgresql://user:password@host:5432/dbname"]
    }
  }
}

Cursor / Windsurf / другие MCP-клиенты

{
  "mcpServers": {
    "postgres": {
      "command": "npx",
      "args": ["-y", "mcp-postgres-rw", "postgresql://user:password@host:5432/dbname"]
    }
  }
}

Пример использования

После подключения можно попросить ИИ-ассистента:

  • «Покажи всех пользователей, зарегистрированных за последние 7 дней» → использует query
  • «Добавь новый товар с названием Widget и ценой 9.99» → использует execute
  • «Удали заказы старше 2023 года» → использует execute

Безопасность

Инструмент execute выполняет запросы напрямую с правами переданной строки подключения. Используйте отдельного пользователя БД с минимально необходимыми привилегиями.

Требования

  • Node.js 18+
  • PostgreSQL