PostgreSQL
PostgreSQL MCPData & Enrichment8 actions

PostgreSQL MCP Server

Let your AI agents run PostgreSQL for you, safely.

A hosted PostgreSQL MCP server for Claude, ChatGPT, Cursor and CLI agents. Paste one server URL into your AI client to use its 8 actions. There is nothing to install.

  • Enable or disable every action, per account. Block your agent from doing dangerous actions.

  • Ask in plain English. Pull reports, find insights and take action in PostgreSQL.

  • 8 read and write actions. Every PostgreSQL task your agent needs, from reporting to making changes.

  • Built for teams. Invite your team and share one connected account.

Works with
ChatGPTChatGPTClaudeClaudeClaude CodeClaude CodeCodexCodexGemini CLIGemini CLICursorCursorMistralMistralOpenClawOpenClawHermesHermesPerplexityGrokn8nWindsurfVS CodeZed
ChatGPT
PostgreSQL
ChatGPT
connected to PostgreSQL MCP
Online
ChatGPT
Actions

Available Actions

8 actions available to automate your PostgreSQL workflows.

8 actions

PostgreSQL
Read

Analyze Db Health

Report database health (connections, vacuum age, replication slots, cache hit rates, invalid constraints).

PostgreSQL
Read

Explain Query

Return the EXPLAIN plan for a query. Set analyze=true for EXPLAIN ANALYZE (actually runs the query).

PostgreSQL
Read

Get Table Metadata

Full metadata for a table or view: columns, constraints, indexes, estimated row count, size.

PostgreSQL
Read

Get Table Schema

Return the column list (name, data_type, is_nullable, default) for a table or view.

PostgreSQL
Read

Get Top Queries

Slowest or most resource-intensive queries from the pg_stat_statements extension.

PostgreSQL
Read

List Schemas

List all schemas in the connected database.

PostgreSQL
Read

List Tables

List tables, views, sequences, or extensions in a schema.

PostgreSQL
Write

Run Query

Execute a SQL statement against the connected database.

Overview

What you can do with the PostgreSQL MCP

The InsightfulPipe PostgreSQL MCP server is a hosted Model Context Protocol server that connects a PostgreSQL database to AI assistants such as Claude, ChatGPT, Cursor, Claude Code, Gemini CLI and Codex. You enter the host, port, database, user and password, or paste a connection URI, and add one server URL to your AI client.

ClaudePostgreSQLAcme StoreRead-only
Ask about your PostgreSQL account…
01Explore an unfamiliar database

Explore an unfamiliar database

List schemas and tables, and read columns, constraints, indexes and sizes before writing a query.

See all PostgreSQL actions
ClaudePostgreSQLAcme StoreRead-only
Ask about your PostgreSQL account…
02Answer business questions with SQL

Answer business questions with SQL

Ask in plain English; the assistant writes the query, runs it with parameters and summarizes the result.

See all PostgreSQL actions
ClaudePostgreSQLAcme StoreRead-only
Ask about your PostgreSQL account…
03Tune slow queries

Tune slow queries

Find the heaviest queries from pg_stat_statements and read their EXPLAIN plans to spot missing indexes.

See all PostgreSQL actions
8
actions
one server URL
7
read actions
reports, audits, research
1
write actions
create, update, manage
Setup

How to connect the PostgreSQL MCP server

Add the server URL to your AI client, then sign in with your InsightfulPipe account to authorize access. The server is hosted, so there is nothing to install.

MCP server URL

https://postgresql.insightfulmcp.com/

Connect PostgreSQL to Claude

Fastest: add InsightfulPipe from the Claude Directory

One click connects the full InsightfulPipe MCP with all your connected accounts. To add a server scoped to PostgreSQL only, follow the steps below.

Open Claude Directory

Or add the PostgreSQL server manually:

  1. 01
    Copy the server URL:
    https://postgresql.insightfulmcp.com/
  2. 02
    Open Claude connector settings (Customize > Connectors), click + and then Add custom connector.
  3. 03
    Paste the URL and click Add.
  4. 04
    Click Connect, then click Authorize access in the browser.

Start a new chat, click +, open Connectors and turn the connector on to use it.

The Free plan can add one custom connector. On Team and Enterprise plans, an Owner first adds it under Organization settings > Connectors, then each member clicks Connect in Customize > Connectors.

Watch the setup tutorial

Playbook

Prompts and skills that run on the PostgreSQL MCP

Copy a prompt into any connected client, or install a Claude skill that chains the actions for you.

Prompt

“List the tables in the public schema”

Lists tables in a schema

Prompt

“What columns and indexes does the orders table have?”

Reads table metadata

Prompt

“How many new customers signed up each week this quarter?”

Writes and runs a SELECT query

Prompt

“Which queries use the most total execution time?”

Reads top queries from pg_stat_statements

Prompt

“Show the query plan for this report query”

Runs EXPLAIN without executing the query

Prompt

“Check vacuum age and cache hit rate for this database”

Runs the database health report

Prompt

“Are there any invalid constraints?”

Runs the constraint health check

HAVE QUESTIONS?

Frequently asked questions

A PostgreSQL MCP server connects a PostgreSQL database to AI assistants through the Model Context Protocol (MCP), an open standard for giving AI tools access to data and actions. Once connected, you can ask Claude, ChatGPT or Cursor to explore the schema, run SQL and diagnose performance.

Ready to connect your data?

Join hundreds of agencies and brands using InsightfulPipe to connect marketing data to AI.

Start a trial today.