
Description
PGMCP is a Model Context Protocol server that connects AI assistants to any PostgreSQL database. You ask questions in plain English, and the server turns them into SQL and returns structured results as a table, JSON or CSV. It handles large result sets with automatic streaming, and it gives read-only access that prevents write operations. You can search text across all text columns, and it handles mixed-case table names correctly. You point it at an existing database with a DATABASE_URL connection string. An OpenAI API key is optional and is only needed for AI-powered SQL generation, with gpt-4o-mini as the default model. It can also run over HTTP, with a configurable address, endpoint path and an optional bearer token. The README says it works with Cursor, Claude Desktop, VS Code extensions and any MCP-compatible client. Pre-compiled binaries for Linux, macOS and Windows are on GitHub Releases, and the README lists alternative install options too.…
Highlights
- Plain-English questions turned into SQL
- Read-only access that prevents write operations
- Automatic streaming for large result sets
- Text search across all text columns
- Table, JSON and CSV output
- Optional HTTP mode with bearer token authentication
Ratings & Reviews
No ratings yet
Be the first to rate subnetmarco/pgmcp.
People also visit

FreePeak/db-mcp-server
MySQL and PostgreSQL access: query execution, transaction management

agenticfabriq/mnemiq
Natural-language questions over Postgres, Oracle, Snowflake, Databricks

centralmind/gateway
Automatically generate APIs from database schema and data for PostgreSQL
subnetmarco/pgmcp FAQ
What is PGMCP?
An MCP server that lets AI assistants query an existing PostgreSQL database using plain English.
Which AI tools can use it?
The README says it works with Cursor, Claude Desktop, VS Code extensions and any MCP-compatible client.
Is it safe to point at my database?
The README describes read-only access that prevents any write operations.
Do I need an OpenAI key?
No. The key is optional and only used for AI-powered SQL generation. The default model is gpt-4o-mini.
How do I install it?
Download a pre-compiled binary for your platform from GitHub Releases, extract it and run it with a DATABASE_URL connection string.
What are the best subnetmarco/pgmcp alternatives?
Popular alternatives to subnetmarco/pgmcp include FreePeak/db-mcp-server, postgres (read-only SQL) and XGenerationLab/xiyanmcpserver. See all subnetmarco/pgmcp alternatives

















