PostgreSQL
Connect AI tools to PostgreSQL. Interact with your database in natural language.
PostgreSQL
Connect AI tools to PostgreSQL. Interact with your database in natural language. With Lunar.dev MCPX, the MCP Gateway for secure and governed tool access, you connect the PostgreSQL MCP server to Claude, ChatGPT, Cursor, and any MCP client through one gateway that routes, authenticates, and governs every PostgreSQL tool call against your policies.
Why MCPX
MCPX is Lunar.dev's MCP Gateway. It sits between your AI agents and your MCP servers as a single gateway for every tool call, routing, authenticating, and governing traffic against your policies. Connect PostgreSQL once and govern it everywhere: role-based access per agent with on-behalf-of attribution, real-time visibility, and an immutable audit trail of who did what, all deployable inside your own VPC.
Tools content
- list_schemas · Read-only
List all schemas in the database. - list_objects · Read-only
List objects of a given type in a schema. - get_object_details · Read-only
Get detailed information about a database object. - explain_query · Read-only
Explain the execution plan for a SQL query, with detailed cost estimates. - execute_sql · Write
Execute a SQL query (unrestricted), or a read-only query in restricted mode. - analyze_workload_indexes · Read-only
Analyze frequently executed queries and recommend optimal indexes. - analyze_query_indexes · Read-only
Analyze a list of up to 10 SQL queries and recommend optimal indexes. - analyze_db_health · Read-only
Analyze database health across index, connection, vacuum, sequence, replication, buffer, and constraint checks. - get_top_queries · Read-only
Report the slowest or most resource-intensive queries using pg_stat_statements.
Frequently asked questions
What is the PostgreSQL MCP server?
Connect AI tools to PostgreSQL. Interact with your database in natural language. Through Lunar.dev MCPX, PostgreSQL connects to any MCP-compatible AI client behind a single governed gateway.
How do I connect PostgreSQL to MCPX?
Add the PostgreSQL server in the MCPX control plane or your app.yaml, then point your AI client at your MCPX gateway. MCPX handles Connection string and routes every PostgreSQL call through the gateway.
Is the PostgreSQL MCP server official?
PostgreSQL is a community-maintained MCP server. MCPX lets you risk-assess and sandbox it before rolling it out to your teams.
What authentication does PostgreSQL use with MCPX?
PostgreSQL uses Connection string. MCPX enforces authentication at the gateway with token-based auth, OAuth, and role-based profiles, so you control which agents can invoke it.
How many tools does PostgreSQL expose in MCPX?
PostgreSQL exposes 9 tools. In MCPX you can enable or disable each tool per agent for least-privilege access.
