pgguard-mcp
Provides read-only access to a PostgreSQL database with policy-based control over tables, columns, and queries, ensuring safe AI agent interaction.
Supports Supabase Row Level Security (RLS) by setting request.jwt.claims per transaction, enabling integration with Supabase's auth system.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@pgguard-mcpshow me the top 5 orders by amount"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
pgguard-mcp
An MCP server that gives an AI agent read access to a Postgres database — and makes "read" mean something.
The first objection to connecting an agent to a production database is not whether it can be done. It is "I do not want an AI to have write access to my database." Most MCP Postgres servers answer that with a flag. This one answers it as the whole product: there is no write path at all, and what can be read is decided by a policy file you can review in a PR.
It runs out of the box against a bundled demo dataset (real Postgres via PGlite, no Docker, no database to install), and against your own Postgres with one environment variable.
npx pgguard-mcpEnforcement: two layers, and only one of them is the boundary
your SQL
│
▼
Layer 2 — policy engine (this server) policy + UX
│ parses with the real PostgreSQL grammar (libpg-query 17)
│ rejects: non-SELECT statements, multi-statement, SELECT INTO,
│ write CTEs, FOR UPDATE, denylisted functions, tables/columns
│ outside the policy; injects the row cap
▼
Layer 1 — Postgres itself the real boundary
│ BEGIN READ ONLY … ROLLBACK
│ SET LOCAL statement_timeout
│ optional SET LOCAL ROLE / request.jwt.claims (RLS path)
▼
rows, capped and auditedLayer 2 is what gives you column-level granularity and error messages a model can act on. Layer 1 is what stops an attacker. An INSERT that somehow slipped past the parser still fails at the database with cannot execute INSERT in a read-only transaction, and the transaction is rolled back, never committed. A server whose only protection is a SQL parser is not a security boundary — that is why this one has both, and why the tests verify each layer independently.
Related MCP server: PostgreSQL MCP Server
Install
Claude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"pgguard": {
"command": "npx",
"args": ["-y", "pgguard-mcp"]
}
}
}Claude Code:
claude mcp add pgguard -- npx -y pgguard-mcpWith no configuration at all, the server starts against the demo dataset: a small synthetic SaaS schema (~300 customers, ~2,000 orders over 90 days) where orders and order_items are fully visible, customers hides email and stripe_customer_id, and users and audit_events are not visible at all. Those hidden tables are the demonstration material — ask for them and watch what happens.
Point it at your database
{
"mcpServers": {
"pgguard": {
"command": "npx",
"args": ["-y", "pgguard-mcp"],
"env": {
"PGGUARD_DATABASE_URL": "postgres://agent_ro:secret@db.internal:5432/app",
"PGGUARD_POLICY": "/etc/pgguard/policy.json"
}
}
}
}Generate a starting policy from the live schema (it emits explicit column lists, so the reviewer sees every column the agent will get — delete the ones it should not):
npx pgguard-mcp init-policy "$PGGUARD_DATABASE_URL" --out pgguard.policy.jsonPrefer --out over shell redirection: PowerShell 5.1 writes UTF-16LE for >, and a UTF-16 policy file fails JSON.parse at startup. Without --out the policy goes to stdout.
The policy file
Deny-by-default: anything not listed is invisible and unqueryable.
{
"version": 1,
"maxRows": 200,
"statementTimeoutMs": 5000,
"tables": {
"public.orders": { "columns": "*" },
"public.order_items": { "columns": "*" },
"public.customers": { "columns": ["id", "name", "city", "created_at"] }
},
"denyFunctions": []
}Two consequences are enforced in code, not just documented:
"columns": "*"includes future columns: anything anALTER TABLEadds later becomes visible without a policy change.init-policyemits explicit lists so this is a deliberate choice. Prefer explicit lists for sensitive tables.SELECT *against a column-restricted table is rejected, with a message naming the allowed columns. The server never silently rewrites your query into a different column list — a result that differs from what you asked for is more dangerous than a refusal.
denyFunctions extends a built-in list (pg_read_file, pg_ls_dir, dblink, lo_import, lo_export, pg_sleep, pg_terminate_backend, set_config, and relatives). The built-ins always apply; the file can only add names.
An invalid policy fails startup with a message naming the offending field. It never falls back to a default.
What a refusal looks like
Real output, demo dataset:
> run_query: SELECT * FROM users
table public.users is not in the access policy; run describe_access to see what is visible> run_query: SELECT email FROM customers
column email is not in the access policy for public.customers; allowed columns for public.customers: id, name, city, created_at> run_query: WITH x AS (INSERT INTO orders ... RETURNING *) SELECT * FROM x
WITH x AS (...) does not contain a SELECT; write-capable CTEs (INSERT/UPDATE/DELETE ... RETURNING) are not acceptedThe full hostile-input suite — DML/DDL, SELECT INTO, write CTEs, multi-statement, comment smuggling, allowlist violations, CTE shadowing, system catalogs, denylisted functions, COPY TO PROGRAM, locking clauses, resource exhaustion — lives in tests/policy.attacks.test.ts. Every case must be denied and name the rule that denied it. The suite also contains the queries that must pass (joins, aggregates, window functions, read-only CTEs), so the gate is proven to be a filter, not a reject-everything wall.
The suite grows adversarially. Before release, the bundled review subagent (.claude/agents/sql-gate-bypass-hunter.md) was turned loose on the gate and found five real bypasses, each reproduced against the built code: schema-qualified 3-part column references (public.customers.email), whole-row field selection ((alias).email, (alias).*), correlated references to hidden outer-scope columns (SELECT (SELECT c.email) FROM customers c), named WINDOW clauses ordering by hidden columns, and the *_to_xml* function family (query_to_xml executes its string argument as SQL). All five are closed and are now permanent regression cases in the suite, next to a UNION smuggling path found the same way during the build. This is the intended workflow: the subagent's job is to keep finding what the gate misses, and the suite is where those findings go to die.
Tools
Six tools, and no write tool — not even behind a flag. This server does not have a write path to disable; that is a design decision, not a missing feature. The count is deliberately small: the value of this server is in the enforcement path, not in tool count.
Tool | Purpose |
| The effective policy: visible tables and columns, row cap, timeout, whether a role or RLS claims are active. The agent can say "I am not allowed to see that column" instead of failing mysteriously. Start here. |
| Allowlisted tables with estimated row counts and comments |
| Columns (only those the policy exposes), types, nullability, PK/FK, indexes |
| Structured reads: one table, simple filters, a limit. The no-SQL path for simple questions |
| A single read-only |
|
|
Schema introspection is filtered by the same policy as queries: the model never learns that users.password_hash exists.
Audit log
One JSONL line per tool call, including denials — a recorded refusal is what makes this an audit log rather than a query log. Defaults to stderr; set PGGUARD_AUDIT_LOG to write to a file.
{"ts":"2026-07-29T08:28:00.258Z","tool":"run_query","sql":"SELECT * FROM users","paramCount":0,"decision":"deny","rule":"table-not-allowed","durationMs":0}Fields: timestamp, tool, normalized SQL, parameter count, decision (allow/deny), the rule that triggered a denial, rows returned, duration, whether the response was trimmed. Parameter values and result rows are never logged — an audit log that leaks the data it guards defeats its own purpose.
Deployment: the database side
The server enforces its own layers, but the strongest deployment also restricts the role it connects as. Create a read-only role and grant only what the policy allows:
CREATE ROLE agent_ro LOGIN PASSWORD '...';
GRANT CONNECT ON DATABASE app TO agent_ro;
GRANT USAGE ON SCHEMA public TO agent_ro;
GRANT SELECT ON public.orders, public.order_items TO agent_ro;
GRANT SELECT (id, name, city, created_at) ON public.customers TO agent_ro;
ALTER ROLE agent_ro SET default_transaction_read_only = on;With PGGUARD_ROLE set, the server runs SET LOCAL ROLE inside each query transaction, so grants and row-level security policies apply even when the connecting user is broader. With PGGUARD_CLAIMS set, request.jwt.claims is set per transaction — the standard Supabase RLS path. Column-level GRANT SELECT (col, ...) means even a total failure of the server's policy engine still cannot read hidden columns.
Environment variables
Variable | Default | Purpose |
| empty → demo mode | Postgres connection string |
| bundled demo policy | Path to the policy file |
| empty |
|
| empty | JSON for |
| stderr | Path for the JSONL audit log |
|
| Response size cap per tool call |
The variables are prefixed on purpose: DATABASE_URL is too common a name for a process that inherits its environment from an MCP client.
Stated limitations
stdio only. No HTTP/SSE transport. One database per process; run two processes for two databases.
In demo mode (PGlite),
statement_timeoutdoes not interrupt a running query. PGlite is single-threaded WASM with no interrupt mechanism — verified against PGlite 0.5.4 on 2026-07-29. The read-only transaction, roles, grants, and RLS all work in demo mode; the timeout is set but will not cut a CPU-bound query. Against a real Postgres server overPGGUARD_DATABASE_URL,statement_timeoutis standard server behavior and does fire.The parser is layer two. Column checks are conservative by design: an unqualified column is rejected if any column-restricted table in scope does not allow it (qualify the column to fix), and qualified references the gate cannot resolve are left to the database. The read-only transaction and role grants are what these checks defer to.
Quoted mixed-case identifiers are out of scope. Policy keys are matched case-insensitively, the way unquoted SQL identifiers fold. A table created as
"Orders"with quotes needs a policy written to match, and is a reason to prefer lowercase DDL.No write path, no query cache, no multi-tenancy. Each is a different product, not a roadmap item.
Context
As of 2026-07-29, the official reference server @modelcontextprotocol/server-postgres is marked deprecated on npm, and the high-download alternative (@supabase/mcp-server-supabase, ~119k weekly downloads) is oriented toward project management — migrations, logs, branches — rather than policy-gated read access for agents. This server exists in that gap: deny-by-default policy, column-level allowlists, an audit log that records refusals, and a public attack suite as the evidence.
Development
npm install
npm run build # tsc
npm test # vitest: attack suite + tool integration over PGlite, no Docker
npm run generate:seed # regenerate seed/demo.sql deterministicallyseed/generate.ts uses a fixed seed; regeneration must produce byte-identical output. If it does not, the generator picked up nondeterminism — fix the generator, never hand-edit the SQL.
The .claude/ setup is part of the repo's workflow: an adversarial-review subagent (agents/sql-gate-bypass-hunter.md) that tries to sneak reads or writes past the gate and turns successes into failing attack-suite cases, a skill (skills/run-attack-suite/) that runs the suite and checks its coverage, and two hooks wired in settings.json — hooks/no-stdout-log.sh keeps stray console.log out of the stdio server, and hooks/no-null-bytes.sh blocks git commit when a staged text file contains null bytes (a guard against UTF-16 output from PowerShell redirects, which once published an empty README to npm on a sibling project). The .claude/ hooks only see commits made by the agent, so the null-byte check also exists as a real git hook in githooks/pre-commit; enable it per clone with git config core.hooksPath githooks.
License
MIT — see LICENSE.
Available Tools
6 toolsdescribe_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.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided. The description implies read-only behavior by saying 'Show' and details what information is returned, but doesn't explicitly state it's a safe read operation or mention any side effects.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two concise sentences with the core purpose first, no fluff. Every word adds value.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Lists all key elements returned (tables/columns, row cap, timeout, RLS status). Without an output schema, this is sufficient context for a policy inspection tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
No parameters, so baseline 4 applies. The description doesn't need to add parameter info beyond the empty schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states 'Show the effective access policy' and lists specific details (tables/columns, row cap, timeout, RLS). This distinguishes it from sibling tools like list_tables or describe_table.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly advises to call before querying to avoid asking for inaccessible data. While it doesn't list alternatives, the use case is clearly scoped.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
describe_tableA
Describe one allowlisted table: columns (only those the policy exposes), types, nullability, primary key, foreign key targets, and indexes.
| Name | Required | Description | Default |
|---|---|---|---|
| table | Yes | Qualified table name, e.g. "public.orders" |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries full burden. It discloses the authorization constraint (allowlisted) and the scope of returned info (columns exposed by policy, types, etc.). Does not mention side effects or errors, which are minor given the read-only nature implied by 'describe'.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Single sentence, front-loaded with the action, and efficiently lists all return aspects. No redundant words; every piece earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the simple tool (1 param, no output schema), the description is nearly complete. It covers purpose, input constraint, and output content. Minor gap: no mention of error handling for nonexistent tables, but this is acceptable for a straightforward describe tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so baseline is 3. The description adds value by reinforcing that the table must be allowlisted and by providing a concrete example ('public.orders'), which aids correct parameter usage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses specific verb 'describe' and resource 'one allowlisted table', listing exactly what metadata is returned (columns, types, nullability, keys, indexes). It clearly distinguishes from siblings like list_tables (listing tables) and run_query (executing SQL).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implicitly indicates use for table schema inspection, but lacks explicit guidance on when not to use or alternatives. However, the context of sibling tools and the specific language about allowlisted tables provides sufficient contextual clarity.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
explain_queryA
Show the query plan for a read-only SELECT without executing it (EXPLAIN, never EXPLAIN ANALYZE). Same policy gate as run_query.
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | A single read-only SELECT statement, checked against the same policy as run_query |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Without annotations, the description carries full burden. It explicitly states the tool is read-only, never executes (EXPLAIN, not EXPLAIN ANALYZE), and enforces the same policy gate as run_query. This sufficiently discloses behavioral traits.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise with two sentences, front-loaded with the core purpose, and contains no unnecessary words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity (1 param, no output schema), the description covers essential aspects: what it does, how it differs from run_query, and policy gate. It could be slightly more complete by mentioning output format, but is adequate.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so baseline is 3. The description adds value by specifying the sql parameter must be read-only and subject to the same policy as run_query, beyond the schema's minimal description.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states it shows the query plan for a read-only SELECT without executing it, specifically using EXPLAIN. It distinguishes from siblings like run_query and sample_rows by mentioning 'never EXPLAIN ANALYZE' and 'Same policy gate as run_query'.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides context by referencing the same policy as run_query, implying it's for read-only analysis. However, it does not explicitly state when not to use it or directly compare with alternatives.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
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.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Without annotations, the description discloses the scope limitation (only visible tables) and the output content (row counts, comments), which is adequate for a read-only list operation.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two concise sentences, front-loaded with the main action and followed by a key constraint, with no wasted words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description is complete for a parameterless list tool: it explains what it does, what it returns (estimated row counts, comments), and a critical limitation (visibility under access policy). No output schema needed given the simplicity.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
With zero parameters, baseline is 4. The description adds value by describing the output (row counts, comments), compensating for the lack of parameters.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states it lists tables visible under the access policy with row counts and comments, and distinguishes from sibling tools like describe_table which focuses on a single table.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It explains that only tables within the access policy are listed and those outside cannot be queried, providing context for when to use this tool, though it does not explicitly state when not to use it.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
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.
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | A single read-only SELECT statement. Joins, aggregates, window functions, and read-only CTEs are fine. Anything else — DML, DDL, multiple statements, SELECT INTO, FOR UPDATE, denied functions, tables or columns outside the access policy — is rejected with the rule that triggered it. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description fully covers behavioral details: parsing with real PostgreSQL grammar, access policy check, read-only transaction, statement timeout, row cap, and error messages that name the denying rule. This is comprehensive for a query execution tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a concise three-sentence paragraph, front-loaded with the core purpose. Every sentence adds distinct value: purpose, execution details, and error reporting. No unnecessary words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the single parameter with full schema coverage and no output schema, the description adequately covers purpose, behavior, and constraints. However, it does not explicitly describe the return format (e.g., rows as JSON), which might be assumed but is not stated.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema already provides a detailed description for the 'sql' parameter (100% coverage). The tool description adds context about the execution environment (read-only transaction, timeout, row cap) and error behavior, which supplements the schema without repeating it.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description begins with 'Run one read-only SELECT against the allowlisted tables,' which clearly states the action (run), the resource (SELECT query on tables), and the scope (allowlisted, read-only). This distinguishes it from sibling tools like 'list_tables' or 'sample_rows' that handle different operations.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description specifies that the tool only accepts read-only SELECT statements and details what is rejected (DML, DDL, multiple statements, etc.). While it does not explicitly name alternative tools for those cases, the constraints make the appropriate usage clear.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
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.
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Row cap; values above the policy cap are clamped to it | |
| table | Yes | Qualified table name, e.g. "public.orders" | |
| filters | No | Simple equality/range/contains filters, ANDed together |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations exist, so the description carries full burden. It discloses the read-only nature and filter capabilities, but does not describe return format or default limit behavior, which would enhance transparency.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two efficient sentences: first defines purpose and capabilities, second offers usage guidance. No redundant words, front-loaded with key information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a read tool with three parameters and no output schema, the description adequately covers purpose, filters, and sibling differentiation. Missing output format description is a minor gap, but overall complete enough.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
All three parameters have schema descriptions (100% coverage), so baseline is 3. The tool description adds minimal extra meaning beyond the schema, only reiterating filter simplicity and limiting.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states it reads rows from one allowlisted table with specific filter operations and a limit, and distinguishes itself from sibling 'run_query' by specifying its use case for straightforward lookups versus joins/aggregations.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly advises when to use this tool ('straightforward lookups') and when to use the alternative 'run_query' (joins and aggregations), providing clear context for selection.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
6 tool updates
v0.1.0- First observed
describe_access - First observed
describe_table - First observed
explain_query - First observed
list_tables - First observed
run_query - First observed
sample_rows
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.
Maintenance
Related MCP Connectors
Safe, read-only Postgres and MySQL access for AI agents. Audit log + column-level controls.
Query 40 databases from Claude, ChatGPT, or Cursor — on any device. Read-only, encrypted, audited.
Query PostgreSQL databases in plain English — LLM-generated, safety-validated SQL.
Query your Postgres from ChatGPT or Claude without exposing the database or handing over credentials. Run npx boltschema connect next to your database and it dials out over HTTPS — no inbound firewall rule, no open port, works with localhost and VPC-private databases. Read-only is enforced by a SQL guard, a Postgres READ ONLY transaction, and a scoped role generated for you.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides secure, read-only access to PostgreSQL databases for schema inspection and data querying. It enables users to list tables, describe structures, and execute SELECT statements while strictly blocking destructive operations.71MIT
- AlicenseNot gradedqualityDmaintenanceRead-only access to PostgreSQL databases, enabling schema inspection and safe SQL queries.15MIT
- AlicenseNot gradedqualityCmaintenanceEnables safe, read-only querying of PostgreSQL databases with defense-in-depth protections including single-statement SELECT guard, row caps, and per-identity audit logging.1MIT
- AlicenseNot gradedqualityBmaintenanceProvides read-only access to PostgreSQL databases via MCP, enforcing least-privilege roles, row-level security, masked views, and SQL AST guardrails to prevent data leakage and unauthorized operations, enabling AI agents to safely query sensitive production data.MIT