PostgreSQL MCP Server
by musaddiq-devio.github.musaddiq-dev/postgresql-mcp-serverv0.1.2
Python MCP server for PostgreSQL database inspection and querying
context tax
queued
security
queued
cold start
queued
freshness
Slowing5mo ago
Install PostgreSQL MCP server
Install in Claude Code
claude mcp add mdev-postgresql -e POSTGRES_HOST=localhost -e POSTGRES_PORT=5432 -e POSTGRES_USER='<postgres-user>' -e POSTGRES_PASSWORD='<postgres-password>' -e POSTGRES_DB='<postgres-db>' -- uvx mdev-postgresql-mcp-serverInstall in Cursor
{
"mcpServers": {
"mdev-postgresql": {
"command": "uvx",
"args": [
"mdev-postgresql-mcp-server"
],
"env": {
"POSTGRES_HOST": "localhost",
"POSTGRES_PORT": "5432",
"POSTGRES_USER": "<postgres-user>",
"POSTGRES_PASSWORD": "<postgres-password>",
"POSTGRES_DB": "<postgres-db>"
}
}
}
}Add to ~/.cursor/mcp.json (global) or .cursor/mcp.json (project).
Install in Claude Desktop
{
"mcpServers": {
"mdev-postgresql": {
"command": "uvx",
"args": [
"mdev-postgresql-mcp-server"
],
"env": {
"POSTGRES_HOST": "localhost",
"POSTGRES_PORT": "5432",
"POSTGRES_USER": "<postgres-user>",
"POSTGRES_PASSWORD": "<postgres-password>",
"POSTGRES_DB": "<postgres-db>"
}
}
}
}Settings → Developer → Edit Config (claude_desktop_config.json), then restart.
Install in VS Code
{
"servers": {
"mdev-postgresql": {
"type": "stdio",
"command": "uvx",
"args": [
"mdev-postgresql-mcp-server"
],
"env": {
"POSTGRES_HOST": "localhost",
"POSTGRES_PORT": "5432",
"POSTGRES_USER": "<postgres-user>",
"POSTGRES_PASSWORD": "<postgres-password>",
"POSTGRES_DB": "<postgres-db>"
}
}
}
}Add to .vscode/mcp.json in your workspace.
Install in Windsurf
{
"mcpServers": {
"mdev-postgresql": {
"command": "uvx",
"args": [
"mdev-postgresql-mcp-server"
],
"env": {
"POSTGRES_HOST": "localhost",
"POSTGRES_PORT": "5432",
"POSTGRES_USER": "<postgres-user>",
"POSTGRES_PASSWORD": "<postgres-password>",
"POSTGRES_DB": "<postgres-db>"
}
}
}
}Add to ~/.codeium/windsurf/mcp_config.json.
Configuration
| Variable | Required | Secret | Description |
|---|---|---|---|
| POSTGRES_HOST | yes | — | PostgreSQL host |
| POSTGRES_PORT | yes | — | PostgreSQL port |
| POSTGRES_USER | yes | — | PostgreSQL username |
| POSTGRES_PASSWORD | — | yes | PostgreSQL password |
| POSTGRES_DB | yes | — | PostgreSQL database name |
| POSTGRES_READ_QUERY_LIMIT | — | — | Maximum rows returned by read queries |
Freshness
Slowing — last maintenance signal 5mo ago. The newest of the signals below sets the band.
Last commit (default branch)
2026-05-23 · 5mo ago · GitHub
Latest release
2026-05-23 · 5mo ago · GitHub · v0.1.2
Package published
no data · npm/PyPI
Registry entry updated
2026-05-23 · 5mo ago · official registry · v0.1.2
FAQ
›How do I install the PostgreSQL MCP server in Claude Code?
Run: claude mcp add mdev-postgresql -e POSTGRES_HOST=localhost -e POSTGRES_PORT=5432 -e POSTGRES_USER='<postgres-user>' -e POSTGRES_PASSWORD='<postgres-password>' -e POSTGRES_DB='<postgres-db>' -- uvx mdev-postgresql-mcp-server. For Cursor, VS Code, Claude Desktop and Windsurf, use the install tabs above.
›Does PostgreSQL require an API key?
Yes. It expects POSTGRES_HOST, POSTGRES_PORT, POSTGRES_USER, POSTGRES_DB, POSTGRES_PASSWORD, of which 1 is a secret.
›Can I use PostgreSQL as a remote (hosted) MCP server?
No hosted endpoint is published; it runs locally over stdio.
›Is PostgreSQL in the official MCP registry?
Yes, as io.github.musaddiq-dev/postgresql-mcp-server.
Alternatives to PostgreSQL
Other database MCP servers.