Show HN: Pgmcp, an MCP server to query any Postgres database in natural language
a day ago
- #AI-assistant
- #database-access
- #PostgreSQL
- PGMCP is a Model Context Protocol (MCP) server that provides AI assistants with safe, read-only access to PostgreSQL databases via natural language queries.
- It translates plain English questions into SQL queries, executes them, and returns structured results with error handling and performance optimization.
- Works with any MCP-compatible client like Cursor, Claude Desktop, VS Code extensions, and custom integrations.
- Key features include natural language to SQL translation, intelligent query understanding, automatic streaming for large datasets, and read-only access enforcement.
- Includes robust security measures like input sanitization, audit logging, and safeguards against write operations.
- Supports any PostgreSQL schema without modifications - works with e-commerce, analytics, CRM, financial systems, etc.
- Handles AI unpredictability gracefully with error recovery, helpful feedback, and system stability.
- Offers multiple output formats (table, JSON, CSV) and advanced capabilities like full-text search across all text columns.
- Includes comprehensive testing (unit, integration, security, performance) and supports Docker deployment.
- Can be integrated into production environments with authentication, connection pooling, and configuration options.