MCP server
by martymarkenson
Manage PostgreSQL connections, create a Postgres database, inspect schemas, and run SQL queries. Supports setting Postgr
Connects Claude to PostgreSQL databases to execute SQL queries and inspect table schemas. Uses environment variables for secure database authentication.
Postgres Connector is a community-built MCP server published by martymarkenson that provides AI assistants with tools and capabilities via the Model Context Protocol. Manage PostgreSQL connections, create a Postgres database, inspect schemas, and run SQL queries. Supports setting Postgr It is categorized under databases.
You can install Postgres Connector in your AI client of choice. Use the install panel on this page to get one-click setup for Cursor, Claude Desktop, VS Code, and other MCP-compatible clients. This server runs locally on your machine via the stdio transport.
MIT
Postgres Connector is released under the MIT license. This is a permissive open-source license, meaning you can freely use, modify, and distribute the software.
Enable Claude to query your database directly using natural language
Example
Ask 'Show me top 10 customers by revenue this month' and get SQL results instantly
Eliminate manual SQL writing for ad-hoc queries, get insights 10x faster
Generate complex reports and analytics without leaving conversation
Example
Analyze sales trends, cohort retention, user behavior patterns conversationally
Democratize data access—non-technical team members can query databases
Understand database structure, relationships, and data models
Example
'Explain the user_orders table schema and its relationships'
Onboard engineers faster, explore unfamiliar databases efficiently
Share your MCP server with the developer community
We wired Postgres Connector into a staging workspace; the listing’s GitHub and npm pointers saved time versus hunting across READMEs.
According to our notes, Postgres Connector benefits from clear Model Context Protocol framing — fewer ambiguous “AI plugin” claims.
Useful MCP listing: Postgres Connector is the kind of server we cite when onboarding engineers to host + tool permissions.
Postgres Connector reduced integration guesswork — categories and install configs on the listing matched the upstream repo.
We evaluated Postgres Connector against two servers with overlapping tools; this profile had the clearer scope statement.
Postgres Connector has been reliable for tool-calling workflows; the MCP profile page is a good permalink for internal docs.
Postgres Connector reduced integration guesswork — categories and install configs on the listing matched the upstream repo.
Useful MCP listing: Postgres Connector is the kind of server we cite when onboarding engineers to host + tool permissions.
I recommend Postgres Connector for teams standardizing on MCP; the explainx.ai page compares cleanly with sibling servers.
Postgres Connector is a well-scoped MCP server in the explainx.ai directory — install snippets and categories matched our Claude Code setup.
showing 1-10 of 66
An MCP (Model Context Protocol) server for querying a PostgreSQL database. Execute SQL queries, view table details, and manage database connections through MCP-compatible clients.
Follow these steps for installation:
Download the postgres-connector.mcpb file from this repository (located in the root directory).
postgres-connector.mcpb file
Screenshot placeholder: Installing the .mcpb file
After installation, the PostgreSQL Connector will appear in your Claude Desktop with default environment variables that you can configure with your database details.
Screenshot placeholder: Database configuration interface showing environment variables
Send a query "test the database connection"

You'll need to provide the following information for your PostgreSQL database:
| Environment Variable | Description | Required | Default |
|---|---|---|---|
| POSTGRES_HOST | The hostname or IP address of your PostgreSQL server | ✅ Yes | - |
| POSTGRES_PORT | The port number for your PostgreSQL server | ❌ No | 5432 |
| POSTGRES_DB | The name of the specific database to connect to | ✅ Yes | - |
| POSTGRES_USER | Your PostgreSQL username | ✅ Yes | - |
| POSTGRES_PASSWORD | Your PostgreSQL password | ✅ Yes | - |
These environment variables will be automatically available for configuration in the extension settings panel after installing the extension in Claude Desktop.
Tool: test-postgres-connection
Tests your database connection and displays the current configuration (password hidden for security).
Example Output:
✅ Database connection successful!
Configuration:
{
"host": "localhost",
"port": "5432",
"database": "myapp_production",
"username": "postgres",
"password": "***hidden***"
}
Connection test result: [
{
"test": 1
}
]
Tool: get-all-tables
Retrieves a list of all tables in the public schema of your database.
Example Output:
[
{
"table_name": "users"
},
{
"table_name": "orders"
},
{
"table_name": "products"
},
{
"table_name": "categories"
}
]
Tool: execute-sql-query
Executes SELECT queries on your database with security validation.
Input:
sql: The SQL query to execute (SELECT statements only)Example Usage:
SELECT id, name, email FROM users LIMIT 5;
Example Output:
[
{
"id": 1,
"name": "John Doe",
"email": "john@example.com"
},
{
"id": 2,
"name": "Jane Smith",
"email": "jane@example.com"
}
]
The PostgreSQL MCP server includes security measures:
Best practice is to create a read-only database user for the postgres connector to use.
The following SQL operations are NOT ALLOWED for security:
DROP (deleting tables/databases)DELETE (removing data)TRUNCATE (clearing tables)ALTER (modifying structure)CREATE (creating new objects)INSERT (adding data)UPDATE (modifying data)Use the get-all-tables tool to retrieve all tables in your database schema.
Use the execute-sql-query tool with SELECT statements:
SELECT * FROM users LIMIT 10;
Problem: "Database connection failed"
Problem: "Connection timeout"
Problem: "Dangerous operation detected"
Problem: "Query execution failed"
Problem: MCP server not appearing in Claude Desktop client
Problem: Environment variables not showing up
Problem: Cannot configure database settings
postgres-connector/
├── src/
│ └── server.ts # Main MCP server implementation
├── package.json # Node.js dependencies
├── manifest.json # MCP extension manifest
├── icon.png # Extension icon
└── postgres-connector.mcpb # Compiled extension bundle
MIT License - see the LICENSE file for details.
Marty Markenson
Need help? Open an issue in this repository or reach out to martymarkenson
Run data quality queries to catch anomalies and inconsistencies
Example
Find duplicate records, missing values, orphaned foreign keys automatically
Maintain data integrity with less manual SQL work
Prerequisites
Time Estimate
15-30 minutes including configuration and testing
Steps
Troubleshooting
✓ Do
✗ Don't
💡 Pro Tips
Architecture
MCP server acts as bridge between Claude and database, translating natural language to SQL queries and returning results in structured format.
Protocols
Compatibility
✓ Use when
Use for ad-hoc data queries, exploratory analysis, report generation, schema exploration, and democratizing data access. Best for read-heavy analytics workloads.
✗ Avoid when
Avoid for production write operations, mission-critical transactions, real-time OLTP workloads, or when database contains sensitive PII without proper access controls. Use read replicas, not primary.