Skip to content
Databases & warehouses

PostgreSQL MCP server: ask questions, get governed answers

PostgreSQL is an open-source relational database; it holds application and operational tables such as orders, customers, subscriptions, payments and inventory.

Try it on your own data in a pilot.

PostgreSQL AI analytics: what you can ask

Typical questions from engineering and analytics teams. Each answer shows the definition, source and query behind it.

  • What was net revenue by region last quarter, using our approved revenue definition?
  • How many new customers signed up each week over the past 90 days?
  • Which subscriptions are set to renew in the next 30 days?
  • Which product lines had the largest margin change month over month?
  • Who are our top 20 customers by revenue this year?
  • Compare monthly order counts this year with last year.

Worked example: a governed Postgres answer

One question, and everything the answer shows so you can check it. The figures are invented sample data.

Which subscriptions renew in the next 30 days, and what revenue do they carry?

Approved definition: Upcoming renewals

Active, non-deleted subscriptions with a renewal date in the next 30 days, valued at their current annual contract value in USD.

Source

  • billing.subscriptions
  • billing.plans

Query (SQL (PostgreSQL))

SELECT p.name AS plan,
       COUNT(*) AS subscriptions,
       SUM(s.annual_value_cents) / 100.0 AS annual_value_usd
FROM billing.subscriptions s
JOIN billing.plans p ON p.id = s.plan_id
WHERE s.status = 'active'
  AND s.deleted_at IS NULL
  AND s.renews_at >= now()
  AND s.renews_at <  now() + interval '30 days'
GROUP BY p.name
ORDER BY annual_value_usd DESC;

Result

Sample data: renewals due in the next 30 days, invented figures
PlanSubscriptionsAnnual value
Enterprise9$486,000
Team52$187,200
Starter140$50,400

Common pitfalls when asking Postgres questions

Each one is settled once in an approved definition, so every person and every assistant gets the same answer.

  • Querying the primary

    Long analytical queries on the primary compete with application traffic. Point the connection at a read replica where you have one.

  • timestamp versus timestamptz

    A timestamp without time zone is read as whatever zone the session uses. The definition fixes the reporting time zone, so day and month boundaries are stable.

  • Soft-deleted rows

    Many applications keep deleted rows with a deleted_at or status flag. A definition that forgets the filter counts records the application no longer shows.

How Nexatron connects to PostgreSQL

Whose permissions
Questions run through the connection's PostgreSQL account, so its grants are the outer limit. Inside that, Nexatron roles and the row policies your administrator defines decide what each person can see.
Read and write
Read-only. Nexatron reads PostgreSQL data to answer questions and never writes to PostgreSQL.
Setup
An administrator connects a database user with a username and password. Steps: choose the source → check prerequisites → enter connection details → verify → ask. No data migration and no pipeline to build: data is queried where it lives.

PostgreSQL MCP connector for Claude, ChatGPT and Copilot

Nexatron's hosted MCP server is a governed PostgreSQL MCP connector: Claude, ChatGPT and Microsoft Copilot ask questions of your PostgreSQL data through it. Each person signs in as themselves, so the assistant sees only what they may see.

Connect PostgreSQL to Claude, ChatGPT or Copilot

  1. Connect PostgreSQL to your Nexatron workspace.
  2. In Claude, add Nexatron from Claude's connector directory. In ChatGPT or Copilot, add a custom MCP connector with the server URL https://api.nexatron.io/api/v1/mcp.
  3. Sign in with your own Nexatron identity (OAuth 2.1), then ask your PostgreSQL questions.
How the Nexatron MCP server works

PostgreSQL connector FAQ

Can I ask PostgreSQL questions without writing queries?
Yes. The connector is available now. Ask in Teams, Slack, the Nexatron web app, or an AI assistant connected through Nexatron's MCP server.
Does Nexatron respect PostgreSQL permissions?
Yes. The PostgreSQL account's grants are the outer limit, and your row policies narrow it for each person.
Can Nexatron change data in PostgreSQL?
No. Nexatron only reads PostgreSQL data.
What do I need to connect PostgreSQL?
A database user and an administrator to connect it.
Is there a PostgreSQL MCP server for Claude, ChatGPT or Copilot?
Yes: Nexatron's hosted MCP server, once PostgreSQL is connected to your workspace. It is Nexatron's server, not one published by PostgreSQL, and the assistant gets the same governed answer as the Nexatron app.
Is Postgres a good source for analytics questions?
For operational questions about current orders, customers or subscriptions, yes. Heavy historical analysis often sits better in a warehouse. Nexatron connects to both, and each definition says which source a metric reads.
How do I keep AI-written SQL on Postgres safe?
Questions are read-only, and the connection's database user is the outer limit: grant it SELECT on only the schemas you want answered, ideally on a read replica. Every answer shows its SQL so it can be reviewed.

Try Nexatron on your own PostgreSQL data

A pilot starts with three questions your team already asks and the report you trust for each, so you can check the answers yourself.

PostgreSQL is a trademark of its owner. Nexatron is not affiliated with or endorsed by it; the name and mark identify the system Nexatron connects to.