MCPpedia last refreshed this data
Config is the same across clients — only the file and path differ.
{
"mcpServers": {
"pg-mcp-server": {
"command": "<see-readme>",
"args": []
}
}
}Are you the author?
Add this badge to your README to show your security score and help users find safe servers.
A Model Context Protocol (MCP) server for PostgreSQL databases with enhanced capabilities for AI agents.
No automated test available for this server. Check the GitHub README for setup instructions.
Five weighted categories — click any category to see the underlying evidence.
No known CVEs.
No package registry to scan.
Click any tool to inspect its schema.
database_descriptionComprehensive database description with schema and structure information
pgmcp://{conn_id}/
schemasList schemas with descriptions
pgmcp://{conn_id}/schemas
schema_tablesList tables in a schema with descriptions and row counts
pgmcp://{conn_id}/schemas/{schema}/tables
table_columnsGet column details with data types and descriptions for a table
pgmcp://{conn_id}/schemas/{schema}/tables/{table}/columns
table_constraintsView table constraints and indexes
pgmcp://{conn_id}/schemas/{schema}/tables/{table}/constraints
table_sampleSample table data with pagination
pgmcp://{conn_id}/schemas/{schema}/tables/{table}/sample
table_row_countGet approximate row count for a table
pgmcp://{conn_id}/schemas/{schema}/tables/{table}/row_count
extensionsExplore database extensions with built-in context
pgmcp://{conn_id}/extensions
Be the first to review
Have you used this server?
Share your experience — it helps other developers decide.
Sign in to write a review.
Others in data
Manage Supabase projects — databases, auth, storage, and edge functions
Query and manage PostgreSQL databases directly from AI assistants
Zero-dependency, token-efficient database MCP server for Postgres, MySQL, SQL Server, MariaDB, SQLite.
🔥 Official Firecrawl MCP Server - Adds powerful web scraping and search to Cursor, Claude and any other LLM clients.
MCP Security Weekly
Get CVE alerts and security updates for Pg Mcp Server and similar servers.
Start a conversation
Ask a question, share a tip, or report an issue.
Sign in to join the discussion.
A Model Context Protocol (MCP) server for PostgreSQL databases with enhanced capabilities for AI agents.
More info on the pg-mcp project here:
PG-MCP is a server implementation of the Model Context Protocol for PostgreSQL databases. It provides a comprehensive API for AI agents to discover, connect to, query, and understand PostgreSQL databases through MCP's resource-oriented architecture.
This implementation builds upon and extends the reference Postgres MCP implementation with several key enhancements:
Built-in contextual information for PostgreSQL extensions like:
Additional extensions can be easily added via YAML config files.
# Clone the repository
git clone https://github.com/stuzero/pg-mcp-server.git
cd pg-mcp-server
# Build and run with Docker Compose
docker-compose up -d
# Clone the repository
git clone https://github.com/stuzero/pg-mcp-server.git
cd pg-mcp-server
# Install dependencies and create a virtual environment ( .venv )
uv sync
# Activate the virtual environment
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# Run the server
python -m server.app
The repository includes test scripts to verify server functionality:
# Basic server functionality test
python test.py "postgresql://username:password@hostname:port/database"
# Claude-powered natural language to SQL conversion
python example-clients/claude_cli.py "Show me the top 5 customers by total sales"
The claude_cli.py script requires environment variables:
# .env file
DATABASE_URL=postgresql://username:password@hostname:port/database
ANTHROPIC_API_KEY=your-anthropic-api-key
PG_MCP_URL=http://localhost:8000/sse
Example prompt for use with agents:
Use the PostgreSQL MCP server to analyze the database.
Available tools:
- connect: Register a database connection string and get a connection ID
- disconnect: Close a database connection
- pg_query: Execute SQL queries using a connection ID
- pg_explain: Get query execution plans
You can explore schema resources via:
pgmcp://{con
... [View full README on GitHub](https://github.com/stuzero/pg-mcp-server#readme)