Postgres MCP server
MCP server for interacting with PostgreSQL databases
2 stars30 downloads/wk
Reviews
Write oneNobody has reviewed Postgres yet.
If you have run it, two minutes of your experience saves the next person an afternoon.
Postgres tools (5, 1 write)
write = sends, deletes, buys or postsRead from the package source without running it. The installed server may list more.
pg-awrGenerate a PostgreSQL performance report similar to Oracle AWR. Includes database statistics, top queries (requires pg_stat_statements extension), table/index statistics, connection info, and optimization recommendations.
pg-connectProvides an interface to connect to a specified PostgreSQL database. If a database connection is already active, the tool will close the existing connection before establishing a new one. This tool accepts three required parameters: \tconnectionString: The PostgreSQL connection string without embedded credentials (e.g., postgresql://host:port/dbname or host:port/dbname). To enable encryption (SSL)
pg-explainGenerate and display the execution plan for a given SQL query using PostgreSQL's EXPLAIN command. This tool helps you understand how PostgreSQL will execute your query, including information about table scans, joins, indexes used, and estimated costs. Args: \tsql: The SQL query to explain. The `model` argument should specify only the name and version of the LLM (Large Language Model) you are using
pg-querywrite actionThis tool executes SQL queries in a READ ONLY session connected to a PostgreSQL database. If no active connection exists, it uses MCP server registration argument and environment variables PG_USER and PG_PASSWORD. You should: \tExecute the provided SQL query. \tReturn the results in Toon format. Args: \tsql: The SQL query to execute. The `model` argument should specify only the name and version of
pg-statsGet comprehensive statistics for a specific PostgreSQL table. This tool retrieves detailed information including row counts, table size, index information, column statistics, and other metadata that can help optimize queries and understand data distribution. Args: \tname: The name of the table to get statistics for. The `model` argument should specify only the name and version of the LLM (Large La
Public scan report
scanner v0.1.10 · 2026-09-28 · same rubric, same numbers if you re-run it
- Code scan12 source files scanned25/25
- –Live reliabilityno gateway calls yet and no remote to proben/a
- –Tool poisoningtools not inspected (local package is not executed); not countedn/a
- Auth qualitystatic API keys via environment variables6/15
- Maintenancelast push 38 days ago12/15
- Maintainer identityregistry namespace matches repository owner; GitHub account older than a year8/10
How Postgres compares
Against every graded Databases MCP server, from our own scans and uptime checks. Updated after each scan run.
- Safety score
- 78/100
- higher than 47% of 802 Databases servers
- Tools
- 5
- the typical Databases server has 8
- Tools that change things
- 20%
- typical: 10%. Fewer write tools means less an agent can break
- GitHub stars
- 2
- more than 60% of 601 Databases servers
- Downloads a week
- 30
- more than 17% of 324 Databases servers with a package
What its tools let an agent do: 4 read · 1 change
Install Postgres in Claude Code, Cursor or VS Code
Runs npx -y @marcelo-ochoa/server-postgres on your machine. Read the scan report first; the gateway never runs local packages.
claude mcp add postgres -- npx -y @marcelo-ochoa/server-postgres
What the publisher says
From the Postgres repository's README, as published. We do not edit it. Read it on GitHub
Model Context Protocol servers
This repository is a collection of reference implementations for the Model Context Protocol (MCP), as well as references to community-built servers and additional resources.
[!IMPORTANT]
If you are looking for a list of MCP servers, you can browse published servers on the MCP Registry. The repository served by this README is dedicated to housing just the small number of reference servers maintained by the MCP steering group.
[!WARNING]
The servers in this repository are intended as reference implementations to demonstrate MCP features and SDK usage. They are meant to serve as educational examples for developers building their own MCP servers, not as production-ready solutions. Developers should evaluate their own security requirements and implement appropriate safeguards based on their specific threat model and use case.
The servers in this repository showcase the versatility and extensibility of MCP, demonstrating how it can be used to give Large Language Models (LLMs) secure, controlled access to tools and data sources. Typically, each MCP server is implemented with an MCP SDK:
- C# MCP SDK
- Go MCP SDK
- Java MCP SDK
- Kotlin MCP SDK
- PHP MCP SDK
- Python MCP SDK
- Ruby MCP SDK
- Rust MCP SDK
- Swift MCP SDK
- TypeScript MCP SDK
🌟 Reference Servers
These servers aim to demonstrate MCP features and the official SDKs.
- Everything - Reference / test server with prompts, resources, and tools.
- Fetch - Web content fetching and conversion for efficient LLM usage.
- Filesystem - Secure file operations with configurable access controls.
- Git - Tools to read, search, and manipulate Git repositories.
- Memory - Knowledge graph-based persistent memory system.
- Sequential Thinking - Dynamic and reflective problem-solving through thought sequences.
- Time - Time and timezone conversion capabilities.
Archived
The following reference servers are now archived and can be found at servers-archived.
Shortened. The full README is on GitHub.
Nothing above is checked by us. What we check is on the safety report.
Postgres: common questions
- Is Postgres MCP server safe?
- Mostly: it is graded B (78/100). Read the Postgres safety report
- How do I install Postgres?
- It runs on your machine. Copy the Claude Code, Cursor, VS Code or Claude Desktop config from the install section.
- Does Postgres need an API key?
- Yes. The registry entry asks for
POSTGRES_PASSWORD. - Is Postgres maintained?
- The last commit was 73 days ago (2026-08-21). The latest release is v1.0.8.
- What can I use instead of Postgres?
- Servers from other publishers that do the same job: DBHub MCP server, Appwrite MCP server and Faucet MCP server.
- How does Postgres compare with other Databases MCP servers?
- safety score 78/100 (higher than 47% of 802 Databases servers); tools 5 (the typical Databases server has 8); tools that change things 20% (typical: 10%. Fewer write tools means less an agent can break). Full comparison.
Alternatives to Postgres
Same job from other publishers: the closest match first, then the best rated.
- DBHubToken-efficient database MCP server for PostgreSQL, MySQL, MariaDB, SQL Server, Oracle, SQLitenot reviewedWidely usedA
- AppwriteBuild and deploy backends: auth, Postgres/MySQL/vector databases, storage, functions, hosting, CDNnot reviewedEstablishedA
- FaucetSQL database to MCP tools and REST API: PostgreSQL, MySQL, SQL Server, Oracle, SQLite, Snowflake.not reviewedEstablishedA
- NeonOfficial Neon MCP server for managing Neon projects and Lakebase Postgres databases.not reviewedEstablishedA
- PostgreSQLMCP server for PostgreSQL: local, Docker, RDS, Neon, Supabase, or behind an SSH bastion.not reviewedEstablishedB