PostgreSQL MCP Server
About
Python MCP server for PostgreSQL database inspection and querying
Use this server
Add it to your MCP client. The catalogue lists this config verbatim from its source — it does not run, download, or vouch for the server. Review the command before you run it.
Transportstdio (runs a local command)
Env vars
POSTGRES_HOST POSTGRES_PORT POSTGRES_USER POSTGRES_PASSWORD POSTGRES_DB POSTGRES_READ_QUERY_LIMITClaude Code
claude mcp add --env POSTGRES_HOST= --env POSTGRES_PORT= --env POSTGRES_USER= --env POSTGRES_PASSWORD= --env POSTGRES_DB= --env POSTGRES_READ_QUERY_LIMIT= postgresql-mcp-server -- uvx mdev-postgresql-mcp-server
Cursor
If the button doesn't open Cursor, use the JSON below — Cursor accepts the same mcpServers config.
VS Code
code --add-mcp '{"name":"postgresql-mcp-server","command":"uvx","args":["mdev-postgresql-mcp-server"],"env":{"POSTGRES_HOST":"","POSTGRES_PORT":"","POSTGRES_USER":"","POSTGRES_PASSWORD":"","POSTGRES_DB":"","POSTGRES_READ_QUERY_LIMIT":""}}'
JSON
{
"mcpServers": {
"postgresql-mcp-server": {
"command": "uvx",
"args": [
"mdev-postgresql-mcp-server"
],
"env": {
"POSTGRES_HOST": "",
"POSTGRES_PORT": "",
"POSTGRES_USER": "",
"POSTGRES_PASSWORD": "",
"POSTGRES_DB": "",
"POSTGRES_READ_QUERY_LIMIT": ""
}
}
}
}
Environment variables are listed by name only — fill in your own values. Entries never carry secrets.