My Postgres MCP Server

MCP server for interacting with PostgreSQL databases

Local serverstdio

What is the My Postgres MCP MCP server?

Most database access work still happens through a UI a human drives. My Postgres MCP MCP server moves it into the conversation instead. MCP server for interacting with PostgreSQL databases.

The short version

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.

Getting it running

Setup follows the usual MCP pattern — install or clone the server, register it in your client's configuration file, restart the client. The configuration blocks on this page cover the common clients.

The tools it exposes

The server publishes 4 tools. What each one is for:

  • query — Execute read-only SQL queries against the connected database
  • Input — sql (string): The SQL query to execute
  • Tools — The Tools tool exposed by this server
  • Resources — The server provides schema information for each table in the database:

Things to watch

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • Keep per-call confirmation enabled while you learn its behaviour; it is the cheapest safeguard you have.

How it compares

Among the database access options, the useful question is rarely "what can it do" but "what does it cost you to run" — permissions, credentials, and how much of your context its toolset consumes. My Postgres MCP's toolset — query, Input, Tools and 1 more — is a fair guide to whether it matches your workflow. It is maintained by hsinyuyen; worth a glance at recent repository activity before you build anything load-bearing on it.

This entry was verified against My Postgres MCP's own documentation before publication; SyncDev keeps the directory reviewed rather than auto-generated.

Available tools

ToolWhat it does
queryExecute read-only SQL queries against the connected database
Inputsql (string): The SQL query to execute
ToolsThe Tools tool exposed by this server.
ResourcesThe server provides schema information for each table in the database:

How to install the My Postgres MCP MCP server

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

Configuration as documented by the project. Restart the client after saving.

Example prompts to try

  • Use My Postgres MCP to query.
  • Use My Postgres MCP to Input.
  • Use My Postgres MCP to Tools.

Frequently asked questions

It connects My Postgres MCP to MCP-compatible AI assistants such as Claude and Cursor, exposing 4 tools (query, Input, Tools, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with My Postgres MCP directly.