Server Postgres logo

Server Postgres

by modelcontextprotocol

PostgreSQL database integration with schema inspection and query capabilities

  • Ownership verifiedThe owner proved control of this listing via a GitHub README, site badge, or DNS TXT record.
  • UnverifiedWe have not yet confirmed this server installs or runs.
  • Health: Not checked yetWe have not completed a health check for this listing yet.Last checked 8/2/2026, 4:17:50 PM
  • Databases
  • 293stars
  • No ratings User RatingsBe the first to rate and review this MCP server!
  • 1installs
  • UpdatedJul 28, 2026
  • Enrichment pendingWe haven’t run our AI enrichment pass on this listing yet, so the overview, use cases, and FAQ below may be sparse or missing. We work through the catalog over time — check back soon.

Install Server Postgres

Pick your client, then add it in one click or paste the config.

No confirmed install command yet

We only publish a config when the install details come from the project itself — its README, its docs, or a verified owner. We haven’t found those for modelcontextprotocol/server-postgres, and we’d rather show nothing than a guess you’d paste into your client.

Open setup steps on GitHub

Overview

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

Not checked yetLast checked 3mo ago

We have not completed a health check for this listing yet.

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars293Stargazers on the source repository.
Directory activity1 installs · 1 upvotesConfig copies, upvotes, and views on AllMCPs.

From the project README

PostgreSQL

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.

Components

Tools

  • query
    • Execute read-only SQL queries against the connected database
    • Input: sql (string): The SQL query to execute
    • All queries are executed within a READ ONLY transaction

Resources

The server provides schema information for each table in the database:

  • Table Schemas (postgres://<host>/<table>/schema)
    • JSON schema information for each table
    • Includes column names and data types
    • Automatically discovered from database metadata

Configuration

Usage with Claude Desktop

To use this server with the Claude Desktop app, add the following configuration to the "mcpServers" section of your claude_desktop_config.json:

Docker

  • when running docker on macos, use host.docker.internal if the server is running on the host network (eg localhost)
  • username/password can be added to the postgresql url with postgresql://user:password@host:port/db-name
config.json
{
  "mcpServers": {
    "postgres": {
      "command": "docker",
      "args": [
        "run", 
        "-i", 
        "--rm", 
        "mcp/postgres", 
        "postgresql://host.docker.internal:5432/mydb"]
    }
  }
}

NPX

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

Replace /mydb with your database name.

Usage with VS Code

For quick installation, use one of the one-click install buttons below...

Install with NPX in VS Code Install with NPX in VS Code Insiders

Install with Docker in VS Code Install with Docker in VS Code Insiders

For manual installation, add the following JSON block to your User Settings (JSON) file in VS Code. You can do this by pressing Ctrl + Shift + P and typing Preferences: Open User Settings (JSON).

Optionally, you can add it to a file called .vscode/mcp.json in your workspace. This will allow you to share the configuration with others.

Note that the mcp key is not needed in the .vscode/mcp.json file.

Docker

Note: When using Docker and connecting to a PostgreSQL server on your host machine, use host.docker.internal instead of localhost in the connection URL.

config.json
{
  "mcp": {
    "inputs": [
      {
        "type": "promptString",
        "id": "pg_url",
        "description": "PostgreSQL URL (e.g. postgresql://user:pass@host.docker.internal:5432/mydb)"
      }
    ],
    "servers": {
      "postgres": {
        "command": "docker",
        "args": [
          "run",
          "-i",
          "--rm",
          "mcp/postgres",
          "${input:pg_url}"
        ]
      }
    }
  }
}

NPX

config.json
{
  "mcp": {
    "inputs": [
      {
        "type": "promptString",
        "id": "pg_url",
        "description": "PostgreSQL URL (e.g. postgresql://user:pass@localhost:5432/mydb)"
      }
    ],
    "servers": {
      "postgres": {
        "command": "npx",
        "args": [
          "-y",
          "@modelcontextprotocol/server-postgres",
          "${input:pg_url}"
        ]
      }
    }
  }
}

Building

Docker:

Terminal
docker build -t mcp/postgres -f src/postgres/Dockerfile . 

License

This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository.

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Server Postgres

We don't have a confirmed install command for modelcontextprotocol/server-postgres yet, so we don't publish a generated one — a guessed package name would point at the wrong package or none at all. Follow the project's own README or setup instructions (https://github.com/modelcontextprotocol/servers-archived/tree/main/src/postgres) for the current steps.

PostgreSQL database integration with schema inspection and query capabilities

We don't have confirmed pricing for modelcontextprotocol/server-postgres. Listing it on AllMCPs is free, but that says nothing about what the server itself costs — check the project's own site for current pricing.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewServer Postgres AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/modelcontextprotocol-server-postgres?style=directory)](https://allmcps.com/mcp/modelcontextprotocol-server-postgres)
HTML Embed
<a href="https://allmcps.com/mcp/modelcontextprotocol-server-postgres"><img src="https://allmcps.com/api/badge/modelcontextprotocol-server-postgres?style=directory" alt="Server Postgres on AllMCPs" /></a>