pgembed 0.2.4

{
  "servers": {
    "pgembed": {
      "type": "stdio",
      "command": "dnx",
      "args": ["pgembed@0.2.4", "--yes", "--", "mcp"]
    }
  }
}
                    
This package contains an MCP Server. The server can be used in VS Code by copying the generated JSON to your VS Code workspace's .vscode/mcp.json settings file.
dotnet tool install --global pgembed --version 0.2.4
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local pgembed --version 0.2.4
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=pgembed&version=0.2.4
                    
nuke :add-package pgembed --version 0.2.4
                    

pgembed npm NuGet

Run PostgreSQL on your machine without installing it. pgembed downloads minimal, small sized Postgres binaries for your platform (Windows, macOS, Linux and Alpine, x64 and arm64), keeps named instances of any version running in the background, and runs SQL against them. It is also an MCP server, so an AI assistant can do the same.

Documentation: mysticmind.github.io/pgembed-cli

$ pgembed start app --version 17
● Started app: PostgreSQL 17.11.0 on port 5432
  Host=localhost;Port=5432;Username=postgres;Database=postgres

$ pgembed sql app "SELECT version()"
$ pgembed stop app

Install

With npm (Node.js 18 or newer):

npm install --global pgembed
npx pgembed status                      # or run it without installing

Or as a .NET tool (the .NET 10 SDK or newer):

dotnet tool install --global pgembed
dnx pgembed status                      # or run it without installing

Both install the same native executable, compiled ahead of time, so commands start in a few milliseconds. See Getting Started.

What it does

  • Instances: named servers of any version, started in the background and kept between runs; several versions at once (--version 16,17,18).
  • SQL: against an instance or any PostgreSQL server, with readable results and errors that point at the position. Changes to the schema or existing rows ask first. An interactive prompt with completion, highlighting and psql-style commands.
  • Schema: tables, or one table's columns, keys, indexes and constraints.
  • Format and check: SQL formatting that keeps comments, and a syntax check for CI; neither needs a server.
  • Versions and cache: published versions, extensions, ahead-of-time installs, and a cache shared with MysticMind.PostgresEmbed, so your tests do not download a version again.
  • Tests and CI: one server per test run, or one per version.

MCP server for AI assistants

claude mcp add pgembed -- npx -y pgembed mcp       # Claude Code; or: dnx pgembed mcp, with .NET 10
{ "mcpServers": { "pgembed": { "command": "npx", "args": ["-y", "pgembed", "mcp"] } } }

The assistant gets tools for instances, SQL, schema and query plans. Changes ask you first, servers pgembed did not start are read-only, and passwords stay out of the conversation. See With AI Assistants and the tool reference.

Notes

  • Instances are for development and testing: they listen on localhost and, unless started with --password, trust local connections. See Security.
  • On Linux and macOS, Postgres refuses to run as root; in a container, add a normal user.
  • The binaries come from zonky embedded-postgres-binaries and are verified against the SHA-256 that Maven publishes.

Every command and option: Commands and Configuration.

License

MIT

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated
0.2.4 95 11/15/2026
0.2.3 110 11/9/2026
0.2.2 94 11/9/2026
0.2.1 115 11/8/2026
0.2.0 101 11/8/2026
0.1.0 96 11/6/2026