Postgres MCP Server

Provides read-only access to PostgreSQL databases for Large Language Models, enabling schema inspection and query execution.

Local serverstdio★ 1

What is the Postgres MCP Server?

Provides read-only access to PostgreSQL databases for Large Language Models, enabling schema inspection and query execution.

What it actually does

A Model Context Protocol server that provides read-only access to PostgreSQL databases. This server enables LLMs to inspect database schemas and execute read-only queries.

More MCP options

Compare MCP servers by category, or browse hosted MCP servers if you prefer an endpoint over a local process.

Recorded tools

Check the linked publisher documentation and your connected client's tool list. Names and availability can vary with the server version and account permissions.

ToolWhat it does
queryExecute read-only SQL queries against the connected database

How to install the Postgres MCP Server

{
  "mcpServers": {
    "postgres": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "mcp/postgres",
        "postgresql://host.docker.internal:5432/mydb"
      ]
    }
  }
}

From the project documentation. Replace placeholders and example paths before connecting.

Example prompts to try

  • “Use Postgres to query.”
  • “Use Postgres to Input.”
  • “Use Postgres to Tools.”

Frequently asked questions

It supports read-only SQL SELECT queries. Data manipulation queries such as INSERT, UPDATE, and DELETE are not permitted.