# Postgres Secured (Aegis Zero-Trust)

> Postgres Secured (Aegis Zero-Trust) is an open-source MCP server for databases. Postgres MCP server with an Aegis proxy that blocks DROP, DELETE and ALTER statements. It is available on self-hosted.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** self-hosted
- **Website:** https://aegis-cloud-console.vercel.app
- **Repository:** https://github.com/yash-0620/postgres-mcp
- **MCP Registry name:** io.github.Yash-0620/postgres-mcp-secured
- **Categories:** [databases](https://ai-powered.com/categories/databases), [security](https://ai-powered.com/categories/security)
- **Listing updated:** 2026-11-18

## About

This fork of the CrystalDBA Postgres MCP server adds a proxy layer in front of the database connection. The README says the proxy inspects JSON-RPC payloads and rejects DROP, DELETE and ALTER commands before they reach Postgres, and it is packaged into a docker-compose stack that routes MCP traffic through a local port.

Beyond that filter, the server keeps the upstream toolset for health checks, index tuning, EXPLAIN plans and SQL execution. Access modes let you choose between unrestricted read-write use for development and a restricted read-only mode with an execution time limit for production.

It suits teams that want AI agents to query and tune a Postgres database but need a guardrail against destructive statements. The Aegis console page describes a broader zero-trust approach, but the security claims beyond the documented statement filter are not independently verified here.

## Features

- **Destructive statement blocking:** The Aegis proxy is described as rejecting DROP, DELETE and ALTER commands before they reach the database.
- **Database health checks:** Reports on index health, connection use, buffer cache, vacuum, sequences, replication and constraints.
- **Index tuning:** Searches candidate indexes against workload queries and simulates their effect with hypopg.
- **Query plan analysis:** Runs EXPLAIN on queries, including hypothetical indexes, to compare plans.
- **Access modes:** Switches between unrestricted read-write use and a restricted read-only mode with execution time limits.
- **Multiple transports:** Supports stdio for local clients and SSE for shared or remote servers.

## Good for

- Letting an AI coding assistant inspect schemas and run queries against a development database
- Finding slow queries and recommending indexes for an application backend
- Running read-only database health reviews in production through an AI client
- Limiting an autonomous agent so it cannot drop tables or delete rows

## Tools

- `list_schemas`: Lists all database schemas in the PostgreSQL instance.
- `list_objects`: Lists tables, views, sequences and extensions within a schema.
- `get_object_details`: Describes a database object's columns, constraints and indexes.
- `execute_sql`: Executes SQL statements, with read-only limits in restricted mode.
- `explain_query`: Returns the execution plan for a query, optionally with hypothetical indexes.
- `get_top_queries`: Reports the slowest queries using pg_stat_statements data.
- `analyze_workload_indexes`: Recommends indexes for resource-intensive workload queries.
- `analyze_query_indexes`: Recommends indexes for a list of up to 10 specific queries.
- `analyze_db_health`: Runs health checks covering cache, connections, constraints, indexes, sequences and vacuum.

## FAQ

### Which transports does the server support?

The README says it supports both stdio and Server-Sent Events (SSE) transports.

### What is the difference between the access modes?

Unrestricted mode allows full read and write access and is meant for development. Restricted mode limits operations to read-only transactions and limits execution time, and is meant for production.

### Which Postgres versions are tested?

The README says testing focuses on Postgres 15, 16 and 17, with plans to support versions 13 through 17.

### What extensions are needed for index tuning?

Index tuning and performance analysis need the pg_stat_statements and hypopg extensions on the database.

### Is Postgres Secured (Aegis Zero-Trust) free?

Yes. Postgres Secured (Aegis Zero-Trust) is open source, so you can use and self-host it for free.

### What are the best alternatives to Postgres Secured (Aegis Zero-Trust)?

The closest alternatives to Postgres Secured (Aegis Zero-Trust) are Mcpg, Pg Readonly MCP, PostgreSQL MCP Server, MCP Zero-Trust Gateway and Vericto Proxy mode (local, PostgreSQL).

## Where this comes from

- Description: written from the project's README, the project's website and its MCP Registry entry.

## Alternatives

- [Mcpg](https://ai-powered.com/mcp/mcpg): Mcpg is an open-source MCP server for databases.
- [Pg Readonly MCP](https://ai-powered.com/mcp/pg-readonly-mcp): Pg Readonly MCP is an open-source MCP server for databases.
- [PostgreSQL MCP Server](https://ai-powered.com/mcp/postgresql-mcp-server-5): PostgreSQL MCP Server is an open-source MCP server for databases.
- [MCP Zero-Trust Gateway](https://ai-powered.com/mcp/mcp-zero-trust-gateway): MCP Zero-Trust Gateway is an open-source MCP server for security.
- [Vericto Proxy mode (local, PostgreSQL)](https://ai-powered.com/mcp/vericto-proxy-mode-local-postgresql): Vericto Proxy mode (local, PostgreSQL) is an open-source MCP server for databases.
- [pgman](https://ai-powered.com/mcp/pgman): pgman is an open-source MCP server for databases.
- [Postgres (read-only)](https://ai-powered.com/mcp/postgres-read-only): Postgres (read-only) is an open-source MCP server for databases.

---
Source: https://ai-powered.com/mcp/postgres-secured-aegis-zero-trust
