Database connector
A PostgreSQL MCP server that answers business questions without handing out SQL access.
The reference Postgres MCP server is archived and no longer maintained. Most remaining options give the model a connection string and a run-any-query tool. For a production database, we build something narrower.
What your team could ask
- How many orders shipped late last week, by carrier?
- Which accounts have usage above their plan limit this month?
- What is the 30-day retention for customers who signed up in August?
- Show the last 20 failed payments with customer and reason.
What it could do, with approval
Write actions are optional. Each one is shown to a person before it changes anything.
- Flag an account for follow-up by writing to a dedicated review table
- Queue a data correction request instead of editing production rows
What already exists for PostgreSQL
Checked against vendor and platform sources on October 23, 2026. If an official option covers your need, use it.
There is no maintained official PostgreSQL MCP server from the PostgreSQL project. The MCP reference server (@modelcontextprotocol/server-postgres) was moved to the archived servers repository, which states it is no longer maintained, and Datadog Security Labs showed its read-only mode could be bypassed. Community and hosting-provider servers exist; we review their code before recommending any.
- Common pattern: a local server with a database connection string and a generic query tool.
- Risk: one shared credential, no per-user access, and the model writing arbitrary SQL.
Why build a custom one
Named tools, not free SQL
Each tool runs a reviewed, parameterized query over approved views, so the model cannot wander into tables it should not touch.
Database-level guardrails
A dedicated read-only role, statement timeouts, and row caps protect production even if a tool is misused.
Per-user rules
Row-level security or tenant filters from the signed-in user's token mean each person sees only their data.
How we would build it
- API
- PostgreSQL through a pooled driver, querying views and functions designed for the connector.
- Sign-in
- OAuth 2.0 for people signing in to the MCP server; a separate least-privilege database role that never reaches the model.
Agree the questions and create views that answer them on a replica.
Build parameterized tools with strict input schemas and row limits.
Add row-level security or tenant filtering from the user's identity.
Deploy remotely with logging, timeouts, and alerts.
Questions we get
Sources
- modelcontextprotocol/servers-archived on GitHub
- Datadog Security Labs: SQL injection in the Postgres MCP server
Vendor products and plan rules change often. Check the linked pages before you plan a rollout.
Have us build it
- Custom MCP serversCustom MCP server development for businesses. Prestyj designs, builds, secures, and runs Model Context Protocol servers that connect Claude, ChatGPT, and AI agents to your systems.
- Custom Claude connectorsPrestyj builds custom Claude connectors: secure remote MCP servers that let Claude read and act on your CRM, ERP, database, documents, and internal APIs, with OAuth and per-user permissions.
- Done-for-you Claude connectorsDone-for-you Claude connectors from Prestyj: we scope, build, host, secure, and maintain the connector that links Claude to your business systems. You bring the questions, we handle the rest.
- Custom ChatGPT pluginsCustom ChatGPT plugins for business: Prestyj builds MCP-based plugins that connect ChatGPT Business and Enterprise to your internal data and tools, with admin controls and per-user access.
Related systems
Want a PostgreSQL connector built for your team?
Bring the questions your team asks and the systems behind them. We will come back with a written scope and a fixed price.