PostgreSQL MCP Server

Stabledatabase
1820 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 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-postgres
Examples

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.

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.