# Midplane

> Midplane is an open-source MCP server for databases. Postgres gateway for AI agents with table grants, column masking and approval for writes. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, self-hosted
- **Website:** https://midplane.ai/docs
- **Repository:** https://github.com/midplaneai/midplane/tree/HEAD/apps/gateway
- **GitHub stars:** 5
- **License:** MIT
- **MCP Registry name:** ai.midplane/midplane
- **Categories:** databases, security
- **Listing updated:** 2026-11-15

## About

Every statement an agent sends is parsed, checked against a policy and logged before it reaches the database. The README lists four controls: table access you grant, masked columns, writes held for a person's approval, and containment once an agent has read untrusted content.

It runs next to your databases, and only agents connect to it. In local mode the policy is a YAML file and tokens come from `midplane token`; in linked mode, started with `midplane gateway`, policy, identities, approvals and a query log come from Midplane Cloud over a link the gateway opens. The audit log stays on the gateway's disk, hash-chained, with `midplane audit export` and `midplane audit verify` commands.

It needs Node 24.16 or newer, is MIT licensed, and also ships as a signed container image at `ghcr.io/midplaneai/midplane`.

## Features

- **Policy-checked statements:** Each SQL statement is parsed and checked before it runs.
- **Table access grants:** Agents only reach the tables you allow.
- **Masking at the source:** Sensitive columns are masked before results reach the agent.
- **Write approvals:** Writes can be held until a person approves them.
- **Containment:** Restricts what an agent can do after it reads untrusted content.
- **Hash-chained audit log:** Stored on the gateway's disk and verifiable with midplane audit verify.

## Good for

- Give an agent read access to a production Postgres without exposing PII
- Require human sign-off on writes made by an AI agent
- Keep a verifiable record of every query an agent ran
- Try a policy locally from a YAML file before deploying

## Install

### Claude Code (Terminal)

```sh
claude mcp add midplane --env MIDPLANE_TOKEN='<MIDPLANE_TOKEN>' -- npx -y midplane
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "midplane": {
      "command": "npx",
      "args": [
        "-y",
        "midplane"
      ],
      "env": {
        "MIDPLANE_TOKEN": "<MIDPLANE_TOKEN>"
      }
    }
  }
}
```

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "midplane": {
      "command": "npx",
      "args": [
        "-y",
        "midplane"
      ],
      "env": {
        "MIDPLANE_TOKEN": "<MIDPLANE_TOKEN>"
      }
    }
  }
}
```

### VS Code (.vscode/mcp.json)

```json
{
  "servers": {
    "midplane": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "midplane"
      ],
      "env": {
        "MIDPLANE_TOKEN": "<MIDPLANE_TOKEN>"
      }
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

```json
{
  "mcpServers": {
    "midplane": {
      "command": "npx",
      "args": [
        "-y",
        "midplane"
      ],
      "env": {
        "MIDPLANE_TOKEN": "<MIDPLANE_TOKEN>"
      }
    }
  }
}
```

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "midplane": {
      "command": "npx",
      "args": [
        "-y",
        "midplane"
      ],
      "env": {
        "MIDPLANE_TOKEN": "<MIDPLANE_TOKEN>"
      }
    }
  }
}
```

## FAQ

### Does it connect out to my database from the cloud?

No. It runs next to your databases and only agents connect in; linked mode uses a link the gateway opens itself.

### What runtime does it need?

Node 24.16 or newer, or the signed container image.

### What licence is it under?

MIT.

### How do I verify the audit log?

Use midplane audit export and midplane audit verify.

### Is Midplane free?

Yes. Midplane is open source, so you can use and self-host it for free.

### How do I add Midplane to Claude Code?

Run this command in your terminal: claude mcp add midplane --env MIDPLANE_TOKEN='<MIDPLANE_TOKEN>' -- npx -y midplane

### What are the best alternatives to Midplane?

The closest alternatives to Midplane are REA, Agent Roast, Leash, Tinplate Edge AI Safety, Security & EU Compliance and SecureCloud.

## Alternatives

- [REA](https://ai-powered.com/mcp/rea): REA is an open-source MCP server for developer tools.
- [Agent Roast](https://ai-powered.com/mcp/agent-roast): Agent Roast is an open-source MCP server for developer tools.
- [Leash](https://ai-powered.com/mcp/leash): Leash is a free MCP server for security.
- [Tinplate Edge AI Safety, Security & EU Compliance](https://ai-powered.com/mcp/tinplate-edge-ai-safety-security-and-eu-compliance): Tinplate Edge AI Safety, Security & EU Compliance is a freemium MCP server for security.
- [SecureCloud](https://ai-powered.com/mcp/securecloud): SecureCloud is a free MCP server for security.
- [Eikino](https://ai-powered.com/mcp/eikino): Eikino is a freemium MCP server for security.
- [SynomosAI Governance MCP](https://ai-powered.com/mcp/synomosai-governance-mcp-2): SynomosAI Governance MCP is an open-source MCP server for security.
- [signafAIde](https://ai-powered.com/mcp/signafaide): signafAIde is a freemium MCP server for security.

---
Source: https://ai-powered.com/mcp/midplane
