Postgres Mcp

io.github.pgEdgePublished by GitHub account pgEdgev1.0.0Updated Oct 25, 2026

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

VerifiedSTDIODesktop onlyDatabasesKnowledge & Memory

Overview

AI-generated overview

An MCP server that lets an assistant query PostgreSQL databases in SQL or natural language, with schema analysis and hybrid search.

What you can do
Run SQL queries against PostgreSQL databases, read-only by default, and form queries from natural language through a built-in agent. Analyze database schemas and read PostgreSQL statistics and other resources. Run hybrid search combining BM25 and MMR, and generate embeddings. Use guided prompts for semantic search setup, database exploration and query diagnostics. Optionally serve a web chat UI and HTTP/HTTPS API with user and token authentication.
When to use it
Useful for internal developer workflows and trusted environments where an assistant should explore and query PostgreSQL 14 or newer databases, including natural-language querying and semantic search over data.
Requirements
Runs as a local process, distributed as a container image on GitHub Container Registry. Needs a PostgreSQL 14 or higher database and a configured connection (config file, environment variables or command-line flags). Optional HTTP mode needs user and token authentication setup; embedding features need a provider configuration.
Before you install
The server gives LLMs read access to the entire database schema and data, and the README explicitly says it is not for public-facing applications and should only be used where all users are trusted. Read-only enforcement is configurable per database, so it can be relaxed. HTTP mode involves user and API tokens and an encryption secret file that must be protected.

Installation

In SourceWeft

  1. Open Postgres Mcp in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.

Other MCP clients

Follow the launch instructions in the repository.

README

pgEdge Postgres MCP Server and Natural Language Agent

[CI - MCP Server] [CI - CLI Client] [CI - Web Client] [CI - Docker] [CI - Documentation]

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:

ClientTransportBest For
CLI (Stdio)StdioLocal single-user development
CLI (HTTP)HTTPMulti-user or remote access
Web UIHTTPBrowser-based chat interface
Claude CodeStdioAnthropic CLI agent
Claude DesktopStdioAnthropic desktop app
CursorStdioAI code editor
WindsurfStdioCodeium code editor
VS Code CopilotStdioGitHub 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.21 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:

bash
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

bash
git clone https://github.com/pgEdge/pgedge-postgres-mcp.gitcd pgedge-postgres-mcpmake build

Testing

bash
# Run all testsmake test
# Run server tests with a databaseexport TEST_PGEDGE_POSTGRES_CONNECTION_STRING=\  "postgres://localhost/postgres?sslmode=disable"go test ./...
# Run with coveragego test -v -cover ./...
# Run lintingmake lint
Web UI Tests

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

bash
cd webnpm test                # Run all testsnpm run test:watch      # Watch modenpm 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.

Source: README.md at commit d451081

Tools

0
SourceWeft has not started this package in its sandbox yet, so its tools are not known.

Version history

1
  1. v1.0.0LatestSep 16, 2026

Score

50% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 days25 pts

    Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.

  • Auth declared10 pts

    Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.

  • Tools listed15 pts

    Answer tools/list without a credential, or ship a package that starts in a sandbox without one.

  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts