Skip to content
Skillpedia
● Free and open sourceπŸ’» LocalπŸ”“ No API keyData and databases

pgEdge Postgres MCP Server

Lets your AI agent query PostgreSQL in read-only mode, explore schemas and ask questions in plain language.

245 stars on GitHubby pgEdgeLicense PostgreSQLUpdated 19 days ago

How to install

This MCP is local: it runs on your computer.

It works in apps installed on your PC (Claude Desktop, Claude Code, Cursor, VS Code…). Choose your app:

Paste in the terminal:

claude mcp add postgres -- docker run -i --rm ghcr.io/pgedge/postgres-mcp:latest

Ready! Now test it

Restart the app and paste one of these requests in the chat:

Which customers placed the most orders last month?
Describe the tables in my database and how they relate.

What it is

The pgEdge Postgres MCP Server lets MCP clients run SQL queries against PostgreSQL databases and includes a Natural Language Agent that turns plain questions into queries. It runs queries in read-only transactions by default and comes with a command-line chat client and a web interface.

What it can do

  • Query execution (read-only by default)
  • Schema analysis
  • Hybrid search with BM25 and MMR
  • Embedding generation
  • Resources for PostgreSQL statistics
  • Prompts for database exploration and query diagnostics

When to use

  • β€ΊWhen you want to ask questions about your data in plain language
  • β€ΊWhen you want an AI to explore a database schema
  • β€ΊWhen you want to search text in your database with hybrid search

What you need

PostgreSQL 14 or higher and a connection set in a config file, environment variables or flags. Install from source, Docker or the quick start guide.

Skills that pair well

⭐ Skillpedia MCP Β· freeYour agent finds the right skill on its ownInstall our MCP and your agent searches 15,000+ skills whenever it needs one.Install for free β†’

Frequently asked questions

Is it free and open source?

Yes, it is licensed under the PostgreSQL License.

Is it read-only?

Queries run in read-only transactions by default, and you can configure this per database.

Is it safe for public apps?

No. The readme says it is not for public-facing apps because the LLM can read your whole schema and data; use it for internal tools and trusted users.

Which clients work?

Claude Desktop, Claude Code, Cursor, Windsurf, VS Code Copilot, a CLI client and a web UI.

How does sign-in work for HTTP mode?

With user and API token authentication, TLS and optional OAuth.

Which Postgres versions work?

PostgreSQL 14 and higher.

If it does not work

  • β€ΊConfigure the database connection before starting the server, and check PostgreSQL is running with pg_isready.
  • β€ΊIn Claude Desktop use absolute paths, check the JSON syntax and restart it completely.
  • β€ΊSee docs/guide/troubleshooting.md for more fixes.

5 new skills a week. 1 minute to read.