MCP.so
Sign In

Postgres MCP Hardened

@Eszetael

Basic information

Category

Databases

Last updated

License

MIT

Author

Eszetael

About Postgres MCP Hardened

Secure read-only PostgreSQL MCP server in Rust — a hardened alternative to the deprecated @modelcontextprotocol/server-postgres.

Postgres MCP Hardened config

Add this server to your MCP-compatible client using the configuration below.

{
  "mcpServers": {
    "postgres": {
      "command": "npx",
      "args": [
        "-y",
        "postgres-mcp-hardened",
        "--stdio"
      ],
      "env": {
        "DATABASE_URL": "postgres://readonly_user:PASSWORD@localhost:5432/mydb"
      }
    }
  }
}

Postgres MCP Hardened tools

5

the execution plan; with `analyze` it runs the statement and reports real

cache hit ratio, connections (this database and the cluster), the longest

unused indexes, duplicates, and tables scanned sequentially often enough

the heaviest statements, from `pg_stat_statements`.

what this deployment is actually able to do to your database, asked of

Overview

What is Postgres Mcp Hardened?

Secure read-only PostgreSQL MCP server in Rust — a hardened alternative to the deprecated @modelcontextprotocol/server-postgres.

How to use Postgres Mcp Hardened?

The README includes setup instructions such as npx postgres-mcp-hardened --validate "/* comment */ DROP TABLE users".

Key features of Postgres Mcp Hardened

  • **A read-only transaction does not block every write, and a rollback does not undo everything it
  • No statement timeout, no cost guard, no row limit — one query can run until the server gives up
  • No authentication, no audit trail, no handling of prompt injection through returned row data
  • One source file of 143 lines, unmaintained since December 2024, no test suite
  • --fuzz — a deterministic fuzzer that mutates a corpus of known writes with transformations

Use cases of Postgres Mcp Hardened

  • Connect an MCP-compatible client to this repository's service.
  • Review the README-backed setup before enabling it in production.

Frequently asked questions

1

Where is the source code for Postgres Mcp Hardened?

The source code is linked from the repository URL on this page.

2

Does Postgres Mcp Hardened include a standard MCP config?

If the README contains a parseable MCP configuration block, it is shown in the Config tab.

Comments

More Databases MCP servers