Postgres MCP Server
by arifulislamatio.github.arifulislamat/database-mcp-postgresv0.4.2
MCP server for PostgreSQL. Read-only by default, row caps, timeouts, secrets never logged.
context tax
queued
security
queued
cold start
queued
freshness
Maintained3mo ago
Install Postgres MCP server
Install in Claude Code
claude mcp add postgres-arifulislamat -e POSTGRES_HOST='<postgres-host>' -e POSTGRES_USER='<postgres-user>' -e POSTGRES_PASSWORD='<postgres-password>' -e POSTGRES_DATABASE='<postgres-database>' -- npx -y @database-mcp/postgresInstall in Cursor
{
"mcpServers": {
"postgres-arifulislamat": {
"command": "npx",
"args": [
"-y",
"@database-mcp/postgres"
],
"env": {
"POSTGRES_HOST": "<postgres-host>",
"POSTGRES_USER": "<postgres-user>",
"POSTGRES_PASSWORD": "<postgres-password>",
"POSTGRES_DATABASE": "<postgres-database>"
}
}
}
}Add to ~/.cursor/mcp.json (global) or .cursor/mcp.json (project).
Install in Claude Desktop
{
"mcpServers": {
"postgres-arifulislamat": {
"command": "npx",
"args": [
"-y",
"@database-mcp/postgres"
],
"env": {
"POSTGRES_HOST": "<postgres-host>",
"POSTGRES_USER": "<postgres-user>",
"POSTGRES_PASSWORD": "<postgres-password>",
"POSTGRES_DATABASE": "<postgres-database>"
}
}
}
}Settings → Developer → Edit Config (claude_desktop_config.json), then restart.
Install in VS Code
{
"servers": {
"postgres-arifulislamat": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@database-mcp/postgres"
],
"env": {
"POSTGRES_HOST": "<postgres-host>",
"POSTGRES_USER": "<postgres-user>",
"POSTGRES_PASSWORD": "<postgres-password>",
"POSTGRES_DATABASE": "<postgres-database>"
}
}
}
}Add to .vscode/mcp.json in your workspace.
Install in Windsurf
{
"mcpServers": {
"postgres-arifulislamat": {
"command": "npx",
"args": [
"-y",
"@database-mcp/postgres"
],
"env": {
"POSTGRES_HOST": "<postgres-host>",
"POSTGRES_USER": "<postgres-user>",
"POSTGRES_PASSWORD": "<postgres-password>",
"POSTGRES_DATABASE": "<postgres-database>"
}
}
}
}Add to ~/.codeium/windsurf/mcp_config.json.
Configuration
| Variable | Required | Secret | Description |
|---|---|---|---|
| POSTGRES_HOST | yes | — | Database host |
| POSTGRES_USER | yes | — | Database user (a read-only user is recommended) |
| POSTGRES_PASSWORD | — | yes | Database password (or use POSTGRES_PASSWORD_FILE) |
| POSTGRES_DATABASE | yes | — | Database name |
Freshness
Maintained — last maintenance signal 3mo ago. The newest of the signals below sets the band.
Last commit (default branch)
2026-07-17 · 3mo ago · GitHub
Latest release
2026-07-16 · 3mo ago · GitHub · postgres-ts-v0.4.2
Package published
no data · npm/PyPI
Registry entry updated
2026-07-16 · 3mo ago · official registry · v0.4.2
FAQ
›How do I install the Postgres MCP server in Claude Code?
Run: claude mcp add postgres-arifulislamat -e POSTGRES_HOST='<postgres-host>' -e POSTGRES_USER='<postgres-user>' -e POSTGRES_PASSWORD='<postgres-password>' -e POSTGRES_DATABASE='<postgres-database>' -- npx -y @database-mcp/postgres. For Cursor, VS Code, Claude Desktop and Windsurf, use the install tabs above.
›Does Postgres require an API key?
Yes. It expects POSTGRES_HOST, POSTGRES_USER, POSTGRES_DATABASE, POSTGRES_PASSWORD, of which 1 is a secret.
›Can I use Postgres as a remote (hosted) MCP server?
No hosted endpoint is published; it runs locally over stdio.
›Is Postgres in the official MCP registry?
Yes, as io.github.arifulislamat/database-mcp-postgres.
Alternatives to Postgres
Other database MCP servers.