
MCPg : Production Grade Postgresql Mcp Server
@devopam
About MCPg : Production Grade Postgresql Mcp Server
A safe-by-default PostgreSQL Model Context Protocol server for AI agents.
Config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"mcpg": {
"command": "uvx",
"args": [
"mcpg"
],
"env": {
"MCPG_DATABASE_URL": "postgresql://neondb_owner:npg_HDY3yUCx5mhw@ep-falling-cherry-atplmubj-pooler.c-9.us-east-1.aws.neon.tech/neondb?sslmode=require&channel_binding=require"
}
}
}
}Tools
No tools detected
Fetch the live tool list by running this server in a temporary sandbox using the button above.
Overview
What is MCPg?
MCPg is a production-grade MCP server for PostgreSQL that provides AI agents with over 100 tools for schema introspection, natural-language-to-SQL, query optimization, index tuning, performance analysis, multi-tenancy operations, and DBA tasks, prioritizing safety.
How to use MCPg?
Install via pip install mcpg or Docker. Configure connection settings and choose a transport: stdio for Claude Desktop, or HTTP/SSE/Streamable HTTP. Connect any MCP client to start using the tools.
Key features of MCPg
- Safety-first design: read-only by default, AST validation, strict sanitization
- Broad PostgreSQL support: pgvector, TimescaleDB, PostGIS, Apache AGE
- Production ready: connection pooling, SET ROLE multi-tenancy, read-replica routing
- Prometheus metrics and structured audit logging with redaction
- Multiple transports: stdio, HTTP, SSE, Streamable HTTP
- Easy install: pip or Docker with OIDC + static auth and rate limiting
Use cases of MCPg
- AI-assisted schema exploration and database introspection
- Natural language to SQL query generation and optimization
- Automated index tuning and performance analysis
- Multi-tenant database operations with role isolation
- Production DBA tasks with safety guards
FAQ from MCPg
What tools does MCPg provide?
Over 100 tools covering schema introspection, natural-language-to-SQL, query optimization, index tuning, performance analysis, multi-tenancy operations, and DBA tasks.
How does MCPg ensure safety?
It is read-only by default, performs AST validation on all SQL, strictly sanitizes identifiers, and requires opt-in gates for DDL, shell commands, and LISTEN operations.
What transports are supported?
MCPg supports stdio (for Claude Desktop), HTTP, Server-Sent Events (SSE), and Streamable HTTP.
Is MCPg production ready?
Yes, it includes connection pooling, SET ROLE multi-tenancy, read-replica routing, Prometheus metrics, structured audit logging, OIDC + static authentication, and rate limiting.
What are the runtime requirements?
Python (psycopg3 driver), a PostgreSQL database, and optional extensions like pg_stat_statements for performance features.
Frequently asked questions
What tools does MCPg provide?
Over 100 tools covering schema introspection, natural-language-to-SQL, query optimization, index tuning, performance analysis, multi-tenancy operations, and DBA tasks.
How does MCPg ensure safety?
It is read-only by default, performs AST validation on all SQL, strictly sanitizes identifiers, and requires opt-in gates for DDL, shell commands, and LISTEN operations.
What transports are supported?
MCPg supports stdio (for Claude Desktop), HTTP, Server-Sent Events (SSE), and Streamable HTTP.
Is MCPg production ready?
Yes, it includes connection pooling, SET ROLE multi-tenancy, read-replica routing, Prometheus metrics, structured audit logging, OIDC + static authentication, and rate limiting.
What are the runtime requirements?
Python (psycopg3 driver), a PostgreSQL database, and optional extensions like pg_stat_statements for performance features.
Basic information
More Data & Analytics MCP servers
CoinLobster
CoinLobsterThe only MCP server with live whale trades across 15 exchanges plus on-chain DEX flow. Smart Money Radar, real liquidations and outcome-scored signals. No API key required.

AskRentAI
AskRentAIAsk your Rent Manager property portfolio anything, from the AI you already use. AskRentAI is a hosted, read-only MCP server for Rent Manager, the property management platform used across a large share of US rental housi

Kinetic Pricing
Kinetic PricingKinetic Pricing lets you run pricing research with your own customers and manage the work around each decision. Create Van Westendorp, Gabor-Granger, MaxDiff, and choice-based conjoint studies; preview and launch surveys

Bounce Watch - Company Signal Intelligence
bouncewatchBounce Watch tells you what just changed at a company, and when. Who raised money. Who hired a senior person. Who opened an office, won a customer, or announced a partnership. Every event carries its own date, so you ca

Grabbit MCP
GrabbitRemote MCP server that helps AI agents find Reddit buyer-intent threads, check subreddit rules, read full conversations, and manage human-reviewed lead workflows.
Comments