Skip to content
Temp edited this page Oct 3, 2025 · 6 revisions

PostgreSQL MCP Server - Complete Documentation

Version 1.0.0 - Enterprise-grade PostgreSQL operations with 63 specialized MCP tools

License: MIT Security CodeQL


🚀 Quick Navigation

Getting Started

Tool Categories (63 Tools)

Advanced Topics


📊 Overview

The PostgreSQL MCP Server provides 63 specialized tools for comprehensive database operations:

Category Tools Key Features
Core Database 9 Schema management, SQL execution, health monitoring
JSON Operations 15 JSONB, validation, security scanning, diff/merge
Text Processing 6 Trigram similarity, full-text search, fuzzy matching
Statistical Analysis 8 Descriptive stats, correlation, time series
Performance 6 Query optimization, index tuning, workload analysis
Vector Search 8 Semantic search, embeddings, clustering
Geospatial 7 PostGIS, spatial queries, coordinate transformation
Backup & Recovery 4 Logical/physical backup, restore validation
Monitoring 5 Real-time metrics, alerting, capacity planning

🎯 Key Features

🔒 Security First

  • Zero Known Vulnerabilities - Comprehensive security audit passed
  • SQL Injection Prevention - Parameter binding with automatic sanitization
  • Dual Security Modes - Restricted (production) and unrestricted (development)
  • Enterprise-Grade Protection - Query validation, audit logging

⚡ Performance Excellence

  • Real-Time Analytics - pg_stat_statements integration
  • Hypothetical Index Testing - HypoPG for zero-risk optimization
  • DTA Algorithm - Microsoft SQL Server-inspired index tuning
  • Buffer Cache Analysis - 99%+ accuracy monitoring

🧠 AI-Native Operations

  • Schema Intelligence - Context-aware SQL generation
  • Query Optimization - Automated performance improvements
  • Predictive Analysis - Performance forecasting
  • Natural Language Interface - Human-friendly database interactions

🏢 Enterprise Ready

  • PostgreSQL 13-17 - Full version compatibility
  • Multi-Platform - Windows, Linux, macOS (amd64, arm64)
  • Type Safety - Pyright strict mode with LiteralString enforcement
  • CI/CD Ready - Automated testing and security validation

🆕 Recent Updates

Version 1.0.0 Release - October 3, 2025 🎉

  • Production Ready: Enterprise-grade PostgreSQL MCP server
  • 63 Specialized Tools: Complete feature set across 9 categories
  • Zero Known Vulnerabilities: Comprehensive security audit passed
  • Type Safety: Pyright strict mode compliance
  • Multi-Platform Support: Windows, Linux, macOS (amd64, arm64)

Phase 5 Release - October 3, 2025

  • Backup & Recovery Suite: 4 new tools implemented
  • Monitoring & Alerting Suite: 5 new tools implemented
  • All 63 Tools Operational: Complete Phase 5 implementation
  • Code Quality: Ruff formatting and linting passing

Phase 4 Release - October 3, 2025

  • Vector/Semantic Search: 8 tools with pgvector integration
  • Geospatial Operations: 7 tools with PostGIS integration
  • Extension Support: pgvector v0.8.0 and PostGIS v3.5.0
  • Graceful Degradation: Informative errors for missing extensions

📚 Documentation Structure

This wiki is organized to help you find information quickly:

For Beginners

  1. Start with Quick Start
  2. Review Installation & Configuration
  3. Set up Extensions
  4. Configure your MCP Client

For Developers

  1. Explore Core Database Tools
  2. Learn JSON Operations
  3. Master Performance Intelligence
  4. Understand Security Best Practices

For Enterprise Users

  1. Review Backup & Recovery
  2. Set up Monitoring & Alerting
  3. Optimize with Performance Intelligence
  4. Implement Security Best Practices

🔗 External Resources


💡 Quick Examples

Execute Secure SQL

execute_sql(
    sql="SELECT * FROM users WHERE id = %s",
    params=[123]
)

Analyze Database Health

analyze_db_health(health_type="all")

Monitor Real-Time Performance

monitor_real_time(
    include_queries=True,
    include_locks=True,
    include_io=True
)

Optimize Vector Search

vector_similarity(
    table_name="documents",
    vector_column="embedding",
    query_vector=[0.1, 0.2, ...],
    distance_metric="cosine",
    limit=10
)

📈 Project Stats

  • Version 1.0.0 - Production ready release (October 3, 2025)
  • 63 MCP Tools across 9 categories
  • 6,900+ lines of implementation code
  • 12 modules with specialized functionality
  • Phase 5 Complete - All enterprise features implemented
  • 100% Type Safe - Pyright strict mode compliance
  • Zero Vulnerabilities - Comprehensive security audit passed

🤝 Community & Support


Version 1.0.0 - Last Updated: October 3, 2025

Clone this wiki locally