MCPNav
P

PostgreSQL

Featured

MCP server · by modelcontextprotocol

Databases
npm
v0.6.2

Connect the model to a PostgreSQL database with read-only access so it can inspect schemas and run queries safely.

Install

Run one of the commands below, then add the client config underneath.

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

Client configuration

Paste into Claude Desktop, Cursor (mcp.json), VS Code or any MCP client, then restart the client.

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

About this server

PostgreSQL is listed in the Databases category of the MCPNav directory. It is distributed as npm and can be loaded by any client that speaks the Model Context Protocol.

Typical uses include giving your assistant scoped access to the corresponding service so it can answer questions and take actions with real data instead of guessing. Always review what a server can access before you enable it — see our MCP security guide.

Frequently asked questions

What is the PostgreSQL MCP server?

PostgreSQL is an MCP server by modelcontextprotocol. Connect the model to a PostgreSQL database with read-only access so it can inspect schemas and run queries safely.

How do I install PostgreSQL?

Install it with: npx -y @modelcontextprotocol/server-postgres postgresql://localhost/mydb. Then add the JSON config to your client's MCP settings and restart the client.

Is PostgreSQL free to use?

The MCP server itself is free to install. The source is public on https://github.com/modelcontextprotocol/servers. Any third-party API it calls (such as a search or maps API) may require its own key and billing.

Which clients support PostgreSQL?

Any MCP-compatible client can use it, including Claude Desktop, Cursor, VS Code, Windsurf and custom agents.