PostgreSQL MCP Server

Stabledatabase
1850 starsTypeScriptAnthropic
GitHubnpm
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/dbname
Examples

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

Need a Custom MCP Server?

Our team builds custom MCP servers tailored to your workflow.

Get in Touch

Need a Custom MCP Server?

Our team builds custom MCP servers tailored to your workflow. From proprietary data sources to internal tools, we have you covered.

Contact Us
CortexAgent Customer Service

Want to skip the form?

Our team is available to help you get started with CortexAgent.

This chat may be recorded for quality assurance. You can view our Privacy Policy.