Skip to main content
Glama
neverinfamous

PostgreSQL MCP Server

postgresql-mcp

License: MIT TypeScript MCP

UNDER DEVELOPMENT - NOT READY FOR PRODUCTION

An enterprise-focused PostgreSQL MCP server enabling secure, AI-driven database administration, observability, and querying via OAuth 2.0, with connection pooling, OAuth 2.0 and advanced tool filtering.

Features

  • Full PostgreSQL Support - 100% coverage of PostgreSQL features

  • Connection Pooling - Built-in connection pool management

  • Tool Filtering - Filter tools by category or custom patterns

  • Extension Support - PostGIS, pgvector, pg_stat_statements, and more

  • Code Mode - TypeScript implementation with strict typing

Quick Start

# Install
npm install -g postgresql-mcp

# Run with connection string
postgresql-mcp --postgres postgres://user:password@localhost:5432/database

MCP Client Configuration

Claude Desktop / Cursor

{
  "mcpServers": {
    "postgres": {
      "command": "npx",
      "args": ["-y", "postgresql-mcp", "--postgres", "postgres://user:password@localhost:5432/database"]
    }
  }
}

Tool Categories

Category

Tools

Description

Core Database

TBD

Schema, SQL execution, health

JSON Operations

TBD

JSONB operations, validation

Text Processing

TBD

Similarity, full-text, fuzzy

Statistical Analysis

TBD

Stats, correlation, regression

Performance

TBD

Query optimization, index tuning

Vector/Semantic

TBD

pgvector integration

Geospatial

TBD

PostGIS operations

Backup & Recovery

TBD

Backup planning, restore

Monitoring

TBD

Real-time monitoring, alerting

Extension Support

Extension

Purpose

pg_stat_statements

Query performance tracking

pg_trgm

Text similarity

fuzzystrmatch

Fuzzy matching

hypopg

Hypothetical indexes

pgvector

Vector similarity search

PostGIS

Geospatial operations

Development

# Clone and install
git clone https://github.com/neverinfamous/postgresql-mcp.git
cd postgresql-mcp
npm install

# Build
npm run build

# Run checks
npm run check

License

MIT License - see LICENSE for details.

Contributing

See CONTRIBUTING.md for contribution guidelines.

-
security - not tested
A
license - permissive license
-
quality - not tested

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/neverinfamous/postgresql-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server