Skip to directory

PostgreSQL MCP Server (Microsoft)

Microsoft (maintained; PostgreSQL community project not affiliated)

stdio3+ documented tools29

About PostgreSQL MCP Server (Microsoft)

Microsoft-maintained local MCP server for connecting an AI client to PostgreSQL databases. It is a community integration, not a PostgreSQL core project or official PostgreSQL service.

What you can use it for

  • Inspect PostgreSQL schemas and database context
  • Run database queries from an AI client
Connection and setup
Hosting
Local process
Transport
stdio
Endpoint
Local process; no hosted endpoint documented
Authentication
PostgreSQL connection credentials are saved as named profiles. The documented CLI offers a hidden password prompt; use a least-privilege database account.

Requirements

  • Node.js 22 or later
  • npm/npx
  • PostgreSQL server reachable from the local host
  • MCP client supporting stdio

Setup steps

  1. Run `npx -y @microsoft/postgres-mcp connection add <profile> <connection-string>` to create a profile; follow the repository README for the exact positional syntax and use a non-production, least-privilege database.
  2. Set the profile password with the documented `connection set-password` command; it prompts without echo and stores it in the operating system keyring.
  3. Configure the client to launch `npx -y @microsoft/postgres-mcp run` with the documented profile-selection arguments from the README.
  4. Restart/reconnect, verify tools/list, then use a harmless read-only query. Prefer the documented read-only profile/mode; this server also exposes database context and query capabilities.
Tools 3+

The README documents postgres_mcp_connect, postgres_mcp_query, and postgres_mcp_db_context; no complete live tools/list was observed, so this inventory is partial.

  • postgres_mcp_connect

    Connect using a configured PostgreSQL connection profile.

    01
  • postgres_mcp_query

    Run a query against the configured PostgreSQL database.

    02
  • postgres_mcp_db_context

    Retrieve database/schema context.

    03

This server’s available tools can vary by account, permissions, or configuration. The list shown is not its full runtime catalog.

Limitations and notes
  • Microsoft-maintained integration rather than a PostgreSQL core/official server.
  • Queries can expose sensitive database contents; use least privilege and enable read-only access for initial use.
  • Password handling depends on OS keyring support; follow upstream documentation for unsupported environments.
Original sources
  • maintainer setup and tool documentation

    Documents package @microsoft/postgres-mcp, Node 22+, stdio run command, connection profile commands, keyring-backed hidden password entry, read-only setup, and named tools.

  • official tool documentation

    Microsoft repository documents profile-based PostgreSQL tools; stored three names are examples, not a complete stable total.

Documentation checked 2026-10-28T00:00:00Z. Connection has not been runtime tested.