Postgres MCP logo

Postgres MCP

Connects MCP-compatible clients to PostgreSQL for read-only SQL, schema analysis, hybrid search, and natural-language database workflows.

Install Postgres MCP

Pick your client, then add it in one click or paste the config.

No confirmed install command yet

We only publish a config when the install details come from the project itself — its README, its docs, or a verified owner. We haven’t found those for postgres-mcp, and we’d rather show nothing than a guess you’d paste into your client.

Open setup steps on GitHub

Overview

The postgres-mcp MCP server connects MCP-compatible clients to PostgreSQL 14 or later and lets agents work with database data through SQL and natural-language requests. It provides tools for query execution, schema analysis, resource reading, embedding generation, and hybrid search using BM25 and vector methods. Deployments can use stdio for local clients or HTTP/HTTPS for remote and multi-user access, with optional authentication and a web interface. Reach for it in trusted internal developer workflows, not public-facing applications, because connected models can read the database schema and data.

Use cases

  • Query PostgreSQL data with natural-language requests
  • Explore database schemas through an MCP client
  • Build internal hybrid-search workflows
  • Serve read-only database chat over HTTP
  • Test agent database workflows with the Northwind demo

Key features

  • Read-only PostgreSQL transactions by default
  • Natural-language SQL generation
  • Schema analysis and resource reading
  • BM25 and vector hybrid search
  • Embedding generation
  • Stdio and HTTP/HTTPS deployment

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked 1d ago

Recent health check succeeded.

5/5 checks healthy over the last 34d

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars239Stargazers on the source repository.
Last commit10d agoMost recent push to the default branch.

How Postgres MCP works

What postgres-mcp does

The postgres-mcp MCP server gives MCP-compatible clients access to PostgreSQL databases through a set of database-oriented tools. It supports PostgreSQL 14 and newer, and its natural-language agent helps turn user requests into SQL queries. The server is intended for internal tools, development workflows, and other environments where database users are trusted.

Queries run in read-only transactions by default. The server can expose PostgreSQL statistics and other resources, while prompts provide guided workflows for database exploration, query diagnostics, and semantic-search setup.

A React-based web interface is included for browser-based chat, and a Go chat client is available for deployments that need a fuller command-line experience. The project also provides Docker images and Docker Compose deployment support.

How it works

An MCP client connects to the server over stdio or HTTP/HTTPS. Stdio is used for local integrations such as desktop applications and code editors; HTTP supports remote or multi-user access and can use user and token authentication. The server sends database-related tools, resources, and prompts to the connected client, which allows an agent to inspect the schema, formulate SQL, and return results through the client interface.

The postgres-mcp MCP server includes advanced search support combining BM25 with vector-based methods, including maximum marginal relevance. Embedding generation is available as a tool, and provider embeddings can be included through configuration. Multiple databases can also be configured for the agent, according to the project documentation.

Setup and configuration

The repository documents installation from source and Docker-based deployment. Building from source requires Go 1.21 or newer; PostgreSQL 14 or newer is used for testing. A quick-start path is provided for supported client configurations, and a Northwind demo shows the server with sample data.

Configuration can be supplied through configuration files or environment variables. The documentation covers embedding providers, multiple databases, feature switches, supporting HTTP services, systemd, nginx, authentication, OAuth, API tokens, and an encryption secret file. HTTP deployments can use TLS/HTTPS. Authentication files support hot reload, so changes do not necessarily require a server restart.

Client-specific setup documentation is included for Claude Desktop and Cursor. The quick-start table also lists Claude Code, Windsurf, and VS Code Copilot configurations.

Tools and capabilities

The postgres-mcp MCP server includes capabilities for:

  • Executing SQL queries against PostgreSQL.
  • Inspecting and analyzing database schemas.
  • Reading PostgreSQL resources and statistics.
  • Running hybrid search with BM25 and vector techniques.
  • Generating embeddings for search workflows.
  • Using prompts for database exploration, diagnostics, and search setup.
  • Serving natural-language database interactions through the web UI or chat client.

Security-related behavior includes token authentication, token expiration, SHA-256 token hashing, TLS support, input validation, sanitization, and permission checks for sensitive files.

Limitations and notes

This server is not intended for public-facing applications. Its connected language models can read the complete database schema and data, so it should be limited to trusted users and controlled environments. The README recommends a separate pgEdge RAG Server for public-facing use cases.

The default read-only behavior reduces the risk of unintended changes, but operators still need to configure access appropriately and review the security guidance. PostgreSQL 14 or later is required, and the available client experience depends on whether the deployment uses stdio, HTTP, or the included web interface.

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Postgres MCP

postgres-mcp is an MCP server that connects MCP-compatible clients to PostgreSQL 14+ databases and exposes SQL querying, schema analysis, hybrid search, embedding generation, resource reading, and prompts for guided database workflows. It also supports natural-language requests that an agent turns into SQL.

Install it from source or deploy it with Docker. Source builds require Go 1.21 or newer, and the repository provides quick-start instructions, Docker Compose deployment guidance, client configuration examples, and a Northwind demo.

Yes, postgres-mcp includes configuration guidance for Cursor over stdio.

Yes, the documentation includes configuration for using the agent with multiple databases. Database connections and related options are defined through the server configuration system.

No, the project explicitly advises against public-facing use. Connected language models can read the entire database schema and data, so the server is intended for internal tools, developer workflows, and trusted-user environments.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewPostgres MCP AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/postgres-mcp-2?style=directory)](https://allmcps.com/mcp/postgres-mcp-2)
HTML Embed
<a href="https://allmcps.com/mcp/postgres-mcp-2"><img src="https://allmcps.com/api/badge/postgres-mcp-2?style=directory" alt="Postgres MCP on AllMCPs" /></a>