mcp-postgres
v0.1.0PostgreSQL schema exploration, read-only SQL & governed changes for AI agents.
Values you need
| Variable | What it is | |
|---|---|---|
POSTGRES_URL | required secret | libpq connection string, e.g. postgresql://user:pass@host:5432/db (or use PGHOST/PGUSER/PGPASSWORD/PGDATABASE). |
POSTGRES_MODE | optional | Access mode: read-only | read-write | admin. |
POSTGRES_SCHEMA_ALLOWLIST | optional | Comma-separated schemas the agent may touch (empty = all). |
npm (npx) discovery passed
Requires Node.js 18+
Run in a terminal
claude mcp add mcp-postgres -e 'POSTGRES_URL=<POSTGRES_URL>' -- npx -y @dockndevai/mcp-postgres@0.1.0Add to
claude_desktop_config.json{
"mcpServers": {
"mcp-postgres": {
"args": [
"-y",
"@dockndevai/mcp-postgres@0.1.0"
],
"command": "npx",
"env": {
"POSTGRES_URL": "<POSTGRES_URL>"
}
}
}
}Add to
~/.cursor/mcp.json{
"mcpServers": {
"mcp-postgres": {
"args": [
"-y",
"@dockndevai/mcp-postgres@0.1.0"
],
"command": "npx",
"env": {
"POSTGRES_URL": "<POSTGRES_URL>"
}
}
}
}Add to
.vscode/mcp.json{
"inputs": [
{
"description": "POSTGRES_URL",
"id": "postgres-url",
"password": true,
"type": "promptString"
}
],
"servers": {
"mcp-postgres": {
"args": [
"-y",
"@dockndevai/mcp-postgres@0.1.0"
],
"command": "npx",
"env": {
"POSTGRES_URL": "${input:postgres-url}"
},
"type": "stdio"
}
}
}Add to
~/.codex/config.toml[mcp_servers.mcp-postgres]
command = "npx"
args = ["-y", "@dockndevai/mcp-postgres@0.1.0"]
env = { "POSTGRES_URL" = "<POSTGRES_URL>" }For AI agents
- Ask the user for: POSTGRES_URL. Never invent or guess these values; secrets go into the client config, not into chat logs.
- Pick the user's MCP client and apply the matching config from the first install method (it is the one verified by the smoke test when available).
- Restart or reload the client so it starts the server.
- Verify: the server should expose these tools: get_server_info, list_schemas, list_tables, describe_table, select_rows, run_query, explain_query, list_active_queries, ….
- If it fails, check that the required runtime is installed (Node.js 18+) and that the values above are set.
Machine-readable: install.md · manifest.json