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
claude mcp add --env MIDPLANE_TOKEN=<MIDPLANE_TOKEN> --transport stdio gateway -- npx -y midplaneWhat 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
userswhereroleis admin - Check the
midplanegateway audit log
How to install Midplane
Platform CLI
claude mcp add --env MIDPLANE_TOKEN=<MIDPLANE_TOKEN> --transport stdio gateway -- npx -y midplaneReplace <…> with your own values
Platform CLI
codex mcp add gateway --env MIDPLANE_TOKEN=<MIDPLANE_TOKEN> -- npx -y midplaneReplace <…> with your own values
Config file
{
"mcpServers": {
"gateway": {
"command": "npx",
"args": [
"-y",
"midplane"
],
"env": {
"MIDPLANE_TOKEN": "<MIDPLANE_TOKEN>"
}
}
}
}Replace <…> with your own values
Config file
{
"servers": {
"gateway": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"midplane"
],
"env": {
"MIDPLANE_TOKEN": "<MIDPLANE_TOKEN>"
}
}
}
}Replace <…> with your own values
Platform CLI
gemini mcp add -e MIDPLANE_TOKEN=<MIDPLANE_TOKEN> gateway npx -y midplaneReplace <…> 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.