A server for managing PostgreSQL databases, enabling comprehensive database operations.
A Model Context Protocol (MCP) server that provides comprehensive PostgreSQL database management capabilities for AI assistants.
š What's New: This server has been completely redesigned from 46 individual tools to 17 intelligent tools through consolidation (34ā8 meta-tools) and enhancement (+4 new tools), providing better AI discovery while adding powerful data manipulation and comment management capabilities.
# Install globally
npm install -g @henkey/postgres-mcp-server
# Or run directly with npx (no installation)
npx @henkey/postgres-mcp-server --connection-string "postgresql://user:pass@localhost:5432/db"
Add to your MCP client configuration:
{
"mcpServers": {
"postgresql-mcp": {
"command": "npx",
"args": [
"@henkey/postgres-mcp-server",
"--connection-string", "postgresql://user:password@host:port/database"
]
}
}
}
npx -y @smithery/cli install @HenkDz/postgresql-mcp-server --client claude
git clone <repository-url>
cd postgresql-mcp-server
npm install
npm run build
Add to your MCP client configuration:
{
"mcpServers": {
"postgresql-mcp": {
"command": "node",
"args": [
"/path/to/postgresql-mcp-server/build/index.js",
"--connection-string", "postgresql://user:password@host:port/database"
]
}
}
}
17 powerful tools organized into three categories:
Brand new capabilities not available in the original 46 tools
// Analyze database performance
{ "analysisType": "performance" }
// Create a table with constraints
{
"operation": "create_table",
"tableName": "users",
"columns": [
{ "name": "id", "type": "SERIAL PRIMARY KEY" },
{ "name": "email", "type": "VARCHAR(255) UNIQUE NOT NULL" }
]
}
// Query data with parameters
{
"operation": "select",
"query": "SELECT * FROM users WHERE created_at > $1",
"parameters": ["2024-01-01"],
"limit": 100
}
// Insert new data
{
"operation": "insert",
"table": "users",
"data": {"name": "John Doe", "email": "john@example.com"},
"returning": "*"
}
// Find slow queries
{
"operation": "get_slow_queries",
"limit": 5,
"minDuration": 100
}
// Manage database object comments
{
"operation": "set",
"objectType": "table",
"objectName": "users",
"comment": "Main user account information table"
}
š Complete Tool Schema Reference - All 18 tool parameters & examples in one place
For additional information, see the docs/
folder:
ā
34ā8 meta-tools - Intelligent consolidation for better AI discovery
ā
Multiple operations per tool - Unified schemas with operation parameters
ā
Smart parameter validation - Clear error messages and type safety
ā
Complete CRUD operations - INSERT/UPDATE/DELETE/UPSERT with parameterized queries
ā
Flexible querying - SELECT with count/exists support and safety limits
ā
Arbitrary SQL execution - Transaction support for complex operations
ā
Flexible connection - CLI args, env vars, or per-tool configuration
ā
Security focused - SQL injection prevention, parameterized queries
ā
Robust architecture - Connection pooling, comprehensive error handling
See Development Guide for detailed setup instructions.
AGPLv3 License - see LICENSE file for details.
Access the OpenGenes database for aging and longevity research, with automatic updates from Hugging Face Hub.
A read-only MCP server for querying live Google Directory data using the CData JDBC Driver.
Create, manage, and update applications on InstantDB, the modern Firebase.
A TypeScript and SQLite-based server enabling AI to remember personal data for personalized communication.
Read and write access to Airtable databases.
Real-time PostgreSQL & Supabase database schema access for AI-IDEs via Model Context Protocol. Provides live database context through secure SSE connections with three powerful tools: get_schema, analyze_database, and check_schema_alignment.
Read-only access to Snowflake databases. Requires Snowflake connection information provided via MCP client configuration.
Access a comprehensive database of over 30,000 SaaS products, including reviews, pricing, alternatives, and growth metrics.
A server for storing and searching data in a VikingDB instance, configurable via command line or environment variables.
A local, high-performance memory server for AI agents, built with SQLite, vector embeddings, and a knowledge graph. Packaged for npm and Docker.