Grok can't run a local MCP server, and almost every Postgres MCP package is one. That leaves a hosted route: Contextflo connects to your Postgres once and gives Grok a public URL it can add as a custom connector.
Postgres MCP servers are normally started on your own machine with npx. Grok connectors don't work that way. They need a server reachable on the public internet. A server on your laptop is not.
Option 1: a Postgres MCP server in Grok
There is no hosted Postgres MCP server from Postgres itself to point Grok at. The options that exist are local:
@contextflo/postgres-mcp(MIT, read-only enforced in four layers):npx -y @contextflo/postgres-mcp postgresql://contextflo_ro:pass@replica-host:5432/mydb@bytebase/dbhub
Both are stdio servers. They work in clients that launch local processes, and they do not work in Grok. If you put one behind a public URL yourself, you are now running and securing a database-facing service on the internet. That is a bad trade for a chat question.
One warning: skip the archived @modelcontextprotocol/server-postgres. It has a SQL-injection bypass.
Option 2: Contextflo
On the Postgres side, create a read-only role. Point it at a read replica if you have one.
CREATE ROLE contextflo_ro LOGIN PASSWORD '<generated>';
GRANT CONNECT ON DATABASE mydb TO contextflo_ro;
GRANT USAGE ON SCHEMA public TO contextflo_ro;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO contextflo_ro;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO contextflo_ro;
In Contextflo: go to Data Sources, then Add data source, and pick Postgres. Paste a postgresql:// connection string for that role. Pick the tables to expose and invite your team.
In Grok:
- Open grok.com/connectors.
- Choose New Connector, then Custom.
- Enter
https://mcp.contextflo.com/mcp. - Complete the sign-in.
Each person signs in with their own Contextflo account. Contextflo runs SELECT only.
What you get that a bare connection doesn't
A Postgres database has no descriptions of its own. status = 3 means something to your team and nothing to Grok. Contextflo generates table and column descriptions, and your team saves corrections and definitions so the answers match what you report internally.
Postgres itself logs queries in pg_stat_statements, but that is the query text, not the person. Contextflo keeps an audit trail of prompts and the SQL that ran, per person, and controls which tables each person can see.
Which one to use
For Grok, there is one practical choice: the hosted one. If you also use Claude, desktop and CLI clients can run local servers, and the options are compared in connecting Claude to Postgres and the best Postgres MCP servers.
You do the modeling, we do the rest. Connect Postgres free.
FAQ
Can Grok connect to a local Postgres MCP server? No. Grok connectors only reach MCP servers on the public internet. Grok can't run a local stdio server and can't reach localhost, which rules out packages like @contextflo/postgres-mcp or dbhub running on your machine.
Which Postgres hosts work with Contextflo? RDS, Supabase, Neon, Cloud SQL, Azure, Railway, Render and self-hosted Postgres. Contextflo takes a postgresql:// connection string.
Should I point Grok at my production Postgres? Point Contextflo at a read replica with a role that only has SELECT. Contextflo runs SELECT only, and the role underneath should enforce the same thing.
Is the old @modelcontextprotocol/server-postgres package safe? No. It is archived and has a known SQL-injection bypass, so don't use it.
See it on your own data.
Connect your warehouse and your team can ask Claude about it the same day, without waiting on a data team. Want a walkthrough first? Grab 20 minutes.
Book a 20-minute callSee how teams use Contextflo
Related posts
Keep reading

Conversational analytics: 5 ways to set it up, compared
7 min read

How to connect Claude to BigQuery? What works and what doesn't in 2026
8 min read

How to connect Claude to Postgres without giving it write access
9 min read

How to build a BI dashboard with Claude that your team can actually trust
8 min read

How to give Claude read-only access to your database (it isn't always the default)
7 min read

You connected your warehouse to Claude, now what?
5 min read

ClickHouse MCP: how to connect ClickHouse to Claude, Cursor or Codex
6 min read

Query BigQuery from the Codex CLI with MCP
5 min read

Run ClickHouse queries from Codex with MCP
6 min read

