Midplane MCP server
Safe-by-default SQL guardrails for AI agents: AST-checked queries, per-table policy, audit log.
5 stars55 downloads/wk
Reviews
Write oneNobody has reviewed Midplane yet.
If you have run it, two minutes of your experience saves the next person an afternoon.
Midplane tools (5)
write = sends, deletes, buys or postsRead from the package source without running it. The installed server may list more.
check_approvalPoll a held write's approval status WITHOUT running anything. Use this to wait — it is cheap, safe to call repeatedly, and never consumes the approval. Returns pending (with its deadline), approved (call query again with the same sql and intent to actually execute it), executed (already ran — do not repeat), denied (with the reviewer's note), or expired. Never returns the statement or its results.
describe_tableReturns column name, data type, nullability, and default. Routed through the policy + audit pipeline.
list_databasesReturns each database's name, whether tenant_scope is enforced, and its table_access default. Use this to discover which `database` values to pass to `query`, `describe_table`, and `list_tables`.
list_tablesRouted through the same policy + audit pipeline. Defaults to the 'public' schema.
queryParses the SQL with libpg_query, applies Midplane policy (table_access, multi_statement, tenant_scope, parse_error), audits the call, and returns rows on ALLOW. Denials return policy_rule + reason; the call is still audited. Required `intent` field captures why the query is being run (visible in audit logs).
Public scan report
scanner v0.1.9 · 2026-09-21 · same rubric, same numbers if you re-run it
- Code scan3 source files scanned25/25
- –Live reliabilityno gateway calls yet and no remote to proben/a
- –Tool poisoningtools not inspected (local package is not executed); not countedn/a
- Auth qualitystatic API keys via environment variables6/15
- Maintenancelast push 24 days ago15/15
- Maintainer identitynamespace and repository owner differ; website matches verified namespace6/10
What the publisher says
From the Midplane repository's README, as published. We do not edit it. Read it on GitHub
Midplane
Postgres MCP server for AI agents. Connect the tables you've been keeping off-limits. PII masked at the source, policy enforced on the SQL AST, writes held for human approval, everything audited. MIT, self-hostable.
Midplane sits in the query path between an AI agent (Claude, Cursor, any MCP client) and your Postgres database. Every statement is parsed into a real Postgres AST — not matched against a regex blocklist — checked against a declarative per-table policy, rewritten so masked columns never leave the database in the clear, and recorded in an event-sourced audit log before it executes.
📖 Full documentation lives at midplane.ai/docs —
agent setup, the policy reference, self-hosting, deployment, and the threat model.
This README is just the orientation.
Why this exists
AI coding agents are being plugged into production Postgres without an audit trail or a safety layer. The deprecated Anthropic reference Postgres MCP shipped a stacked-statement injection vector (Datadog Security Labs, 2025); the common service-role setup hands an agent a connection that can read and write every table. So the tables that would make an agent genuinely useful — customers, orders, subscriptions — stay off-limits, because "a read-only role and good intentions" isn't a control anyone can show a security reviewer. Midplane is that control.
What it does
the query's source relation, so the raw value never leaves Postgres — masking applies inside joins, filters, and aggregates rather than being scrubbed out of the rows on the way back. Transforms range from full-redact and null-out to consistent-hash (deterministic, salted, so masked join keys still join), partial, generalize, pseudonymize, and noise. It fails closed: anything the engine can't prove is masked — an unvetted function that could read the table behind the parser's back, a result column whose provenance doesn't map to a known base column — denies the query rather than risk an unmasked value.
- PII masked at the source. Declare a column masked and the engine rewrites
— Postgres's own parser — and checked against a per-table policy of deny / read / read_write, plus optional tenant scoping and categorical write guardrails. The walk is recursive, so a write buried in a CTE, subquery, or UNION arm is caught at the write, not at the outer SELECT.
- Policy enforced on the SQL AST. Every statement is parsed by libpg_query
engine pauses the statement after the policy has allowed it and asks a human. The agent gets a check_approval tool and re-runs when the answer lands; a denial carries the reviewer's note back, so "use the refunds table instead" reaches the agent. Approvals sit under the policy, never over it — nothing the policy denied can be approved into running.
- Writes held for human approval. Opt a write class into approvals and the
agent, which token, the statement, the decision and its reason, and which columns were masked. Local SQLite for the standalone engine; a queryable, exportable audit log in the app.
- Everything audited. An event-sourced log written before execution: which
What it blocks
Out of the box, before you configure anything:
Shortened. The full README is on GitHub.
Nothing above is checked by us. What we check is on the safety report.
Install directly
Runs npx -y midplane on your machine. Read the scan report first; the gateway never runs local packages.
claude mcp add midplane -- npx -y midplane
Midplane: common questions
- Is Midplane MCP server safe?
- Mostly: it is graded B (80/100). Read the Midplane safety report
- How do I install Midplane?
- It runs on your machine. Copy the Claude Code, Claude Desktop or Cursor config from the install section.
- Does Midplane need an API key?
- Yes. The registry entry asks for
DATABASE_URL. - Is Midplane maintained?
- The last commit was 24 days ago (2026-08-28). The latest release is v0.20.0.
- What can I use instead of Midplane?
- Servers from other publishers that do the same job: Shrike MCP server, MySQL (security-first) MCP server and Grain MCP server. Compare all Midplane alternatives.
Alternatives to Midplane
Same job from other publishers: the closest match first, then the best rated.
- ShrikeGoverns what AI agents do: tool calls, SQL, commands, files checked against policy before they run.not reviewedGrowingA
- MySQL (security-first)Security-first MySQL MCP server with AST validation, table whitelist, schema resources, and audit.not reviewedGrowingB
GrainRun SQL queries and inspect database schemas through safe, visible MCP tools.not reviewedGrowingB- Schemacrawler AIEnables natural language schema queries — explore tables, keys, procedures, and get SQL help fastnot reviewedGrowingB
- Microsoft SQL ServerRead-only-by-default SQL Server: schema, parameterized SELECT, execution plans; writes opt-in.not reviewedGrowingB