Postgres MCP Server

⏱️ 25 sec read 🔌 MCP Server

What it is: The reference Postgres server from the official modelcontextprotocol/servers repo. It exposes read-only SQL execution and schema introspection over MCP, so any compatible agent can list tables, fetch column metadata, and run queries.

Why it matters for data work

The single fastest way to make a coding agent useful against your application database. No need to paste schemas in by hand or build a custom tool — the MCP server handles introspection and Claude figures out the right query.

Install & configure

npx -y @modelcontextprotocol/server-postgres postgresql://localhost/mydb

Then add to your Claude Code MCP config:

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

Example usage

Ask Claude "which customers signed up last week and haven't placed an order?" — it'll inspect your schema via the MCP server, write the join, run it, and summarize the results. All in one turn.

Author & links

Author: Model Context Protocol project (Anthropic-maintained)

Repo: github.com/modelcontextprotocol/servers

License: MIT

Related skills

For warehouse work see BigQuery MCP server. For dbt-aware semantic context, layer on the dbt MCP skill.

← Back to MCP Servers