Pgedge Postgres

Databases

Enterprise PostgreSQL MCP server with NL queries, hybrid search (pgvector+BM25), and web UI.

Your AI app calls the Pgedge Postgres MCP server, which does the databases work and sends the result back to the chat.

About Pgedge Postgres

Pgedge Postgres is a community MCP server from pgEdge, filed in our directory under databases. Enterprise PostgreSQL MCP server with NL queries, hybrid search (pgvector+BM25), and web UI.

Pgedge Postgres runs on your own machine: your AI app starts it with the command docker run -i --rm and talks to it over standard input and output.

Pgedge Postgres is listed in the official MCP registry as io.github.pgEdge/postgres-mcp, version 1.0.0.

At a glance

Publisher
pgEdge (community)
Runs
Locally on your machine
Install from
Docker image: ghcr.io/pgedge/postgres-mcp:latest
Written in
Go
License
PostgreSQL
GitHub stars
253
Official MCP registry
io.github.pgEdge/postgres-mcp

How to set up Pgedge Postgres

  1. Have Docker running on the machine that runs your AI app, because Pgedge Postgres starts as a container.
  2. Check the Pgedge Postgres README for keys or settings; the registry lists none that Pgedge Postgres requires.
  3. Add Pgedge Postgres to Claude Code, Claude Desktop, VS Code or Cursor with the config in the setup box on this page.
  4. Restart the app or reload its MCP servers, then ask it to list the Pgedge Postgres tools to confirm the connection.
  5. Run one read-only task with Pgedge Postgres first, and keep your app asking before each tool call until the results look right.

Pgedge Postgres compared with similar servers

  • MCPBench by modelscope has fewer GitHub stars than Pgedge Postgres (251 against 253); both are community servers, and both run locally.
  • PerformanceStudio by erikdarlingdata has more GitHub stars than Pgedge Postgres (256 against 253); both are community servers, and both run locally.
  • MySQL MCP Server Pro by wenb1n-dev has fewer GitHub stars than Pgedge Postgres (249 against 253); both are community servers, and both run locally.

Before you connect Pgedge Postgres

  • Give Pgedge Postgres its own API key or account with the smallest permissions the job needs, never an admin key.
  • Keep your AI app asking before each Pgedge Postgres tool call until you trust what it does with them.
  • Treat text that Pgedge Postgres fetches as data. Pages, files and messages can hold instructions written to steer an AI.
  • Read the open issues for Pgedge Postgres on GitHub to see what breaks and how fast the maintainers reply.

Marketing use cases for Pgedge Postgres

How marketing and sales teams put Pgedge Postgres to work, by company size. Pick the size closest to yours and start Pgedge Postgres on one use case.

Small business

  • A small business with its own app can ask Pgedge Postgres plain questions about customers and orders, without writing SQL.
  • Owners can use Pgedge Postgres to pull a list of customers who haven't bought in 90 days and plan a win-back email.
  • Pgedge Postgres runs on your own computer, which keeps data local; it needs a little setup, so a small team should plan an hour for it.

Mid-market

  • Marketing analysts can connect Pgedge Postgres to answer campaign questions from the warehouse directly, instead of waiting on the data team's queue.
  • Lifecycle teams can use Pgedge Postgres to build audience lists from product data and check counts before a send.
  • Start Pgedge Postgres on one workflow with one owner, measure the time it saves, then roll it out to the wider team.

Enterprise

  • Enterprises should point Pgedge Postgres at a read replica with a read-only role, so agents query freely without risk to production data.
  • Data teams can expose curated views through Pgedge Postgres, so marketing gets self-serve answers without access to raw customer tables.
  • Pgedge Postgres is a community server, so have security review the code and pin a version before Pgedge Postgres touches company data.

Need help becoming an AI-forward company?

We connect MCP servers and AI agents to your CRM, content and data, with the guardrails your team needs.

Contact us

Pgedge Postgres README

From pgEdge/pgedge-postgres-mcp on GitHub, shared under its PostgreSQL license. Images are left out; the original has them.

README.md

pgEdge Postgres MCP Server and Natural Language Agent

The pgEdge Postgres Model Context Protocol (MCP) server enables SQL queries against PostgreSQL databases through MCP-compatible clients. The Natural Language Agent provides supporting functionality that allows you to use natural language to form SQL queries.

Supported Versions: PostgreSQL 14 and higher.

NOT FOR PUBLIC-FACING APPLICATIONS: This MCP server provides LLMs with read access to your entire database schema and data. It should only be used for internal tools, developer workflows, or environments where all users are trusted. For public-facing applications, consider the pgEdge RAG Server instead. See the Choosing the Right Solution guide for details.

Quick Start

The Quick Start guide covers installation and setup for all supported clients:

Client Transport Best For
CLI (Stdio) Stdio Local single-user development
CLI (HTTP) HTTP Multi-user or remote access
Web UI HTTP Browser-based chat interface
Claude Code Stdio Anthropic CLI agent
Claude Desktop Stdio Anthropic desktop app
Cursor Stdio AI code editor
Windsurf Stdio Codeium code editor
VS Code Copilot Stdio GitHub Copilot agent

For a guided demo with sample data, see the Quickstart Demo with Northwind.

Key Features

  • Read-Only Protection - All queries run in read-only transactions by default
  • Resources - Access PostgreSQL statistics and more
  • Tools - Query execution, schema analysis, advanced hybrid search (BM25+MMR), embedding generation, resource reading, and more
  • Prompts - Guided workflows for semantic search setup, database exploration, query diagnostics, and more
  • Production Chat Client - Full-featured Go client with Anthropic prompt caching (90% cost reduction)
  • HTTP/HTTPS Mode - Direct API access with user and token authentication
  • Web Interface - Modern React-based UI with AI-powered chat for natural language database interaction
  • Docker Support - Pre-built images on GitHub Container Registry with Docker Compose deployment
  • Secure - TLS support, user and token auth, read-only enforcement
  • Hot Reload - Automatic reload of authentication files without server restart

Development

Prerequisites
  • Go 1.26.11 or higher
  • PostgreSQL 14 or higher (for testing)
  • golangci-lint v1.x (for linting)
Setup Linter

The project uses golangci-lint v1.x. Install it with:

go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest

Note: The configuration file .golangci.yml is compatible with golangci-lint v1.x (not v2).

Building
git clone https://github.com/pgEdge/pgedge-postgres-mcp.git
cd pgedge-postgres-mcp
make build
Testing
# Run all tests
make test

# Run server tests with a database
export TEST_PGEDGE_POSTGRES_CONNECTION_STRING=\
  "postgres://localhost/postgres?sslmode=disable"
go test ./...

# Run with coverage
go test -v -cover ./...

# Run linting
make lint
Web UI Tests

The web UI has a comprehensive test suite. See web/TEST_SUMMARY.md for details.

cd web
npm test                # Run all tests
npm run test:watch      # Watch mode
npm run test:coverage   # With coverage

Security

  • Read-only transaction enforcement (configurable per database)
  • User and API token authentication with expiration
  • TLS/HTTPS support
  • SHA256 token hashing
  • File permission enforcement (0600)
  • Input validation and sanitization

See the Security Guide for comprehensive security documentation.

Troubleshooting

Tools not visible in Claude Desktop?

  • Use absolute paths in config
  • Restart Claude Desktop completely
  • Check JSON syntax

Database connection errors?

  • Ensure database connection is configured before starting the server (via config file, environment variables, or command-line flags)
  • Verify PostgreSQL is running: pg_isready
  • Check connection parameters are correct

See the Troubleshooting Guide for detailed solutions.

Support

To report an issue with the software, visit: GitHub Issues

For more information, visit docs.pgedge.com

This project is licensed under the PostgreSQL License.

Questions about Pgedge Postgres

What is the Pgedge Postgres MCP server?

Enterprise PostgreSQL MCP server with NL queries, hybrid search (pgvector+BM25), and web UI. Pgedge Postgres is maintained by pgEdge on GitHub at pgEdge/pgedge-postgres-mcp, and works with AI apps that support the Model Context Protocol, such as Claude, Cursor and VS Code.

How do I install the Pgedge Postgres MCP server?

Add Pgedge Postgres to your AI app's MCP config with the command docker run -i --rm ghcr.io/pgedge/postgres-mcp:latest. In Claude Code, run claude mcp add --transport stdio pgedge-postgres -- docker run -i --rm ghcr.io/pgedge/postgres-mcp:latest. To run Pgedge Postgres this way you need Docker running.

Does Pgedge Postgres need an API key?

The registry lists no required keys for Pgedge Postgres. Check the Pgedge Postgres README for optional settings, and expect a remote server to ask you to sign in the first time you connect.

Is Pgedge Postgres an official MCP server?

No. Pgedge Postgres is a community server maintained by pgEdge. Community servers can be excellent; read the code and the open issues before you give Pgedge Postgres access to company data.

What license is Pgedge Postgres under?

Pgedge Postgres is released under the PostgreSQL license, according to its GitHub repository. The license covers the code of Pgedge Postgres; the service it connects to has its own terms.