pgguard-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| PGGUARD_ROLE | No | SET LOCAL ROLE per transaction. Default empty. | |
| PGGUARD_CLAIMS | No | JSON for request.jwt.claims for Supabase RLS. Default empty. | |
| PGGUARD_POLICY | No | Path to the policy JSON file. Default bundled demo policy. | |
| PGGUARD_AUDIT_LOG | No | Path for JSONL audit log. Default stderr. | |
| PGGUARD_DATABASE_URL | No | Postgres connection string. Default empty -> demo mode (PGlite). | |
| PGGUARD_MAX_RESPONSE_BYTES | No | Response size cap per tool call. Default 100000. |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| describe_accessA | Show the effective access policy: which tables and columns are visible, the row cap, the statement timeout, and whether a database role or RLS claims are active. Call this before querying so you only ask for data that exists in the policy. |
| list_tablesA | List the tables visible under the access policy, with estimated row counts and table comments. Tables outside the policy are not listed and cannot be queried. |
| describe_tableA | Describe one allowlisted table: columns (only those the policy exposes), types, nullability, primary key, foreign key targets, and indexes. |
| sample_rowsA | Read rows from one allowlisted table with simple filters (eq/lt/lte/gt/gte/contains) and a limit. Prefer this over run_query for straightforward lookups; use run_query for joins and aggregations. |
| run_queryA | Run one read-only SELECT against the allowlisted tables. The statement is parsed with the real PostgreSQL grammar and checked against the access policy, then executed inside a read-only transaction with a statement timeout and a row cap. Denials name the rule that triggered them. |
| explain_queryA | Show the query plan for a read-only SELECT without executing it (EXPLAIN, never EXPLAIN ANALYZE). Same policy gate as run_query. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 6 tools
Each tool serves a distinct purpose: policy overview, table listing, table details, row sampling, arbitrary queries, and query planning. No overlap in functionality.
All tool names follow a consistent verb_noun pattern (e.g., describe_access, list_tables, run_query), making them predictable and easy to understand.
With 6 tools, the set is well-scoped for the domain of policy-enforced database querying, covering introspection, sampling, and full querying without being bloated.
The tools cover the full lifecycle of interacting with the access policy: understanding the policy, listing/detailing tables, sampling data, running arbitrary queries, and explaining plans. No obvious gaps.