Lets AI agents query Postgres tables through policy checks, masked columns, approval-gated writes, and a hash-chained audit log.
Also known as midplaneai/midplane
- Stars
- 5
- Tools
- —
- Downloads, 30 days
- 1,624
- Latest version
- 0.26.2
- Last commit
- Nov 14, 2026
- License
- MIT
What is Midplane MCP?
Midplane lets AI agents query Postgres tables through policy checks, masked columns, approval-gated writes, and a hash-chained audit log.
Summary generated from the project's README
About Midplane MCP server
Securing database interactions for AI agents by placing a controlled gateway between the model and your Postgres instances is the primary function of Midplane. It allows developers to grant specific table access while enforcing column masking and requiring human approval for write operations. The server parses every statement to ensure compliance with defined policies before execution, providing a layer of containment when agents process untrusted content.
Users can deploy this in local mode using a YAML file for policies and tokens generated via the midplane token command, or in linked mode which connects to Midplane Cloud for managing identities and approvals. The gateway runs alongside your databases and maintains a hash-chained audit log on local disk. You can manage these logs using the midplane audit export and midplane audit verify commands to ensure data integrity. It requires Node 24.16 or newer to run.
What you can do with it
- 1Enforce data privacy through maskingAsk an AI agent to query a user table while ensuring sensitive columns remain hidden.
- 2Require human oversight for database writesInstruct an agent to update a record and wait for a manual approval step.
- 3Verify the integrity of database logsRun a command to check that the history of agent queries has not been tampered with.
Written from the project's README. Every use case is checked against a quote from it.
How to install Midplane MCP
Formats verified 10 Nov 2026Add to CursorAdd to GooseInstall Midplane MCP in Claude Code
$ claude mcp add --env 'MIDPLANE_TOKEN=<YOUR_MIDPLANE_TOKEN>' midplane -- npx -y midplaneInstall Midplane MCP in Cursor
~/.cursor/mcp.json
{
"mcpServers": {
"midplane": {
"command": "npx",
"args": [
"-y",
"midplane"
],
"env": {
"MIDPLANE_TOKEN": "<YOUR_MIDPLANE_TOKEN>"
}
}
}
}Install Midplane MCP in VS Code
.vscode/mcp.json
{
"servers": {
"midplane": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"midplane"
],
"env": {
"MIDPLANE_TOKEN": "<YOUR_MIDPLANE_TOKEN>"
}
}
}
}Install Midplane MCP in VS Code CLI
$ code --add-mcp '{"name":"midplane","type":"stdio","command":"npx","args":["-y","midplane"],"env":{"MIDPLANE_TOKEN":"<YOUR_MIDPLANE_TOKEN>"}}'Install Midplane MCP in Claude Desktop
claude_desktop_config.json
{
"mcpServers": {
"midplane": {
"command": "npx",
"args": [
"-y",
"midplane"
],
"env": {
"MIDPLANE_TOKEN": "<YOUR_MIDPLANE_TOKEN>"
}
}
}
}Install Midplane MCP in Codex
$ codex mcp add midplane --env 'MIDPLANE_TOKEN=<YOUR_MIDPLANE_TOKEN>' -- npx -y midplaneInstall Midplane MCP in Codex config.toml
~/.codex/config.toml
[mcp_servers.midplane] command = "npx" args = ["-y", "midplane"] [mcp_servers.midplane.env] MIDPLANE_TOKEN = "<YOUR_MIDPLANE_TOKEN>"
Install Midplane MCP in Gemini CLI
$ gemini mcp add -s user -e 'MIDPLANE_TOKEN=<YOUR_MIDPLANE_TOKEN>' midplane npx -- -y midplaneInstall Midplane MCP in Gemini settings.json
~/.gemini/settings.json
{
"mcpServers": {
"midplane": {
"command": "npx",
"args": [
"-y",
"midplane"
],
"env": {
"MIDPLANE_TOKEN": "<YOUR_MIDPLANE_TOKEN>"
}
}
}
}Configuration
MIDPLANE_TOKENRequiredSecretA token from `midplane token`, verified at start and on every call. It stays in this entry, so give it a --ttl (seconds) as long as the entry should work: the default is an hour.
Automated checks
Ran Nov 12, 2026Full report →Passed our automated checks. That is not a security audit: read the code and give the server the narrowest access it needs. How checks work
- Source repository linked and reachablePass
- Open source license (OSI)Pass
- Commit or release in the last yearPass
- Package name not close to a popular packagePass
- Remote endpoint uses HTTPSNot checked
- Destructive tools are labelledNot checked
- No hidden instructions to the modelPass
- No critical advisory in the package or its dependenciesPass
README
View on GitHubmidplane
The Midplane gateway: an MCP server that sits between AI agents and your Postgres databases. Every statement an agent sends is parsed, checked against a policy and recorded before it runs. Agents get table access you grant, masked columns, writes held for a person's approval, and containment once they read untrusted content. It runs next to your databases; nothing connects in to it but agents.
npx midplane --version
Node 24.16 or newer.
- Local mode (
midplane local): the policy lives in a YAML file and tokens come frommidplane token. Try it with the quickstart. - Linked mode (
midplane gateway): policy, identities, approvals and a query log come from Midplane Cloud, over a link the gateway opens.midplane setupmakes one: it asks for each database's connection string, tests it, writes the gateway's folder, enrolls and starts it. - The audit log stays on the gateway's disk, hash-chained:
midplane audit exportandmidplane audit verify.
Documentation: https://midplane.ai/docs.
The image: ghcr.io/midplaneai/midplane. Both are signed: see
verifying a release.
MIT licensed.
Midplane MCP questions
How do I add Midplane MCP to Claude Code?
Run claude mcp add --env 'MIDPLANE_TOKEN=<YOUR_MIDPLANE_TOKEN>' midplane -- npx -y midplane in your terminal. Add --scope user to make it available in every project.
How do I add Midplane MCP to Cursor?
Open ~/.cursor/mcp.json and add the server under mcpServers, using the Cursor config shown in the install section above.
What does Midplane do between AI agents and Postgres?
Midplane is an MCP gateway that parses every statement an agent sends, checks it against a policy, and records it before it runs, granting table access, masking columns, and holding writes for approval.
How do I run Midplane in local mode?
In local mode the policy lives in a YAML file and tokens come from midplane token.
Where is Midplane's audit log stored and how can I export it?
The audit log stays on the gateway's disk and is hash-chained, and you can export or verify it with the audit commands.
What Node version does Midplane require?
Midplane requires Node 24.16 or newer.
Is Midplane open source?
Yes, Midplane is MIT licensed.