Practical overview
When it fits
Use Mcpg when an MCP-compatible client needs structured access to PostgreSQL tools, from read-oriented data questions to explicitly enabled database operations.
Who it is for
- Developers configuring an MCP client to work with PostgreSQL.
- Database teams exploring agent-assisted schema inspection, query analysis or operational workflows.
Documented uses
- Inspect database catalogs and summarize tables.
- Ask an agent to translate a natural-language question into SQL.
- Investigate query performance and review index recommendations.
- Expose search, graph-query, data-movement and database-operation tools to an MCP client.
Requirements & limits
The README documents PyPI and Docker installation and a hosted read-only demo using throwaway data. A PostgreSQL connection URL is required for a database connection; natural-language-to-SQL requires a key for a supported model provider. The project is MIT-licensed open source.
- Mcpg is a server/tooling layer; an MCP-compatible client supplies the agent interface and invokes its tools.
- The default access mode is read-only; write and DBA capabilities depend on configured access modes and opt-in gates.
- The documented transports are stdio, streamable HTTP and SSE.
- The toolset extends beyond ordinary queries to include introspection, query intelligence, hybrid search, graph queries, data movement and live operations.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Install MCPg and verify the CLI
Install MCPg from PyPI and check that its CLI is available.
Before you start
- Python environment with access to PyPI.
Steps
Install MCPg with the command below.
pip install mcpgRun
mcpg --versionto verify the installation.
Expected outcome
The installed MCPg CLI reports its version.
Guide limitations
- This covers installation and version verification only; it does not configure a PostgreSQL connection or connect an MCP client.
Connect Claude Desktop to PostgreSQL with MCPg
Configure Claude Desktop to start MCPg over stdio with a PostgreSQL connection URL.
Before you start
- Claude Desktop.
- A PostgreSQL connection URL.
Steps
Add an
mcpgserver entry toclaude_desktop_config.json, usinguvxas the command andmcpgas its argument.Set the entry's
MCPG_DATABASE_URLenvironment variable to the PostgreSQL connection URL.Restart or otherwise start the configured MCP server through Claude Desktop.
Expected outcome
Claude Desktop is configured to launch MCPg over stdio and connect it to the specified PostgreSQL database.
Guide limitations
- The source identifies the configuration file locations for macOS and Windows but does not provide a complete JSON configuration in the captured text.
- The connection URL is required; remote PostgreSQL hosts require
sslmode=requireor stronger. - MCPg defaults to read-only access; write and DBA capabilities require additional configuration.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 13 October 2026
- Original website title
- devopam/MCPg · Official homepage title · retained in its source language

