Skip to main content

Peliqan

Postgres + Peliqan MCP

Ask Postgres anything with AI

Connect Postgres to Claude, ChatGPT or any MCP client. Ask questions in plain language, and join your tables with HubSpot, Stripe and 300+ other apps in one question.

Works with SOC 2 Type IIISO 27001GDPR
Claude Postgres via Peliqan
Which paying users from the last 30 days are not marked as customers in HubSpot?

38 of 147 paying users. The largest by yearly revenue:

AccountYearly revenueHubSpot stage
Brightlane€4,200Lead
Nordvik Labs€2,800SQL
Harbor & Co€1,950No stage
Which plan are those 38 on?

26 are on Pro and 12 on Team.

Example figures. On your account it runs on your own database and apps.

The answers are in Postgres, but only SQL gets them out

Your product data lives in Postgres. Asking it a business question still means writing a query.

Every question needs SQL

Sales, finance and support wait for someone who can write the query.

Postgres is half the picture

Users live in Postgres, deals in HubSpot, payments in Stripe. Real questions need them together.

Connection strings in AI configs

Self-hosted Postgres MCP servers, such as Postgres MCP Pro, take your database URL in the AI app's settings or environment.

One MCP server per source

A server for Postgres, another for the CRM, another for billing, each to set up and secure.

One MCP server for Postgres and 300+ other apps

Peliqan queries your database directly and joins it with your other apps in one MCP server.

Questions

Ask in plain language

Ask about users, orders, usage or anything in your tables. Your AI writes the SQL and gives you the answer.

Live

Your data stays in Postgres

Peliqan queries your database directly, so answers are live and nothing is copied.

300+ apps

Postgres plus the rest

Join your tables with HubSpot, Stripe or any other connected app in one question.

Your login

Credentials stay with us

Peliqan holds the database login, so your AI app and the AI vendor never see it.

What your AI can do

Your AI sees what Peliqan's database user can read, and nothing more.

AreaWhat your AI can do
Schemas and tablesSee the schemas, tables and columns you granted, to write the right query
Questions on your dataTurn plain-language questions into SQL with filters, joins and totals
Other appsJoin your tables with HubSpot, Stripe or any other connected app in one query
AccessRead only the schemas and tables you grant to Peliqan's database user
Need your AI to write to your database? Contact us.

What teams ask Postgres MCP

Four example questions. Each one is a single prompt.

Product

Signups and activity

"How many accounts signed up last week, and how many of them are active today?"
For product teams
Revenue

Plans against billing

"Compare the plan in our subscriptions table with Stripe and list the accounts that don't match."
For finance
Sales

CRM out of date

"Which paying users are not marked as customers in HubSpot?"
For RevOps
Support

Tickets per plan

"Which customers opened more than five Zendesk tickets this month, and what plan are they on?"
For support leads
Your AIClaude, ChatGPT, Gemini
Peliqan MCP serverOne URL for your database and every connected app
Your Postgres databaseQueried directly, nothing copied
Your other appsHubSpot, Exact Online and 300+ more, synced into Peliqan
How it works

Your AI asks, your database answers

  • Your data stays in Postgres

    Peliqan queries your database directly, so answers are live and nothing is copied into another data warehouse.

  • Your credentials stay with Peliqan

    You enter the connection once in Peliqan. Your AI app never sees the database login.

  • You decide what the AI can read

    Grant Peliqan's database user read access to the schemas you choose. The AI can't see anything else in your database.

Set up in three steps

Nothing to install, and no code to write.

Step 1

Connect Postgres

Create a read-only user for Peliqan, then add your host, database, user and password in Peliqan. See the Postgres setup guide.

Step 2

Add Peliqan to your AI

Add https://mcp.peliqan.io/mcp as a custom connector in Claude, ChatGPT or Gemini, then sign in to Peliqan.

Step 3

Ask your first question

For example: "How many accounts signed up last week, and how many are active today?"

Prefer a video? Watch how to connect Postgres to Claude.

Peliqan vs Postgres MCP Pro

As of October 2026 the reference server is archived. Postgres MCP Pro is open source and self-hosted.

Peliqan MCPPostgres MCP Pro
Who runs itPeliqan, nothing to installYou, with Docker or Python
Built forBusiness questions across your database and appsDatabase work: health checks, index tuning, query plans
Reads and writesQuestions, within the rights you grantRead-only or full read and write, by mode
Other apps in one query300+ in the same serverPostgres only
Where the credentials liveWith Peliqan, never in your AI appIn your own environment
Price€15 per connection per month, 7-day free trialFree and open source
If you need help tuning the database itself, a Postgres-specific server suits you better. Peliqan is for questions across your database and your other apps.

Want to see it on your own database?

Tell us what you want to ask your database, and we will show you on your own data. Or start a free trial.
Contact us Start for free 7-day free trial, no card needed

Postgres MCP, answered

What is a Postgres MCP server?
It is a Model Context Protocol server that lets AI apps such as Claude, ChatGPT and Gemini answer questions about the data in your Postgres database. Peliqan runs one for you, so there is nothing to install or host.
Does Peliqan copy my Postgres data?
No. Postgres is an external database connection in Peliqan: Peliqan queries your database directly, so answers are live and your data stays where it is.
How do I connect Postgres to Claude or ChatGPT?
Create a database user for Peliqan with read access to the schemas you want. Start a free trial on Peliqan and add a Postgres connection with your host, database, user and password. Then add https://mcp.peliqan.io/mcp as a custom connector in your AI app and sign in to Peliqan. In ChatGPT, custom connectors need a Business, Enterprise or Edu plan.
What can the AI see in my database?
Only what Peliqan's database user can read. Grant it USAGE on the schemas and SELECT on the tables you want the AI to use, and nothing else.
Can the AI write to my database?
The Postgres MCP is built for questions. If you need your AI to write to your database, contact us and we will look at your case.
Will AI questions slow down my database?
Each question runs a query on your database. If that is a concern, connect a read replica instead of your primary database.
Does it work with managed Postgres, such as Amazon RDS or Cloud SQL?
If Peliqan can reach the database with a host, user and password, it can connect. Peliqan tries SSL first. Add Peliqan's IP addresses if your database uses an allowlist.
How is this different from other Postgres MCP servers?
Self-hosted Postgres MCP servers connect your AI to one database and run where you host them. Supabase and Neon host servers for their own databases. Peliqan is hosted for you, keeps your credentials out of your AI app, and lets one question join your Postgres tables with HubSpot, Stripe or any of 300+ other apps.
What does it cost?
Peliqan MCP costs €15 per connection per month, with a 7-day free trial and no card needed. There is no charge per user, but each connection belongs to one user.

Postgres MCP connects your PostgreSQL database to AI assistants like Claude, Cursor, and ChatGPT through the Model Context Protocol – letting you query schemas, optimize indexes, and explore data using plain English instead of writing SQL from scratch.

PostgreSQL is the world’s most popular database among developers. In the 2025 Stack Overflow Developer Survey, 55.6% of respondents reported using Postgres – ahead of MySQL (40.5%) and every other database engine. With that kind of adoption, it was only a matter of time before the MCP ecosystem caught up.

And it has. There are now at least six production-grade Postgres MCP servers, ranging from Anthropic’s original (now archived) reference implementation to full-featured tools with index tuning, natural language agents, and multi-database support. The landscape moves fast, and choosing the right server for your setup matters more than most tutorials let on.

This guide covers every major Postgres MCP server available in 2026, walks through setup for Claude Desktop, Cursor, and Claude Code, explains the security issues you need to know about, and shows when a direct database connection isn’t enough – and what to do instead.

What is Postgres MCP?

MCP (Model Context Protocol) is an open standard created by Anthropic that lets AI applications connect to external data sources and tools through a unified interface. Think of it as a standardized bridge: the AI assistant on one side, your database on the other, with a well-defined protocol handling the communication.

Postgres MCP in plain terms

What it does: Exposes your PostgreSQL schema, tables, and query capabilities to AI assistants through a standardized server
How it works: An MCP server process connects to your Postgres instance and translates AI tool calls into SQL queries, returning results in a format the AI can interpret
What you get: Natural language database exploration, schema-aware query generation, performance analysis, and in some implementations, write access with approval workflows

A Postgres MCP server is a lightweight process that sits between your AI tool and your database. It reads your schema – tables, columns, primary keys, foreign keys, indexes, constraints – and makes that context available to the language model through MCP. When you ask a question like “which customers placed orders last month but haven’t ordered since,” the AI uses that schema context to generate and execute the right SQL.

Why Postgres and MCP matter together in 2026

PostgreSQL’s dominance keeps growing. Beyond the Stack Overflow survey numbers, over 73,000 companies now run PostgreSQL in production according to 6sense’s 2026 tracking data. The serverless PostgreSQL market alone is projected to reach $2.19 billion in 2026, growing at 28.1% year-over-year. Postgres isn’t just popular – it’s the default choice for new projects.

At the same time, MCP has become the standard way to connect AI assistants to external tools. Anthropic open-sourced the MCP specification in November 2024, and every major AI coding environment – Claude Desktop, Claude Code, Cursor, Windsurf, VS Code with Copilot – now supports it natively. The result is a natural pairing: the most-used database with the most-adopted AI integration standard.

For developers, this means you can stop context-switching between your AI assistant and a database client. Instead of copying schema information into a prompt, the MCP server provides that context automatically. Instead of manually running generated SQL in pgAdmin or psql, the AI can execute it directly and interpret the results. For DBAs, it means AI-assisted performance tuning, index recommendations, and health monitoring – all through conversational interfaces.

The Postgres MCP server landscape

The ecosystem has matured quickly. Here are the major Postgres MCP servers available in 2026, each with different strengths and trade-offs.

Official reference server (archived)

Anthropic’s original @modelcontextprotocol/server-postgres was one of the first MCP servers published. It provided basic read-only query access and schema introspection. However, Anthropic archived it on May 29, 2025 and moved it to the modelcontextprotocol/servers-archived repository.

Security warning – SQL injection in the original server

Datadog Security Labs discovered a SQL injection vulnerability that allows attackers to bypass the read-only restriction. By injecting COMMIT; DROP TABLE users; into a query, an attacker could execute arbitrary write operations. The npm package (v0.6.2, still seeing 21,000+ weekly downloads) remains unpatched. If you’re using @modelcontextprotocol/server-postgres, switch to an actively maintained alternative immediately. The patched fork by Zed Industries (@zeddotdev/postgres-context-server v0.1.4) fixes this specific vulnerability.

The original server is simple to set up (a single npx command) and still appears in most tutorials. But given the known vulnerability and archived status, it should only be used for local development databases where data loss is not a concern.

Postgres MCP Pro by Crystal DBA

With 2,400+ GitHub stars, Postgres MCP Pro is the most popular actively maintained Postgres MCP server. It’s built for the full development lifecycle – from initial coding through production tuning.

Postgres MCP Pro capabilities

Database health: Index health analysis, connection utilization, buffer cache metrics, vacuum health, sequence limits, and replication lag monitoring
Index tuning: Explores thousands of possible indexes using industrial-strength algorithms, with hypothetical index testing via hypopg
Query plans: EXPLAIN plan analysis, performance optimization suggestions, and simulated impact of proposed indexes
Schema intelligence: Context-aware SQL generation with full understanding of primary keys, foreign keys, indexes, column types, and constraints
Read/write access: Configurable access levels – read-only for safety or full write access when needed

Postgres MCP Pro uses psycopg3 with async I/O for high-performance connections. It also includes an experimental index tuning feature that leverages LLM-driven optimization – the server proposes index configurations, then uses hypopg to predict their performance impact before you create anything.

pgEdge Postgres MCP server

pgEdge’s implementation stands out for its natural language agent – a CLI and web UI that lets you query databases using plain English without even opening an AI coding tool. The server works with any standard PostgreSQL 14+, including community Postgres, Amazon RDS, Aurora, and Cloud SQL.

pgEdge MCP tools

query_database: Executes natural language queries translated to SQL
execute_sql: Runs SQL statements directly
get_schema_info: Returns full database structure with keys, indexes, and constraints
hybrid_search: BM25 + MMR semantic search across database content
generate_embedding: Creates vector embeddings for RAG workflows

pgEdge also supports multi-database connections from a single MCP server instance – useful when you need to query across dev, staging, and production environments. Security features include TLS support, user and token authentication, and read-only enforcement.

Other notable Postgres MCP servers

AWS Labs Aurora Postgres MCP is purpose-built for Amazon Aurora PostgreSQL clusters. It requires the RDS Data API to be enabled and integrates natively with AWS IAM for authentication. If your Postgres runs on Aurora, this is the most straightforward option.

MCP-PostgreSQL-Ops provides 30+ extension-independent tools focused on operations and monitoring. It covers performance analysis, table bloat detection, autovacuum monitoring, and schema introspection for PostgreSQL 12-18. Think of it as a DBA-focused MCP server.

HenkDz/postgresql-mcp-server consolidates 46 individual tools into 17 intelligent, multi-purpose tools. It covers schema management, data migration, query building, and debugging in a single package – good for developers who want an all-in-one solution.

Setting up Postgres MCP

Setup varies by server, but the pattern is the same: install the server, configure your AI client to use it, and provide a database connection string. Here are configs for the most popular options.

Postgres MCP Pro with Claude Desktop

Install via pip (recommended) or Docker. Then add the server to your Claude Desktop configuration:

{
  "mcpServers": {
    "postgres-mcp-pro": {
      "command": "uvx",
      "args": [
        "postgres-mcp",
        "--access-mode=unrestricted",
        "--connection-url",
        "postgresql://user:password@localhost:5432/mydb"
      ]
    }
  }
}

Set --access-mode=unrestricted for full read/write access during development, or --access-mode=restricted for read-only access in production environments. The server also supports Docker deployment for isolated environments:

docker run -i --rm \
  crystaldba/postgres-mcp \
  --access-mode=restricted \
  --connection-url postgresql://user:password@host:5432/mydb

pgEdge with Cursor

Clone and build the pgEdge server, then add it to your Cursor MCP settings (accessible via Cmd+Shift+P > MCP Settings):

{
  "mcpServers": {
    "pgedge-postgres": {
      "command": "node",
      "args": ["/path/to/pgedge-postgres-mcp/build/index.js"],
      "env": {
        "DATABASE_URL": "postgresql://user:password@localhost:5432/mydb"
      }
    }
  }
}

For multi-database setups, pgEdge supports additional connection strings through environment variables – one server instance can manage connections to multiple Postgres instances.

Claude Code configuration

Claude Code reads MCP configuration from .mcp.json in your project root or ~/.claude/mcp.json globally. The same JSON structure applies – just place it in the right file. For building custom MCP servers tailored to your specific schema or business logic, the MCP specification provides a straightforward Python or TypeScript SDK.

Quick-start with npx (development only)

The fastest way to try Postgres MCP is still the original npm package, but use it only for local, disposable databases:

{
  "mcpServers": {
    "postgres": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-postgres",
        "postgresql://user:password@localhost:5432/mydb"
      ]
    }
  }
}

This works for a quick proof of concept. But for anything beyond a throwaway local database, switch to Postgres MCP Pro or pgEdge – they’re more capable and don’t carry the known SQL injection vulnerability.

Security considerations

Connecting an AI assistant to a live database introduces real risks. The SQL injection vulnerability in Anthropic’s original server is a cautionary tale, but it’s not the only concern.

Credential management

Never hardcode database credentials in MCP configuration files that get committed to version control. Use environment variables or a secrets manager. Most Postgres MCP servers support DATABASE_URL as an environment variable – use it.

Read-only users

Create a dedicated read-only PostgreSQL role for your MCP server. Even if the server enforces read-only mode at the application layer, a database-level restriction provides defense in depth:

CREATE ROLE mcp_readonly WITH LOGIN PASSWORD 'secure_password';
GRANT CONNECT ON DATABASE mydb TO mcp_readonly;
GRANT USAGE ON SCHEMA public TO mcp_readonly;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO mcp_readonly;
ALTER DEFAULT PRIVILEGES IN SCHEMA public
  GRANT SELECT ON TABLES TO mcp_readonly;

Network isolation

Run MCP servers in the same network as your database to avoid exposing database ports to the internet. For cloud deployments, use VPC peering or private endpoints. Enable SSL/TLS in your connection strings (?sslmode=require) for any non-local connections.

Query validation

Some MCP servers (like Postgres MCP Pro) validate queries before execution. But no validation layer is perfect – the Datadog vulnerability proved that. Layer your defenses: application-level read-only mode, database-level role restrictions, and network isolation working together.

Common use cases

Here’s how teams are actually using Postgres MCP in their daily workflows.

Developer workflow acceleration

Instead of switching between your IDE and a database client, you can ask your AI assistant directly: “Show me the schema for the orders table and its relationships” or “Write a query to find customers who signed up last quarter but never placed an order.” The MCP server provides the schema context that makes these queries accurate without you manually describing your database structure.

This is especially valuable for developers joining a new codebase. Rather than digging through migration files or ER diagrams, you can explore the database conversationally – “What tables reference the users table?” or “Show me all columns in the payments schema with their types and constraints.”

DBA performance tuning

Postgres MCP Pro’s index tuning and health analysis features turn AI assistants into database tuning partners. You can ask for a full health check, and the server will analyze buffer cache hit ratios, vacuum health, connection utilization, replication lag, and sequence limits – then surface the issues that need attention.

The experimental index tuning feature is particularly interesting: it proposes index configurations based on your workload, then uses hypopg to simulate their performance impact without creating real indexes. This lets you validate improvements before applying them in production.

Data exploration and ad hoc analysis

Non-technical team members can query production data through conversational interfaces. A product manager asking “What’s the average time between signup and first purchase, broken down by acquisition channel?” gets an answer without writing SQL or filing a ticket with the data team. Combined with data lineage tracking, you can trace exactly where each data point originates.

Schema migration and documentation

Use Postgres MCP to generate migration scripts, compare schemas across environments, or auto-document your database structure. The pgEdge server’s multi-database support makes it easy to ask “What’s different between the dev and staging schemas?” and get a concrete answer.

Automation and workflow integration

Postgres MCP servers can also be integrated into automation platforms. Tools like n8n and Make support MCP connections, meaning you can build workflows where AI agents query your database as part of larger automation pipelines – monitoring for anomalies, generating daily summaries, or triggering alerts based on data conditions. The combination of MCP with workflow automation opens up use cases that go beyond interactive querying into scheduled, event-driven data operations.

Troubleshooting common issues

When things go wrong with Postgres MCP, here are the most common culprits and fixes.

Connection refused errors

If the MCP server can’t connect to your database, check the basics: is the PostgreSQL service running? Is the connection string correct (host, port, database name, credentials)? For remote databases, verify that your pg_hba.conf allows connections from the MCP server’s IP address. Cloud-hosted databases often require SSL – add ?sslmode=require to your connection string.

Schema not appearing in AI context

Some servers cache schema information on startup. If you’ve recently altered tables or added new ones, restart the MCP server process. Postgres MCP Pro supports dynamic schema refresh, but the original reference server does not.

Slow query responses

Large result sets can cause timeouts. Most AI clients have a response size limit, and MCP servers typically impose row limits on queries. If you’re getting timeouts, try adding LIMIT clauses to your queries or ask the AI to aggregate data rather than return raw rows. For truly large datasets, consider materializing frequently queried views into summary tables.

Permission denied on pg_stat_statements

Performance analysis tools in Postgres MCP Pro and MCP-PostgreSQL-Ops rely on pg_stat_statements. If you see permission errors, make sure the extension is installed and your MCP database role has access:

CREATE EXTENSION IF NOT EXISTS pg_stat_statements;
GRANT pg_read_all_stats TO mcp_readonly;

Limitations to keep in mind

When one database isn’t enough

Direct Postgres MCP works well when your data lives in a single database. But real-world analytics rarely stop at one source.

A typical business might run PostgreSQL for its application database, HubSpot for CRM, Shopify for e-commerce, and Exact Online for accounting. Asking “What’s the lifetime value of customers acquired through our last email campaign?” requires joining data across all four systems. No Postgres MCP server can answer that question because the data doesn’t all live in Postgres.

This is where the “just connect MCP to my database” approach breaks down. You end up with separate MCP servers for each data source, each with its own connection, its own schema context, and no way to run cross-source queries. The AI assistant can query each system independently but can’t combine the results into a unified answer.

There’s also the governance gap. When AI agents query production databases directly, there’s no semantic layer defining what “revenue” means across systems, no data quality checks before the AI sees the data, and no audit trail of what was queried. For teams dealing with financial data, customer PII, or regulated industries, these gaps aren’t optional – they’re compliance requirements.

The managed alternative – Peliqan as your Postgres MCP layer

Instead of connecting AI directly to your database, you can route everything through a data platform that syncs, governs, and exposes your data via MCP. This is the approach Peliqan takes with PostgreSQL and 250+ other connectors.

How Peliqan’s MCP architecture works

Step 1: Connect your data sources – Postgres, HubSpot, Shopify, Exact Online, or any of 250+ supported connectors
Step 2: Peliqan syncs all data into its built-in warehouse (Postgres + Trino), running transformations to clean and standardize it
Step 3: The Peliqan MCP server (pip install mcp-server-peliqan) exposes the governed warehouse to AI agents
Step 4: AI assistants query the unified warehouse – cross-source joins, text-to-SQL, and writeback all work through a single MCP connection

The AI agent never connects directly to your Postgres instance. Instead, it queries Peliqan’s warehouse where your Postgres data has been synced, cleaned, and combined with data from every other connected source. Cross-source queries work because all data lives in one governed warehouse.

For teams that also need BI dashboards alongside AI access, Peliqan connects to Power BI, Metabase, Looker Studio, and other visualization tools – all reading from the same warehouse. Your dashboards and AI agents always work with the same data, governed by the same quality checks and access controls.

Real-world example: CIC Hospitality

CIC Hospitality consolidated 50+ data sources through Peliqan, saving 40+ hours per month on board report automation. Rather than connecting separate MCP servers to each source, all data flows through one governed warehouse – with AI agents, dashboards, and reverse ETL all reading from the same layer. Read the full case study.

Peliqan is SOC 2 Type II certified, ISO 27001 compliant, GDPR-ready, and EU-hosted. The MCP server supports both read and write operations (full writeback) across all connected sources – so an AI agent can not only query your data but also push updates back to source systems through Peliqan’s connectors.

Comparison: direct Postgres MCP vs. managed approach

Criteria Direct Postgres MCP Peliqan MCP
Setup time 30-60 minutes 1-2 hours (includes connector setup)
Data sources Single Postgres database 250+ connectors including Postgres
Cross-source joins Not possible Yes – all data in one warehouse
Data governance None built-in Lineage, quality monitoring, semantic models
Security Database credentials in config files SOC 2 Type II, ISO 27001, GDPR
BI tool access Separate setup required Same warehouse powers AI and BI
Writeback Depends on server (risk of SQL injection) Full writeback through governed connectors
Best for Single-database dev workflows Multi-source analytics and production AI

Decision framework

Which approach fits your situation

Getting started

For a direct Postgres MCP connection, start with Postgres MCP Pro – it’s the most actively maintained, has the largest community, and provides the best combination of safety features and DBA-grade tooling. Install it, point it at a development database, and start exploring.

If your data lives across multiple systems and you need governed, cross-source access for AI agents, try Peliqan free – it connects your Postgres instance alongside every other data source, syncs everything into one warehouse, and exposes it all through a single MCP server. Setup takes under two hours, and you get BI, AI, and reverse ETL from the same platform.