Skip to main content
Glama
PostgreSQL Docs MCP
by sav-maya

PostgreSQL Docs MCP

A public, open-source Model Context Protocol server for the official, versioned PostgreSQL documentation.

It defaults to the current stable release and can search or read every online version—including archived, beta, and development documentation.

Tools

  • list_versions — list every documentation version available online

  • search_docs — search within a specific PostgreSQL version

  • get_doc_page — read a documentation page as Markdown, with pagination for long pages

Related MCP server: Documentary MCP Server

Access and security

This is a read-only documentation server. It:

  • fetches only public pages from www.postgresql.org

  • never connects to a PostgreSQL database

  • does not need credentials, API keys, or environment variables

  • cannot execute SQL or modify PostgreSQL projects

Use it in Cursor

Install uv if needed, then add this server to ~/.cursor/mcp.json:

{
  "mcpServers": {
    "postgres-docs": {
      "command": "uvx",
      "args": [
        "--from",
        "git+https://github.com/sav-maya/postgres-docs-mcp",
        "postgres-docs-mcp"
      ]
    }
  }
}

Restart Cursor after saving the file. The first launch downloads the server and its dependencies. In Cursor Settings → Tools & MCP, postgres-docs should appear as enabled with three tools.

Then ask Cursor questions normally. It calls the tools when documentation is needed. For example:

  • Which PostgreSQL documentation versions are available?

  • Using the PostgreSQL 18 docs, explain logical replication conflicts.

  • Look up CREATE PUBLICATION in PostgreSQL 15 and cite the source page.

  • What changed in the JSON functions between PostgreSQL 16 and 18?

The version defaults to current. Mention a version in your prompt when you need behavior from a specific release.

Run locally

Requires Python 3.10+ and uv.

git clone https://github.com/sav-maya/postgres-docs-mcp.git
cd postgres-docs-mcp
uv sync
uv run postgres-docs-mcp

To make Cursor launch the local clone, use an absolute path:

{
  "mcpServers": {
    "postgres-docs": {
      "command": "uv",
      "args": [
        "--directory",
        "/ABSOLUTE/PATH/TO/postgres-docs-mcp",
        "run",
        "postgres-docs-mcp"
      ]
    }
  }
}

The server follows the official Build an MCP server guide: Python 3.10+, MCP Python SDK 2.x, typed @mcp.tool() functions, httpx2, and stdio transport. It never writes logs to stdout; logs go to stderr so they cannot corrupt MCP JSON-RPC messages.

Troubleshooting

  • Server does not appear: Restart Cursor, then check Cursor Settings → Tools & MCP for an error beside postgres-docs.

  • uvx is not found: Install uv, or replace "uvx" in the configuration with the absolute path printed by which uvx on macOS/Linux or where uvx on Windows.

  • First launch fails: Confirm that GitHub and PyPI are reachable. The first launch downloads the repository and Python dependencies.

  • A version or page is unavailable: Call list_versions first. PostgreSQL publishes unsupported releases in its manual archive, while unreleased documentation uses devel.

  • Server code looks stale: Add "--refresh" before "--from" in the uvx arguments, then restart Cursor.

Development

uv run pytest

This MCP server provides authoritative, version-specific PostgreSQL reference material. For curated practitioner guidance on schema design, indexing, query optimization, and common pitfalls, see Postgres Skills.

npx skills add neondatabase/postgres-skills

License

MIT

This is a community project. It is not affiliated with the PostgreSQL Global Development Group.

Available Tools

3 tools
get_doc_pageA

Read one page from the official PostgreSQL documentation as Markdown.

Use the page slug returned by search_docs. Long pages can be continued by calling this tool again with the next offset.

Args: page: Page slug, such as "sql-select" or "functions-json.html". version: "current", "devel", or a published version such as "18" or "9.6". offset: Character offset at which to start reading. max_chars: Maximum characters to return, from 1,000 to 50,000.

Inputs: page (required), offset, version, max_chars. Returns: result

list_versionsA

List every PostgreSQL documentation version available online.

Includes current supported releases, prereleases, the development snapshot, and archived unsupported releases.

Inputs: no named parameters. Returns: result

search_docsA

Search the official PostgreSQL documentation within one version.

Args: query: Search terms, such as "logical replication conflicts". version: "current", "devel", or a published version such as "18" or "9.6". limit: Number of results to return, from 1 to 20.

Inputs: query (required), limit, version. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.2/5.0

    Scored across 3 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose: search_docs finds pages, get_doc_page reads a specific page, and list_versions enumerates available versions. There is no overlap, and the descriptions explicitly link them (get_doc_page uses slugs returned by search_docs).

    Naming Consistency5/5

    All three names follow a consistent verb_noun snake_case pattern: search_docs, get_doc_page, list_versions. The convention is predictable and readable.

    Tool Count5/5

    Three tools is exactly the right scope for a documentation search server: discover, retrieve, and enumerate versions. Each tool earns its place with no redundancy.

    Completeness4/5

    The surface covers the core lifecycle of finding and reading docs, including version selection and pagination via offset/max_chars. Minor gaps like no table-of-contents browsing or in-page search exist, but agents can work around them using search_docs.

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      Indexes public documentation sites into PostgreSQL and exposes retrieval-only MCP tools for listing sources, searching with citations, and fetching documents.
      7 npm
      -
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables agents to search and read public Ravensight documentation over unauthenticated remote HTTP, retrieving cited excerpts and Markdown sections with revision-aware pagination. Provides a browsable index of document IDs and sections, with read-only, free access that cannot touch customer studios or player data.
      MIT