Query any Postgres database using natural language.
Postgres MCP MCP server is a locally run integration for AI assistants that speak the Model Context Protocol. Query any Postgres database using natural language.
PGMCP connects AI assistants to any PostgreSQL database through natural language queries. Ask questions in plain English and get structured SQL results with automatic streaming and robust error handling.
Setup follows the usual MCP pattern — install or clone the server, register it in your client's configuration file, restart the client. The configuration blocks on this page cover the common clients.
Once Postgres MCP is connected, these are the calls the assistant has available:
Prerequisites — The Prerequisites tool exposed by this serverYou will need 3 environment variables: DATABASE_URL, OPENAI_API_KEY, HTTP_PATH. The server will not start without them, which is usually why the tools fail to appear on a first run. Keep credentials in your client's env block or a secrets manager rather than in a file you might commit.
This sits in the database access group, where several servers overlap in what they claim to do but differ sharply once you actually set them up. Postgres MCP's toolset — Prerequisites — is a fair guide to whether it matches your workflow.
This entry was verified against Postgres MCP's own documentation before publication; SyncDev keeps the directory reviewed rather than auto-generated.
| Tool | What it does |
|---|---|
| Prerequisites | The Prerequisites tool exposed by this server. |
{
"mcpServers": {
"pgmcp": {
"transport": {
"type": "http",
"url": "http://localhost:8080/mcp"
}
}
}
}Configuration as documented by the project. Restart the client after saving.
| Variable | Description | Required |
|---|---|---|
| DATABASE_URL | Endpoint or connection string the server talks to. | Yes |
| OPENAI_API_KEY | Credential the server authenticates with. | Yes |
| HTTP_PATH | Filesystem location the server is allowed to use. | Optional |
Read-only SQL access to Postgres — let your assistant inspect schemas and answer questions from real data.
Manage your whole Supabase project in conversation — database, auth, storage, Edge Functions and branches.
Query, modify and analyse local SQLite databases in conversation — the fastest way to chat with a data file.
Metabase ships its own MCP endpoint — search your BI content, build and run queries, and save questions and dashboards without leaving the chat.
Official MongoDB server covering data, schemas and Atlas management — from find queries to spinning up clusters.
Serverless Postgres with database branching — point your assistant at Neon and let it work on disposable copies.