Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 more

    postgres mcp hardened

    1

    A Rust-based MCP server providing secure, read-only PostgreSQL access with statement validation and data redaction.

    $7

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned
    postgres mcp hardened

    postgres mcp hardened

    Example session with this skill installed

    Connect my Claude Desktop to a local Postgres database named 'analytics' using the hardened MCP server. I want to make sure it can't see the 'users' table.

    • Read your context and instructions
    • Compiled the postgres mcp hardened

    I have configured the connection string and restricted access to ensure the 'users' table remains hidden from the agent. The following configuration uses the `stdio` transport for Claude Desktop and implements an allowlist that excludes the sensitive table. ## Hardened Postgres MCP Configuration ```json { "mcpServers": { "postgres-hardened": { "command": "npx", "args": [ "-y", "postgres-mcp-hardened", "--stdio" ], "env": { "DATABASE_URL": "postgres://mcp_reader:YOUR_SAFE_PASSWORD@localhost:5432/analytics", "MCP_ALLOW_TABLES": "public.orders,public.products,public.inventory", "MCP_REDACT_COLUMNS": "email,password,ssn", "MCP_STATEMENT_TIMEOUT": "30s" } } } } ``` **Next steps** 1. Run the `postgres-mcp-hardened --print-setup-sql --role mcp_reader` command to generate the necessary read-only role permissions for your database. 2. Add the JSON block above to your `claude_desktop_config.json` file. 3. Restart Claude Desktop and run the `security_posture` tool to verify the allowlist is active.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    You need to give an AI agent access to your PostgreSQL database, but letting an LLM run arbitrary SQL is a massive security risk. This skill provides a hardened Model Context Protocol (MCP) server that enforces read-only access at the server level, preventing agents from executing destructive commands even if they attempt to bypass database-level restrictions. ## What it does - **Enforced Read-Only Queries**: Runs a validator that rejects non-read-only statements like `DROP`, `DELETE`, or `UPDATE` before they reach the database. - **Schema Discovery**: Provides tools for agents to explore schemas, tables, and column structures safely without guessing names. - **Data Redaction**: Intercepts and masks sensitive columns like passwords or SSNs at the server level. - **Performance Auditing**: Exposes query execution plans, index analysis, and health metrics to help agents diagnose slow performance. - **Access Control**: Implements allowlists for specific schemas and tables to limit the agent's blast radius. ## How it works 1. **Setup Role**: Generate a dedicated read-only PostgreSQL role using the `--print-setup-sql` flag to ensure minimum required privileges. 2. **Configure Transport**: Choose between `stdio` for local use in Claude Desktop/Cursor or HTTP for remote agent access. 3. **Environment Lockdown**: Define `DATABASE_URL`, `MCP_ALLOW_SCHEMAS`, and `MCP_REDACT_COLUMNS` to set the operational boundaries. 4. **Validation**: Test the server against the adversarial corpus using `--validate` to confirm it rejects unauthorized writes. ## Frameworks & tools Built in Rust for a small 7.7 MB idle footprint. Integrates with any MCP-compliant client including Claude Desktop, Cursor, and Claude Code. Supports PostgreSQL, Supabase, Neon, and AWS RDS. ## Why this beats prompting it yourself Standard agents can be tricked into running destructive SQL through prompt injection or accidental hallucinations. This skill moves the security logic into a compiled Rust binary that validates every statement against a fuzzed parser, making it impossible for an agent to "argue" its way into a write operation. ## Use cases - Granting Claude or Cursor access to production schemas for safe data analysis and reporting. - Allowing an agent to diagnose database performance issues by inspecting execution plans and slow queries. - Providing a secure interface for AI-driven technical support bots to look up customer records without risking data integrity. - Auditing existing database deployments for security posture and unused indexes. ## Known limitations Refuses all write operations by design, even for migrations or seeding. Large query planners can increase memory usage, so setting a container memory limit is recommended.

    Refuses all write operations by design. Requires manual setup of read-only DB roles. Memory can spike during complex query planning; 512MB limit recommended for containers.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before any payment.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 1 month ago

    Requires

    Postgres Hardened MCP
    Node.js
    ENOENT

    Permissions

    Terminal / Shell
    Read Files
    Network Access
    Write Files
    Listed1 month ago

    What's inside

    Frequently Asked Questions

    A Rust-based MCP server providing secure, read-only PostgreSQL access with statement validation and data redaction.

    This skill uses the open SKILL.md standard. Use it through an MCP-compatible agent connected to Agensi, and check the compatibility information on this page for confirmed agents and required capabilities.

    Connect your AI agent to Agensi through MCP, then ask it to use postgres mcp hardened on your task. Your agent loads the latest approved version each time. Paid skills require a purchase or active subscription. Skill files are not available for download; your licence does not allow you to save, copy or export any part of a skill.

    New in LLM Ops