Midplane
OfficialClick on "Install 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., "@MidplaneShow me which queries were blocked in the last hour."
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.
Midplane
Safe-by-default SQL guardrails for AI agents. Midplane sits in the query path between an AI agent (Claude, Cursor, any MCP client) and your Postgres database. It parses every statement with a real SQL AST โ not a regex blocklist โ enforces a declarative per-table access policy, blocks destructive DML/DDL, and writes an event-sourced audit log of which agent ran what, before the query 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. Midplane parses every query as an AST, denies the dangerous shapes, and writes a durable audit row before the query reaches your database.
Related MCP server: sql-steward
What it blocks
Destructive writes by default โ
DELETE FROM usersis denied even with aWHERE, until you opt the table intoread_write.Whole-table wipes and schema destruction โ no-
WHEREDELETE/UPDATEand allDROP/TRUNCATE/ALTER, regardless of table policy.Stacked-statement injection โ
SELECT 1; DROP TABLE usersdenied at parse time.Writes hidden inside a read โ
WITH x AS (DELETE FROM users RETURNING *) SELECT * FROM xis denied at the innerDELETE, not the outerSELECT. The same recursive walk covers subqueries, UNION arms, and JOINs.
The full policy model, the parse โ policy โ audit pipeline, and the adversarial corpus that pins it are documented at midplane.ai/docs.
In a real chat
A delete all users prompt to Claude Code, against a Midplane-fronted DB:
โบ Hold on โ that's destructive and irreversible. Before I run
DELETE FROM public.users, please confirm.user: confirm delete all users
โบ Midplane blocked it: "writes to table
usersare not allowed by the table-access policy." The DELETE was audited but not executed.
Quick start
Three ways in โ same open-core codebase behind all of them. Step-by-step guides are at midplane.ai/docs.
Managed cloud
The fastest way to try Midplane: sign up at app.midplane.ai and go from zero to your first guarded query in a couple of minutes. Dashboard, policy editor, hosted audit log, agent-token issuance. Nothing to install, multi-region, fully supported.
Guard one database yourself
Put the MIT engine in front of a Postgres database and point an agent at it.
Nothing to install โ npx ships with Node and fetches the
midplane package on first run
(needs Node 22.16+; on anything older it says so and exits). Add this to your
MCP client's config (Claude Code, Claude Desktop, Cursor โ they all take this
shape):
{
"mcpServers": {
"midplane": {
"command": "npx",
"args": ["-y", "midplane", "server", "--stdio"],
"env": { "DATABASE_URL": "postgres://user:pass@host:5432/db" }
}
}
}Keep the connection string in that env block rather than on a command line,
where it would leak to ps aux and your shell history. The block still lands in
a plaintext config file, so give Midplane its own least-privilege Postgres role:
it governs which SQL runs, not what the role underneath it can reach.
That config is already the safe default: reads allowed, writes and DDL denied,
every query audited to ~/.midplane/audit.db. Read the log back with
npx midplane audit denies. To open specific tables up, generate a policy with
npx midplane init โ it introspects your schema over a read-only connection,
suggests a tenant column, and writes a validated midplane.policy.yaml.
For a CI pipeline or a long-lived sidecar, the same engine ships as a self-contained image with no Node in it โ
midplane/midplane:0.19.0, serving Streamable HTTP instead of stdio. Setup ยทengine/README.md.
Self-host the whole app
The complete single-tenant product โ dashboard, policy editor, audit log, agent-token issuance โ keyless and uncapped, on your own Postgres. Docker is the only prerequisite:
git clone https://github.com/midplaneai/midplane && cd midplane
./bin/self-host up # โ http://localhost:3000That generates secrets into .env.self-host, brings up Postgres + the web app,
applies migrations on boot, and prints the dashboard URL โ the first
email+password signup becomes the owner.
Running from source, the single-image deploy, the engine-spawn topology, and the
full walkthrough: midplane.ai/docs (in-repo:
SELF_HOST.md).
Open core
Midplane is open core, MIT, and self-hostable. Everything outside
apps/web/src/ee/ is the Community Edition โ the whole single-tenant product,
uncapped when self-hosted. apps/web/src/ee/ is the commercial Enterprise Edition
(SSO/SAML today; the governance band over time); deleting it leaves a working MIT
build. The managed cloud is the same codebase and the supported, paid path. See
LICENSE for the MIT terms and NOTICE for the ee/
carve-out.
Architecture
One codebase, two deployables:
Control plane (repo root) โ dashboard, policy management, audit views, agent-token issuance, hosted MCP proxy. MIT except
apps/web/src/ee/.Engine (
engine/) โ the MIT query-path engine, compiled to a self-contained binary. The control plane spawns it per project and never reimplements it, so hosted and self-host run the exact same engine โ only the packaging differs.
apps/web Next.js dashboard + Better Auth + projects API
packages/db Drizzle schema (customers, projects, audit index)
packages/kms encryptDsn / decryptDsn (env-mode dev, AWS KMS prod)
packages/router Hosted MCP request handler โ token โ project โ engine
engine/ The MIT query-path engine
infra/telemetry-proxy Cloudflare Worker for anonymized OSS install telemetryOperating the managed multi-region cloud (Fly + Neon + KMS) is in
docs/deploy.md.
Contributing
Issues and PRs welcome โ start with CONTRIBUTING.md. The
single highest-leverage contribution is a new entry in the adversarial SQL corpus:
a bypass attempt and the policy fix that defeats it. Commits are DCO-signed
(git commit -s). For security issues, follow SECURITY.md โ
don't open a public issue.
License
MIT โ see LICENSE. No copyleft, no BSL, no source-available rug-pull.
The one carve-out is apps/web/src/ee/ (the commercial Enterprise Edition, governed
by apps/web/src/ee/LICENSE and recorded in
NOTICE); deleting it leaves a fully working MIT build.
More: Docs ยท Pricing ยท Support ยท Design system ยท Code of Conduct
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityAmaintenanceSecure SQL proxy for AI agents. Translates natural language to safe SQL via Claude, validates at the AST level (SELECT-only, no DDL/DML), enforces per-agent row-level security, and audit-logs every query.1MIT
- AlicenseAqualityFmaintenanceA governed SQL gateway that exposes typed tools to AI agents, compiling safe read-only queries from a semantic layer while blocking PII before execution, supporting SQL Server, Postgres, and SQLite.9MIT
- AlicenseNot gradedqualityBmaintenanceConnects AI assistants to PostgreSQL databases with production-grade safety features including query validation, guarded writes, rate limiting, and audit logging.2MIT
- AlicenseNot gradedqualityCmaintenanceA default-deny SQL firewall sidecar for AI agents that enforces per-agent policies on database queries, provides safe rewrites, and maintains a tamper-evident audit chain.AGPL 3.0
Related MCP Connectors
Query PostgreSQL databases in plain English โ LLM-generated, safety-validated SQL.
The WAF for agents. Pattern-based + heuristic firewall scans prompts, RAG documents, tool argume...
See, price, and control every tool call your AI agents make: policy checks, cost, and audit tools.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/midplaneai/midplane'
If you have feedback or need assistance with the MCP directory API, please join our Discord server