talira

pgEdge Postgres MCP Server

A PostgreSQL MCP server with a Natural Language Agent CLI and Web UI

open sourcePostgreSQLself-hostablefreeMCP

pgEdge Postgres MCP Server is an open source MCP server, written in Go, that lets AI agents query PostgreSQL 14 or later, running every query in a read-only transaction by default. Besides SQL, schema, row-count and EXPLAIN tools, its similarity_search tool finds rows by their pgvector embedding columns, then chunks the matched text at query time, re-scores the chunks with BM25 and filters them with Maximal Marginal Relevance to fit a token budget, so documents needn't be pre-chunked. It runs over stdio for Claude Code, Claude Desktop, Cursor and VS Code, or over HTTP with user and token authentication, and comes with a Go chat client and a web UI that turn plain-English questions into SQL. pgEdge warns it is for trusted internal users only, since the LLM can read the whole schema and data, and releases it under the PostgreSQL licence.

Problems it solves

  • let Claude query our Postgres database with no chance of it writing or deleting data
  • an MCP server over our pgvector knowledge base that combines vector and keyword search
  • give my coding agent our database schema so it writes SQL against the real tables
  • ask questions about our Postgres data in plain English from a chat UI the whole team can use
  • semantic search over a table with embedding columns from an AI agent, without chunking the documents first
  • a Postgres MCP server over HTTP with user and token authentication for several people
  • let an agent run EXPLAIN ANALYZE to find out why a query is slow
  • one MCP server for several Postgres databases that the agent can switch between
  • create embeddings with OpenAI, Voyage, Gemini or a local Ollama model from an agent tool
  • a self-hosted Postgres MCP server we can run in Docker inside our own network

Features

  • queries run in read-only transactions by default, configurable per database
  • similarity_search: vector search over pgvector columns, chunks re-scored with BM25 and diversified with MMR within a token budget
  • query_database, get_schema_info, count_rows and execute_explain tools
  • generate_embedding with OpenAI, Voyage AI, Google Gemini or Ollama
  • search_knowledgebase over a pre-built documentation database (kb.db)
  • several database connections, selectable by the agent
  • stdio and HTTP/HTTPS transports, with user and API token authentication and TLS
  • Go chat client (CLI) and React web UI for natural-language questions
  • individual tools can be turned off in the server configuration
  • binaries for Linux, macOS and Windows, APT and DNF packages, and a Docker image

Limitations

  • Isn't for public-facing apps: it gives the LLM read access to the whole database schema and data, so use it only for trusted internal users12
  • Doesn't support PostgreSQL 13 or older: it needs PostgreSQL 14 or later1

Capabilities

Has an APIplan not known
Has a command line toolplan not known
Has an MCP serverplan not known

Alternatives

The same job

These do what pgEdge Postgres MCP Server does.

  1. Postgres MCP Pro A Postgres MCP server with index tuning, explain plans, health checks, and safe SQL execution
  2. MCP Toolbox for Databases An open source MCP server for databases

Compare pgEdge Postgres MCP Server with the top 3