PostgreSQL Docs MCP
Provides access to official, versioned PostgreSQL documentation, enabling listing available documentation versions, searching within a specific version, and reading documentation pages as Markdown with pagination.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@PostgreSQL Docs MCP look up CREATE PUBLICATION in the PostgreSQL 15 docs and cite the page"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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 onlinesearch_docs— search within a specific PostgreSQL versionget_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.orgnever 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-mcpTo 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.uvxis not found: Install uv, or replace"uvx"in the configuration with the absolute path printed bywhich uvxon macOS/Linux orwhere uvxon 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_versionsfirst. PostgreSQL publishes unsupported releases in its manual archive, while unreleased documentation usesdevel.Server code looks stale: Add
"--refresh"before"--from"in theuvxarguments, then restart Cursor.
Development
uv run pytestRelated project
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-skillsLicense
This is a community project. It is not affiliated with the PostgreSQL Global Development Group.
Available Tools
3 toolsget_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
Scored across 3 tools
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).
All three names follow a consistent verb_noun snake_case pattern: search_docs, get_doc_page, list_versions. The convention is predictable and readable.
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.
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
Comprehensive PostgreSQL documentation and best practices, including ecosystem tools
Search and read the official MariaDB documentation for every MariaDB product, plus release notes.
Versioned documentation registry and semantic search for AI tools and coding assistants.
Search and read Apple developer documentation, HIG, and WWDC transcripts as Markdown.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables MCP clients to access and read mdbook documentation, including structure, content, and search.10 npm3MIT
- FlicenseNot gradedqualityDmaintenanceEnables creating, listing, and searching project-based documentation with Markdown content, table of contents, full-text search, and multi-client support via Streamable HTTP transport.-
- FlicenseNot gradedqualityDmaintenanceIndexes public documentation sites into PostgreSQL and exposes retrieval-only MCP tools for listing sources, searching with citations, and fetching documents.7 npm-
- AlicenseNot gradedqualityBmaintenanceEnables 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