Read-only Postgres MCP server: a drop-in replacement for the archived server-postgres, with schema context for correct answers.
Setup
Choose your client, copy the config, then fill in any required environment variables.
claude mcp add postgres-read-only --env DATABASE_URL='<DATABASE_URL>' -- npx -y @contextflo/postgres-mcp~/.codex/config.toml
[mcp_servers.postgres-read-only]
command = "npx"
args = ["-y", "@contextflo/postgres-mcp"]
env = { DATABASE_URL = "<DATABASE_URL>" }
# codex mcp add postgres-read-only --env DATABASE_URL='<DATABASE_URL>' -- npx -y @contextflo/postgres-mcp~/.cursor/mcp.json
{
"mcpServers": {
"postgres-read-only": {
"command": "npx",
"args": [
"-y",
"@contextflo/postgres-mcp"
],
"env": {
"DATABASE_URL": "<DATABASE_URL>"
}
}
}
}.vscode/mcp.json
{
"servers": {
"postgres-read-only": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@contextflo/postgres-mcp"
],
"env": {
"DATABASE_URL": "<DATABASE_URL>"
}
}
}
}~/.gemini/settings.json
{
"mcpServers": {
"postgres-read-only": {
"command": "npx",
"args": [
"-y",
"@contextflo/postgres-mcp"
],
"env": {
"DATABASE_URL": "<DATABASE_URL>"
}
}
}
}claude_desktop_config.json
{
"mcpServers": {
"postgres-read-only": {
"command": "npx",
"args": [
"-y",
"@contextflo/postgres-mcp"
],
"env": {
"DATABASE_URL": "<DATABASE_URL>"
}
}
}
}.trae/mcp.json
{
"mcpServers": {
"postgres-read-only": {
"command": "npx",
"args": [
"-y",
"@contextflo/postgres-mcp"
],
"env": {
"DATABASE_URL": "<DATABASE_URL>"
}
}
}
}Environment variables
DATABASE_URL
Replace the placeholders with your own credentials and keep them out of version control.