Install PostgreSQL (hardened, read-only) in Claude Code
claude mcp add postgresql-hardened-read-only -e DATABASE_URL=... -- npx -y postgres-mcp-hardened{
"mcpServers": {
"postgresql-hardened-read-only": {
"command": "npx",
"args": [
"-y",
"postgres-mcp-hardened"
],
"env": {
"DATABASE_URL": "..."
}
}
}
}Replace each ... with your own value.
Frequently asked questions
What does the PostgreSQL (hardened, read-only) MCP server do?
Read-only PostgreSQL access: AST-validated queries in read-only transactions, schema inspection, column redaction, EXPLAIN cost guard and audit log.
Is the PostgreSQL (hardened, read-only) MCP server free?
The server is free, but you will likely need an account. The server itself is free, but it connects to a service that needs an account or API key, which may have paid tiers. Check the provider for current pricing.
Does PostgreSQL (hardened, read-only) run locally or remotely?
Local. Runs on your machine (stdio). You install it with npx, uvx, Docker or from source.
How do I add PostgreSQL (hardened, read-only) to Claude Code?
Run: claude mcp add postgresql-hardened-read-only -e DATABASE_URL=... -- npx -y postgres-mcp-hardened
More databases MCP servers
View allLLMSlim memory
Thanatos9404/llmslim
Long-term memory and context fitting for agents, with no LLM in the loop. Local SQLite.
Tidb
c4pt0r/mcp-server-tidb
TiDB database integration with schema inspection and query capabilities.
remem
tinhien11/remem-mcp
Local-first memory for AI coding agents. Memory + CodeGraph + Wiki in one SQLite file.
DBConvert Streams (Federated SQL)
slotix/dbconvert-streams-public
Read-only SQL across PostgreSQL, MySQL, S3-compatible storage and Parquet/CSV/JSON files, with cross-source joins federated by DuckDB.
dbt-docs
mattijsdp/dbt-docs-mcp
MCP server for dbt-core (OSS) users as the official dbt MCP only supports dbt Cloud. Supports project metadata, model and column-level lineage and dbt documentation.
Rebase
rebasepro/rebase
Schema, database, document, user and dev-server tools for a Rebase backend project.