Skip to content

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.
  1. Agree the questions and create views that answer them on a replica.

  2. Build parameterized tools with strict input schemas and row limits.

  3. Add row-level security or tenant filtering from the user's identity.

  4. Deploy remotely with logging, timeouts, and alerts.

Questions we get

Sources

Vendor products and plan rules change often. Check the linked pages before you plan a rollout.

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.

Book a scoping call