Skip to main content
Any Framework

Run PostgreSQL locally without installing it: named instances of any version in the background, SQL with readable results and errors, schema inspection, SQL formatting, and an MCP server for AI assistants. Built on MysticMind.PostgresEmbed.

Published
Nov 9, 2026
14d ago
Total Downloads
502
502

Install

dotnet add package pgembed.osx-arm64 --version 0.2.2

No framework information available.

README

pgembed 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

Needs the .NET 10 SDK or newer.

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

Each platform gets a 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 -- dnx pgembed mcp          # Claude Code, on .NET 10 or newer
{ "mcpServers": { "pgembed": { "command": "dnx", "args": ["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

Changes from Previous Version

No structural changes between v0.2.1 and v0.2.2.

Adoption Assessment

Assess this package against its supported frameworks, license, maintenance signals and dependency graph before making it a project standard.

No target framework metadata is available. Confirm compatibility in a representative project before standardising on this package.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.