MCP Postgres — MCP Protocol
A server that queries a PostgreSQL DB read-only
Basic information
| Program name | MCP Postgres (MCP postgres) |
|---|---|
| Short description | A server that queries a PostgreSQL DB read-only |
| Development & maintenance | Model Context Protocol project |
| Official homepage | https://github.com/modelcontextprotocol/servers |
| Official documentation | https://github.com/modelcontextprotocol/servers |
| Installation & deployment | npx -y @modelcontextprotocol/server-postgres |
| Runtime environment | MCP host apps (Claude Desktop, Cursor, opencode, etc.) |
| License | MIT license |
| Stable version | npm modelcontextprotocol/server-postgres (verified 2026-10) — verified on 2026-10-18 |
| GitHub repository | https://github.com/modelcontextprotocol/servers |
| Category | MCP protocol (tags: MCP, reference server, tools, agents) |
What is this program?
This server is a read-only PostgreSQL DB querying server implementation included in the MCP official reference server collection. It can be run with a single npx command, and once registered in the settings of an MCP host app, agents can use it immediately.
Main use: agents query DB schemas and data
What problems does it solve?
- ('when working with postgres', 'when an agent needs to use server functionality for read-only querying of a PostgreSQL DB', 'connect immediately via standard MCP tools')
- ('Quick connection', 'when you need to run it with npx without setting up a separate server', 'reuse the official implementation')
- ('Safe access', 'when you need to restrict the allowed scope while accessing', 'restrict via path and permission parameters')
Key features
Exposed tools
query, list_tables, describe_table
- Use case: provides agents with the ability to query DB schemas and data
- What you get: standard MCP tool calls
- Limitations: permission settings require caution
Installation and execution
npx (execution)
Run @modelcontextprotocol/server-postgres with npx.
npx -y @modelcontextprotocol/server-postgres /path
Real-world usage examples
Registering with a host
Add a server entry to mcp.json.
{"mcpServers":{"postgres":{"command":"npx","args":["-y","@modelcontextprotocol/server-postgres","/path"]}}
Advantages and limitations
Advantages
- Official project implementation
- Run with a single npx command
- Exposes standard MCP tools
Before using
- Requires host app configuration
- Be careful with permission and path settings
Comparison with similar programs
| Program | Features | Suitable when |
|---|---|---|
| Direct implementation | Write only the necessary tools yourself | In-house specialized tools |
| Community server | Choose an alternative implementation | Exploring alternatives |
Official resources and further learning
- Official homepage — https://github.com/modelcontextprotocol/servers
- Official documentation / knowledge base — https://github.com/modelcontextprotocol/servers
- Installation & deployment — npx -y @modelcontextprotocol/server-postgres
- Release notes — https://github.com/modelcontextprotocol/servers/releases
- Source / development resources — https://github.com/modelcontextprotocol/servers
Version and supported environment information is based on values checked on the official site as of 2026-10-18. Installation commands may vary depending on your distribution and version, so please also check the official installation documentation.
Actual execution screen
Synthetic example — not an actual execution result. The screen is a synthetic example and not an actual execution result.
A server in actual operation
Source (HTML): https://games.aidebatehub.com/programs/mcp/protocol/server-postgres.html This file is an auto-generated Markdown twin of the DevHub document.
AI Knowledge Hub
Visitor Comments