Skip to main content
Glama
BrassaiKao

postgres-mcp-full-access

by BrassaiKao

postgres-mcp-full-access

A pure, full-access PostgreSQL MCP server for AI agents. Enables unrestricted SQL execution (DDL/DML) with zero database bundling.

This project embraces a "pure middleware" philosophy, stripping away restrictive database environment setups and hardcoded query filtering. It does exactly one thing: unconditionally accepts and executes any SQL command from your Agent (including CREATE, INSERT, UPDATE, DELETE, and DROP), and returns the result.

All connection methods, network architectures, and security constraints are entirely left to the user and the native PostgreSQL Role-Level Security (RLS) to manage.

✨ Key Features

  • 100% Decoupled: Zero database bundling. It runs purely as an stdio middleware layer.

  • Always Latest: No locked-in versions. Every build automatically pulls the latest Node.js, MCP SDK, and pg drivers, eliminating maintenance overhead.

  • Unrestricted Access: Breaking free from the typical read-only sandbox. Your AI can autonomously create databases, define tables, and perform vector searches (e.g., pgvector).

  • Dynamic Database Switching: Built-in support for switching databases mid-session—allowing the AI to create a new database and immediately connect to it to execute further commands.

  • Minimalist Deployment: A single command builds a clean Docker image, ready to be spawned by your Agent at any time.


Related MCP server: PostgreSQL MCP Server

🚀 Quick Start (One-Click Build)

1. Clone the repository

git clone [https://github.com/BrassaiKao/postgres-mcp-full-access.git](https://github.com/BrassaiKao/postgres-mcp-full-access.git)
cd postgres-mcp-full-access

2. Build the latest environment image No local Node.js installation is required. Just run:

docker compose up -d --build

(This automatically pulls the latest dependencies and generates an image named hermes-postgres-mcp:latest on your machine. The container will gracefully exit once the build is complete, consuming zero background resources.)

⚙️ Usage with AI Agents

To use this with an MCP-compatible agent (like Hermes Agent or Claude Desktop), modify your agent's configuration file (e.g., ~/.hermes/config.yaml):

mcp_servers:
  postgres_middleware:
    command: "docker"
    args:
      - "run"
      - "-i"             # Required: Keep interactive mode open for stdio
      - "--rm"           # Automatically remove the container when done
      # - "--network=your_network" # Uncomment if you need to connect to a specific Docker network
      - "-e"
      # Insert the PostgreSQL connection string you want the Agent to use
      - "DATABASE_URL=postgresql://agent_user:password@your_db_host:5432/postgres"
      - "hermes-postgres-mcp:latest"

🛡️ Security Best Practices (Crucial)

Because this MCP Server allows all SQL syntax, DO NOT give the AI your postgres (Superuser) credentials.

Instead, create a dedicated Role in your PostgreSQL database. Use GRANT and REVOKE to precisely control which tables the Agent can read or write. By delegating security to the database layer, even if a Prompt Injection occurs, malicious commands will be natively blocked by PostgreSQL with a Permission denied error!

F
license - not found
-
quality - not tested
B
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/BrassaiKao/postgres-mcp-full-access'

If you have feedback or need assistance with the MCP directory API, please join our Discord server