AA
AEO Score: 0.90 / 1.00

PostgreSQL MCP

Database
Very Good — Strong agent support with minor gaps
Agent Ready
✓ Verified
MCP Type
Official MCP
Success Rate
🔴 Low
Agent Activity
● New
Recipes

Get Full Integration Guide

Current auth setup, endpoints, rate limits, known pitfalls, and step-by-step recipes — kept fresh from registry checks, curated official-doc guides, and agent reports.

npx @kansei-link/mcp-server

Then use: search_servicesget_service_detail

How to Connect PostgreSQL MCP to an AI Agent

Auth setup

1. Create a read-only Postgres role: CREATE ROLE agent_ro LOGIN PASSWORD '...'; GRANT pg_read_all_data TO agent_ro; 2. Connection string: postgres://agent_ro:***@host:5432/db. 3. Run: npx @anthropic/postgres-mcp 'postgres://...' — the server enforces read-only at the protocol level.

Key facts

Base URLhttps://www.postgresql.org/docs/current/libpq.html
API versionPostgreSQL protocol (MCP server wraps libpq)
AuthConnection string with PostgreSQL credentials (user/password/host/db). The official MCP server by Anthropic (npx @anthropic/postgres-mcp) is strictly read-only and accepts a PostgreSQL connection URL as its argument. Authentication is delegated to Postgres itself (password, scram, client cert, or peer).
Scopesread-only (enforced by MCP server — no INSERT/UPDATE/DELETE)
Request bodyMCP tool call (JSON-RPC over stdio)
PaginationSQL LIMIT/OFFSET in query text. No built-in pagination at the MCP layer.
Rate limitNo MCP-level rate limit. Postgres-side: respect statement_timeout, max_connections, and any pg_stat_statements throttling. Agents should honor statement_timeout (recommended 30s) to prevent runaway queries.
Error formatSQL errors returned as JSON: {"error":{"code":"42P01","message":"relation \"x\" does not exist","position":"15"}}

Key endpoints

MethodPathDescription
TOOLqueryExecute a read-only SQL query and return rows. Blocks any statement that isn't SELECT/WITH.
TOOLlist_schemasList all schemas in the database (excluding system schemas)
TOOLlist_tablesList tables in a given schema with row count estimates
TOOLdescribe_tableGet columns, types, constraints, and indexes for a table

Quickstart

Tool call: {"name":"query","arguments":{"sql":"SELECT table_name, n_live_tup FROM pg_stat_user_tables ORDER BY n_live_tup DESC LIMIT 10"}}

Response: [{"table_name":"orders","n_live_tup":1234567},...]

Agent pitfalls & tips

Source: curated by KanseiLink from official documentation (docs) and registry checks. Last reviewed: 2026-04-10. Specs change — verify against the official docs before production use.

Frequently Asked Questions

What is PostgreSQL MCP's AEO score?
PostgreSQL MCP has an AEO score of 0.90 and is rated AA (Strong agent support with minor gaps). AEO (Agent Engine Optimization) measures how well a SaaS service works with AI agents. Scores range from 0.00 to 1.00, with grades from AAA (best) to D (not agent-ready).
Is PostgreSQL MCP AI-agent-ready?
PostgreSQL MCP is currently ✓ verified for AI agent use. It offers an official MCP (Model Context Protocol) server, which means AI agents can connect directly. For detailed connection guides, auth setup, and known pitfalls, use the KanseiLink MCP tool.
How does PostgreSQL MCP compare to other Database services?
In the Database category, PostgreSQL MCP is rated AA. KanseiLink evaluates services based on MCP availability, API quality, documentation, auth-guide clarity, and integration recipe availability (methodology published). Visit the full rankings at kansei-link.com to see how PostgreSQL MCP compares.
How can I integrate PostgreSQL MCP with an AI agent?
The fastest way to integrate PostgreSQL MCP with an AI agent is through KanseiLink MCP. Install it with: npx @kansei-link/mcp-server — then use the search_services and get_service_detail tools to get the current auth setup, endpoints, rate limits, and agent-specific tips. This data is kept fresh from registry checks, curated official-doc guides, and agent reports.
How do I authenticate with PostgreSQL MCP?
Connection string with PostgreSQL credentials (user/password/host/db). The official MCP server by Anthropic (npx @anthropic/postgres-mcp) is strictly read-only and accepts a PostgreSQL connection URL as its argument. Authentication is delegated to Postgres itself (password, scram, client cert, or peer). Setup: 1. Create a read-only Postgres role: CREATE ROLE agent_ro LOGIN PASSWORD '...'; GRANT pg_read_all_data TO agent_ro; 2. Connection string: postgres://agent_ro:***@host:5432/db. 3. Run: npx @anthropic/postgres-mcp 'postgres://...' — the server enforces read-only at the protocol level.
What are PostgreSQL MCP's API rate limits?
No MCP-level rate limit. Postgres-side: respect statement_timeout, max_connections, and any pg_stat_statements throttling. Agents should honor statement_timeout (recommended 30s) to prevent runaway queries.