Enables AI-driven database administration, observability, and querying with support for schema management, SQL execution, JSONB operations, text processing, statistical analysis, query optimization, and extensions including pgvector, PostGIS, and pg_stat_statements.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@PostgreSQL MCP Servershow me the top 10 users by last login date"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
postgresql-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/databaseMCP 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 |
| Query performance tracking |
| Text similarity |
| Fuzzy matching |
| Hypothetical indexes |
| Vector similarity search |
| 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 checkLicense
MIT License - see LICENSE for details.
Contributing
See CONTRIBUTING.md for contribution guidelines.
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.