Search / io.github.antonorlov/mcp-postgres-server
PostgreSQL
L0· runs locallyMCP server for PostgreSQL: local, Docker, RDS, Neon, Supabase, or behind an SSH bastion.
v0.3.1 · active · repository · website · descriptor JSON · versions
Search / io.github.antonorlov/mcp-postgres-server
L0· runs locallyMCP server for PostgreSQL: local, Docker, RDS, Neon, Supabase, or behind an SSH bastion.
v0.3.1 · active · repository · website · descriptor JSON · versions
{
"mcpServers": {
"mcp-postgres-server": {
"command": "npx",
"args": [
"-y",
"[email protected]"
],
"env": {
"DATABASE_URL": "${DATABASE_URL}",
"PG_PORT": "5432",
"PG_PASSWORD": "${PG_PASSWORD}",
"PG_ALLOW_WRITE": "false",
"PG_ENABLE_RUNTIME_CONNECT": "false",
"PG_MAX_RESULT_BYTES": "32768",
"PG_STATEMENT_TIMEOUT": "30000",
"PG_CONNECT_TIMEOUT": "10000",
"PG_SSH_PORT": "22",
"PG_SSH_PASSPHRASE": "${PG_SSH_PASSPHRASE}",
"PG_SSH_PASSWORD": "${PG_SSH_PASSWORD}",
"PG_SSH_KEEPALIVE_INTERVAL": "15000"
}
}
}
}claude mcp add mcp-postgres-server -e "DATABASE_URL=${DATABASE_URL}" -e "PG_PORT=5432" -e "PG_PASSWORD=${PG_PASSWORD}" -e "PG_ALLOW_WRITE=false" -e "PG_ENABLE_RUNTIME_CONNECT=false" -e "PG_MAX_RESULT_BYTES=32768" -e "PG_STATEMENT_TIMEOUT=30000" -e "PG_CONNECT_TIMEOUT=10000" -e "PG_SSH_PORT=22" -e "PG_SSH_PASSPHRASE=${PG_SSH_PASSPHRASE}" -e "PG_SSH_PASSWORD=${PG_SSH_PASSWORD}" -e "PG_SSH_KEEPALIVE_INTERVAL=15000" -- npx -y [email protected][mcp_servers.mcp-postgres-server]
command = "npx"
args = ["-y", "[email protected]"]
env = { "DATABASE_URL" = "${DATABASE_URL}", "PG_PORT" = "5432", "PG_PASSWORD" = "${PG_PASSWORD}", "PG_ALLOW_WRITE" = "false", "PG_ENABLE_RUNTIME_CONNECT" = "false", "PG_MAX_RESULT_BYTES" = "32768", "PG_STATEMENT_TIMEOUT" = "30000", "PG_CONNECT_TIMEOUT" = "10000", "PG_SSH_PORT" = "22", "PG_SSH_PASSPHRASE" = "${PG_SSH_PASSPHRASE}", "PG_SSH_PASSWORD" = "${PG_SSH_PASSWORD}", "PG_SSH_KEEPALIVE_INTERVAL" = "15000" }
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"mcp-postgres-server": {
"type": "local",
"command": [
"npx",
"-y",
"[email protected]"
],
"enabled": true,
"environment": {
"DATABASE_URL": "{env:DATABASE_URL}",
"PG_PORT": "5432",
"PG_PASSWORD": "{env:PG_PASSWORD}",
"PG_ALLOW_WRITE": "false",
"PG_ENABLE_RUNTIME_CONNECT": "false",
"PG_MAX_RESULT_BYTES": "32768",
"PG_STATEMENT_TIMEOUT": "30000",
"PG_CONNECT_TIMEOUT": "10000",
"PG_SSH_PORT": "22",
"PG_SSH_PASSPHRASE": "{env:PG_SSH_PASSPHRASE}",
"PG_SSH_PASSWORD": "{env:PG_SSH_PASSWORD}",
"PG_SSH_KEEPALIVE_INTERVAL": "15000"
}
}
}
}{
"mcpServers": {
"mcp-postgres-server": {
"command": "npx",
"args": [
"-y",
"[email protected]"
],
"env": {
"DATABASE_URL": "${DATABASE_URL}",
"PG_PORT": "5432",
"PG_PASSWORD": "${PG_PASSWORD}",
"PG_ALLOW_WRITE": "false",
"PG_ENABLE_RUNTIME_CONNECT": "false",
"PG_MAX_RESULT_BYTES": "32768",
"PG_STATEMENT_TIMEOUT": "30000",
"PG_CONNECT_TIMEOUT": "10000",
"PG_SSH_PORT": "22",
"PG_SSH_PASSPHRASE": "${PG_SSH_PASSPHRASE}",
"PG_SSH_PASSWORD": "${PG_SSH_PASSWORD}",
"PG_SSH_KEEPALIVE_INTERVAL": "15000"
}
}
},
"deeplink": "cursor://anysphere.cursor-deeplink/mcp/install?name=mcp-postgres-server&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIm1jcC1wb3N0Z3Jlcy1zZXJ2ZXJAMC4zLjEiXSwiZW52Ijp7IkRBVEFCQVNFX1VSTCI6IiR7REFUQUJBU0VfVVJMfSIsIlBHX1BPUlQiOiI1NDMyIiwiUEdfUEFTU1dPUkQiOiIke1BHX1BBU1NXT1JEfSIsIlBHX0FMTE9XX1dSSVRFIjoiZmFsc2UiLCJQR19FTkFCTEVfUlVOVElNRV9DT05ORUNUIjoiZmFsc2UiLCJQR19NQVhfUkVTVUxUX0JZVEVTIjoiMzI3NjgiLCJQR19TVEFURU1FTlRfVElNRU9VVCI6IjMwMDAwIiwiUEdfQ09OTkVDVF9USU1FT1VUIjoiMTAwMDAiLCJQR19TU0hfUE9SVCI6IjIyIiwiUEdfU1NIX1BBU1NQSFJBU0UiOiIke1BHX1NTSF9QQVNTUEhSQVNFfSIsIlBHX1NTSF9QQVNTV09SRCI6IiR7UEdfU1NIX1BBU1NXT1JEfSIsIlBHX1NTSF9LRUVQQUxJVkVfSU5URVJWQUwiOiIxNTAwMCJ9fQ%3D%3D"
}{
"servers": {
"mcp-postgres-server": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"[email protected]"
],
"env": {
"DATABASE_URL": "${DATABASE_URL}",
"PG_PORT": "5432",
"PG_PASSWORD": "${PG_PASSWORD}",
"PG_ALLOW_WRITE": "false",
"PG_ENABLE_RUNTIME_CONNECT": "false",
"PG_MAX_RESULT_BYTES": "32768",
"PG_STATEMENT_TIMEOUT": "30000",
"PG_CONNECT_TIMEOUT": "10000",
"PG_SSH_PORT": "22",
"PG_SSH_PASSPHRASE": "${PG_SSH_PASSPHRASE}",
"PG_SSH_PASSWORD": "${PG_SSH_PASSWORD}",
"PG_SSH_KEEPALIVE_INTERVAL": "15000"
}
}
}
}{
"mcpServers": {
"mcp-postgres-server": {
"command": "npx",
"args": [
"-y",
"[email protected]"
],
"env": {
"DATABASE_URL": "${DATABASE_URL}",
"PG_PORT": "5432",
"PG_PASSWORD": "${PG_PASSWORD}",
"PG_ALLOW_WRITE": "false",
"PG_ENABLE_RUNTIME_CONNECT": "false",
"PG_MAX_RESULT_BYTES": "32768",
"PG_STATEMENT_TIMEOUT": "30000",
"PG_CONNECT_TIMEOUT": "10000",
"PG_SSH_PORT": "22",
"PG_SSH_PASSPHRASE": "${PG_SSH_PASSPHRASE}",
"PG_SSH_PASSWORD": "${PG_SSH_PASSWORD}",
"PG_SSH_KEEPALIVE_INTERVAL": "15000"
}
}
}
}extensions:
"mcp-postgres-server":
enabled: true
name: "mcp-postgres-server"
type: stdio
cmd: "npx"
args:
- "-y"
- "[email protected]"
envs:
"DATABASE_URL": "${DATABASE_URL}"
"PG_PORT": "5432"
"PG_PASSWORD": "${PG_PASSWORD}"
"PG_ALLOW_WRITE": "false"
"PG_ENABLE_RUNTIME_CONNECT": "false"
"PG_MAX_RESULT_BYTES": "32768"
"PG_STATEMENT_TIMEOUT": "30000"
"PG_CONNECT_TIMEOUT": "10000"
"PG_SSH_PORT": "22"
"PG_SSH_PASSPHRASE": "${PG_SSH_PASSPHRASE}"
"PG_SSH_PASSWORD": "${PG_SSH_PASSWORD}"
"PG_SSH_KEEPALIVE_INTERVAL": "15000"
timeout: 300
Placeholders to fill from your own secret store: ${DATABASE_URL}, ${PG_PASSWORD}, ${PG_SSH_PASSPHRASE}, ${PG_SSH_PASSWORD}. The registry never accepts secret values.
This is a local package: the command runs on your machine.
Not scored: fewer than three checks apply, usually because no remote answered a credential-free probe or the server is a local package.
protocol.modern, protocol.stateless, protocol.transport, protocol.list_ttlno remote answered a protocol handshake (not probed yet, unreachable, or local-only)auth.prm, auth.as_metadata, auth.cimdno remote uses OAuthauth.secret_in_urlno templated URLtools.descriptions, tools.description_length, tools.schemas, tools.annotations, tools.directory_hints, tools.token_cost, tools.api_dumptool list unknown (behind auth, not probed, or empty)stability.changes, stability.rug_pulltool list unknowndeps.known_vulnsno known advisory in 119 resolved packagesdeps.mcp_sdk_version@modelcontextprotocol/sdk 1.30.1 has 1 known advisory (GHSA-6qxp-vccf-f47h); update @modelcontextprotocol/sdk to 1.31.0 or laterdeps.resolvable[email protected] resolved: 119 packagesNo tool definition changes recorded. A server's first observation is its baseline; later probes record what changes.
Checks run on what our credential-free, read-only probes observe; tools are never called and no code audit is performed. How it is computed.
+repository +namespace-matches-repo +website ~liveness-unmeasured ~updated-35d-ago
Derived from observable signals (official registry feed and our own credential-free probes); no code audit performed. How it is computed.
[email protected] npm118 dependencies, resolved · MCP SDK @modelcontextprotocol/sdk 1.30.1 · advisories checked 2026-10-19
| advisory | severity | package | fixed in |
|---|---|---|---|
| GHSA-6qxp-vccf-f47hMCP TypeScript SDK: OAuth client could send credentials to an authorization server chosen by the MCP server | high | @modelcontextprotocol/[email protected]MCP SDK, direct | fixed in 1.31.0 |
Dependency graphs from deps.dev; advisories from OSV.dev, including the GitHub Advisory Database and the PyPI Advisory Database; all CC BY 4.0. The graph is what a clean install of this version resolves today; nothing was installed or run. How it is checked.
| package | registry | version | runtime | secrets |
|---|---|---|---|---|
mcp-postgres-server | npm | 0.3.1 | npx | DATABASE_URL, PG_PASSWORD, PG_SSH_PASSPHRASE, PG_SSH_PASSWORD |
No tools observed. Local packages are never executed by the registry.
Schemas: list_tools.
{
"name": "io.github.antonorlov/mcp-postgres-server",
"title": "PostgreSQL",
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
"version": "0.3.1",
"packages": [
{
"version": "0.3.1",
"transport": {
"type": "stdio"
},
"identifier": "mcp-postgres-server",
"runtimeHint": "npx",
"registryType": "npm",
"registryBaseUrl": "https://registry.npmjs.org",
"environmentVariables": [
{
"name": "DATABASE_URL",
"format": "string",
"isSecret": true,
"description": "Full connection string (preferred). Supports sslmode in the URL.",
"placeholder": "postgres://user:password@localhost:5432/mydb?sslmode=require"
},
{
"name": "PG_HOST",
"format": "string",
"description": "Database host (fallback when DATABASE_URL is not set)."
},
{
"name": "PG_PORT",
"format": "number",
"default": "5432",
"description": "Database port."
},
{
"name": "PG_USER",
"format": "string",
"description": "Database user."
},
{
"name": "PG_PASSWORD",
"format": "string",
"isSecret": true,
"description": "Database password."
},
{
"name": "PG_DATABASE",
"format": "string",
"description": "Database name."
},
{
"name": "PG_ALLOW_WRITE",
"format": "boolean",
"choices": [
"false",
"true"
],
"default": "false",
"description": "When true, execute performs writes and reads are sent directly. Off (default) is read-only: execute refuses writes and each read runs in a READ ONLY transaction."
},
{
"name": "PG_SSLMODE",
"format": "string",
"choices": [
"disable",
"allow",
"prefer",
"require",
"verify-ca",
"verify-full"
],
"description": "TLS mode. require/allow/prefer encrypt without verifying the certificate; verify-ca/verify-full verify it (supply a CA via PG_SSL_CA). Unlike libpq, allow/prefer do not fall back to plaintext, so a server without TLS needs disable."
},
{
"name": "PG_SSL_CA",
"format": "filepath",
"description": "Path to a CA certificate file. Setting it by itself implies verify-full."
},
{
"name": "PG_ENABLE_RUNTIME_CONNECT",
"format": "boolean",
"choices": [
"false",
"true"
],
"default": "false",
"description": "Register the connect_db tool (runtime credential switching)."
},
{
"name": "PG_MAX_RESULT_BYTES",
"format": "number",
"default": "32768",
"description": "Byte budget for a query result sent to the model. Whole rows are kept while they fit; over the budget returnedRows < rowCount and truncated is true."
},
{
"name": "PG_STATEMENT_TIMEOUT",
"format": "number",
"default": "30000",
"description": "Statement timeout in milliseconds, applied to every session."
},
{
"name": "PG_CONNECT_TIMEOUT",
"format": "number",
"default": "10000",
"description": "Timeout in milliseconds for a single connect attempt (raise it for slow links or SSH tunnels)."
},
{
"name": "PG_SSH_HOST",
"format": "string",
"description": "SSH bastion host. Setting it enables tunneling: the server reaches the database only through an SSH tunnel to this host. Needs the ssh2 optional dependency."
},
{
"name": "PG_SSH_PORT",
"format": "number",
"default": "22",
"description": "SSH bastion port."
},
{
"name": "PG_SSH_USER",
"format": "string",
"description": "SSH username."
},
{
"name": "PG_SSH_PRIVATE_KEY",
"format": "filepath",
"description": "Path to a private key file. If unset, auth falls back like ssh: a running agent (SSH_AUTH_SOCK), then a default key (~/.ssh/id_ed25519, id_rsa, id_ecdsa)."
},
{
"name": "PG_SSH_PASSPHRASE",
"format": "string",
"isSecret": true,
"description": "Passphrase for the private key, if encrypted."
},
{
"name": "PG_SSH_AGENT",
"format": "string",
"description": "true to use the ambient agent (SSH_AUTH_SOCK), or an explicit socket path / Windows named pipe."
},
{
"name": "PG_SSH_PASSWORD",
"format": "string",
"isSecret": true,
"description": "SSH login password. Opt-in; a key or agent takes precedence. Prefer keys, a bastion often disables password auth."
},
{
"name": "PG_SSH_FINGERPRINT",
"format": "string",
"description": "Pinned host-key fingerprint (SHA256:...). Host-key verification is mandatory and set only this way: without it the tunnel refuses to connect. Get it with ssh-keygen -lF host.",
"placeholder": "SHA256:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
},
{
"name": "PG_SSH_KEEPALIVE_INTERVAL",
"format": "number",
"default": "15000",
"description": "SSH keepalive interval in ms; the tunnel drops after 3 unanswered keepalives, and the next call reconnects."
}
]
}
],
"repository": {
"url": "https://github.com/antonorlov/mcp-postgres-server",
"source": "github"
},
"websiteUrl": "https://github.com/antonorlov/mcp-postgres-server#readme",
"description": "MCP server for PostgreSQL: local, Docker, RDS, Neon, Supabase, or behind an SSH bastion."
}