Skip to main content
MCP server CX Codex

Midplane — Claude Code MCP server: what it does, how to install

Midplane — an MCP server that gives agents Postgres access with policies, column masking and query audit trails.

MIT ★ 6 updated 2026-10-23

Install into Claude Code · Platform CLI All methods and platforms ↓
claude mcp add --env MIDPLANE_TOKEN=<MIDPLANE_TOKEN> --transport stdio gateway -- npx -y midplane
Open on GitHub

What Midplane does

Midplane sits between an agent and a database. The agent sends SQL, the server validates it against policies, masks columns and logs the query. The agent sees only what you allow, write queries can wait for manual approval. The server runs next to your databases, only agents connect to it.

Two modes: local with policies in a YAML file and tokens from midplane token, and linked mode where policies, logs and approvals come from Midplane Cloud. The midplane setup command prompts for connection strings, validates them and writes the gateway configuration. The audit log lives on the gateway's disk in a hash chain, export with midplane audit export, verify with midplane audit verify.

Node 24.16 or newer required.

What it helps with

  • grant an agent table access in Postgres with masked data
  • validate an agent's SQL statements before execution
  • record every query an agent sends in an audit log
  • hold write queries until a person approves them
  • contain an agent after it reads untrusted content

Example prompts for the agent

  • Show tables in the database via midplane
  • Select all rows from users where role is admin
  • Check the midplane gateway audit log

How to install Midplane

Platform CLI

claude mcp add --env MIDPLANE_TOKEN=<MIDPLANE_TOKEN> --transport stdio gateway -- npx -y midplane

Replace <…> with your own values

Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more

Questions about Midplane

How to install Midplane in Claude Code?

Run claude mcp add --env MIDPLANE_TOKEN=<MIDPLANE_TOKEN> --transport stdio gateway -- npx -y midplane, substituting your token.

What does Midplane do?

Midplane validates an agent's SQL queries against policies, masks columns, logs queries and holds write statements until a person approves them.

What Node version does Midplane need?

Node 24.16 or newer.

Similar MCP servers

All MCP servers for Data and databases →

Project sponsors

Companies that keep this analytics open