About
Overview
The PostgreSQL MCP Server enables AI agents to interact with PostgreSQL databases through the Model Context Protocol. It provides tools for executing queries, inspecting table schemas, listing databases, and performing common database operations. Supports parameterized queries to prevent SQL injection.
Capabilities
Tools & Capabilities
⚡query
Execute a SQL query against the database
⚡describe_table
Get the schema of a specific table
⚡list_tables
List all tables in the database
⚡list_databases
List all available databases
Setup
Installation
bash
Install
npm install @modelcontextprotocol/server-postgresExamples
Example Usage
javascript
Usage
import { PostgresServer } from "@modelcontextprotocol/server-postgres";
const server = new PostgresServer({
connectionString: process.env.DATABASE_URL
});
await server.start();Quick Info
AuthorAnthropic
LanguageTypeScript
StatusStable
Stars★ 1820
Last UpdatedFeb 12, 2026
Related Servers
api
Brave Search MCP Server
Perform web searches and retrieve real-time information using Brave Search API through MCP.