About
Overview
The PostgreSQL MCP Server enables AI agents to interact with PostgreSQL databases through the Model Context Protocol. It provides tools for executing read-only queries, inspecting table schemas, listing databases and tables, and understanding relationships between tables. Supports parameterized queries and includes built-in safety features to prevent accidental data modification.
Capabilities
Tools & Capabilities
⚡query
Execute a read-only SQL query against the connected PostgreSQL database
⚡describe_table
Get the schema definition and column details of a specific table
⚡list_tables
List all tables in the current database schema
Setup
Installation
bash
Install
npx -y @modelcontextprotocol/server-postgres postgresql://user:password@localhost/dbnameExamples
Example Usage
javascript
Usage
Add to your Claude Desktop config:
{
"mcpServers": {
"postgres": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-postgres", "postgresql://localhost/mydb"]
}
}
}Quick Info
AuthorAnthropic
LanguageTypeScript
StatusStable
Stars★ 1850
Last UpdatedFeb 12, 2026