PostgreSQL MCP Server provides a comprehensive set of tools for PostgreSQL database management through the Model Context Protocol. It enables analyzing database configurations, debugging issues, managing schemas, migrating data, and monitoring performance metrics. The server implements connection pooling for efficient resource management, supports various PostgreSQL operations including table creation, data export/import, function management, and Row-Level Security policies. Built with TypeScript and Node.js, it offers platform-specific setup instructions and detailed documentation, making it valuable for developers who need to interact with PostgreSQL databases directly within AI assistant workflows without requiring separate database management tools.
No reviews yet. Be the first to review!
Sign in to join the conversation
Analyzes PostgreSQL database configuration and performance metrics. Parameters: analysisType (optional string: 'configuration' | 'performance' | 'security')
Provides step-by-step PostgreSQL installation and configuration guidance. Parameters: platform (required string: 'linux' | 'macos' | 'windows'), version (optional string), useCase (optional string: 'development' | 'production')
Debug common PostgreSQL issues. Parameters: issue (required string: 'connection' | 'performance' | 'locks' | 'replication'), logLevel (optional string: 'info' | 'debug' | 'trace')
Get detailed schema information for a database or specific table. Parameters: tableName (optional string: specific table to get info for)
Create a new table with specified columns. Parameters: tableName (required string), columns (required array of objects defining column names and types)
Modify existing tables. Parameters: tableName (required string), operations (required array of objects defining operations to perform)
Get information about PostgreSQL ENUM types. Parameters: schema (optional string), enumName (optional string)
Create a new ENUM type in the database. Parameters: enumName (required string), values (required array of strings), schema (optional string), ifNotExists (optional boolean)
Export table data to JSON or CSV format. Parameters: tableName (required string), outputPath (required string), where (optional string), limit (optional integer), format (optional string: 'json' | 'csv')
Import data from JSON or CSV files. Parameters: tableName (required string), inputPath (required string), truncateFirst (optional boolean), format (optional string: 'json' | 'csv'), delimiter (optional string)
Copy data between two PostgreSQL databases. Parameters: sourceConnectionString (required string), targetConnectionString (required string), tableName (required string), where (optional string), truncateTarget (optional boolean)
Real-time monitoring of PostgreSQL database. Parameters: includeTables (optional boolean), includeQueries (optional boolean), includeLocks (optional boolean), includeReplication (optional boolean), alertThresholds (optional object)
Get information about PostgreSQL functions. Parameters: functionName (optional string), schema (optional string)
Create or replace a PostgreSQL function. Parameters: functionName (required string), parameters (required string), returnType (required string), functionBody (required string), language (optional string), volatility (optional string), schema (optional string), security (optional string), replace (optional boolean)
Drop a PostgreSQL function. Parameters: functionName (required string), parameters (optional string), schema (optional string), ifExists (optional boolean), cascade (optional boolean)
Enable Row-Level Security on a table. Parameters: tableName (required string), schema (optional string)
Disable Row-Level Security on a table. Parameters: tableName (required string), schema (optional string)
Create a Row-Level Security policy. Parameters: tableName (required string), policyName (required string), using (required string), check (optional string), schema (optional string), command (optional string), role (optional string), replace (optional boolean)
Edit an existing Row-Level Security policy. Parameters: tableName (required string), policyName (required string), schema (optional string), roles (optional array of strings), using (optional string), check (optional string)
Drop a Row-Level Security policy. Parameters: tableName (required string), policyName (required string), schema (optional string), ifExists (optional boolean)
Get Row-Level Security policies. Parameters: tableName (optional string), schema (optional string)
Get information about PostgreSQL triggers. Parameters: tableName (optional string), schema (optional string)
Create a PostgreSQL trigger. Parameters: triggerName (required string), tableName (required string), functionName (required string), schema (optional string), timing (optional string), events (optional array of strings), when (optional string), forEach (optional string), replace (optional boolean)
Drop a PostgreSQL trigger. Parameters: triggerName (required string), tableName (required string), schema (optional string), ifExists (optional boolean), cascade (optional boolean)
Enable or disable a PostgreSQL trigger. Parameters: triggerName (required string), tableName (required string), enable (required boolean), schema (optional string)