Connect your client
Every client reaches the same endpoint and signs in once over OAuth — only how you point it there differs. Pick your client below; each uses the Cloud endpoint URL, so swap inhttp://localhost:3000/mcp for self-host. If the tools don’t appear, see troubleshooting.
- Cursor
- Claude Code
- VS Code
- Claude Desktop
- Any other client
One-click — install from a link (pick your region): Add to Cursor · EU · Add to Cursor · USOr add it by hand — Cursor reads MCP servers from Either way, Cursor walks you through the OAuth sign-in, then its MCP panel lists the Midplane tools.
~/.cursor/mcp.json and auto-detects Streamable HTTP from the URL, so no transport or type key is needed:~/.cursor/mcp.json
Or let your agent connect itself
If your client is an agentic CLI or IDE that can run its own commands — Claude Code, Cursor, Windsurf, Codex, and the like — let it wire itself up instead. Pick your deployment and paste the prompt into that client; it adds Midplane, then hands back to you for the one-time browser sign-in. A UI-only client like Claude Desktop or ChatGPT has no shell for the agent to drive, so use the by-hand tabs above.- Cloud · EU
- Cloud · US
- Self-host
Setup prompt
How connecting works
It’s the same three steps for every client:1
Point your client at the endpoint
Add Midplane as an MCP server, using the endpoint URL below. No token to paste.
2
Sign in once
The first time your client connects, it registers itself and hands you off to Midplane to sign in over OAuth. This is standard MCP authorization — the client does it automatically; you never copy a client ID or secret.
3
Grant least-privilege scope
At sign-in you approve the agent and choose its scope: which project it connects to, which of that project’s databases it can reach, and whether each is
read or read_write. See what you grant at consent.The endpoint
The endpoint URL depends on how you run Midplane:- Cloud URL
- Self-host URL
https://{eu|us}.midplane.ai/mcp/<projectId>.Transport
Midplane speaks MCP over Streamable HTTP, the current MCP transport — one endpoint that handles every call. Most clients (Cursor, Claude Code, ChatGPT, VS Code) connect to that URL directly. A few — notably Claude Desktop against ahttp://localhost self-host endpoint — need a small stdio shim (mcp-remote) that bridges stdio to the same HTTP endpoint.
What you grant at consent
Sign-in is also where you set the agent’s scope — least privilege, chosen the moment it connects. The consent screen names the agent asking to connect (by the name it registered under) and asks you to grant:- One project. Each agent credential is bound to a single project. If your account has one project it’s selected for you; with several, you pick — Midplane never silently defaults the choice, so an agent can’t bind to the wrong project.
- Which databases. Check only the databases on that project the agent should reach. Nothing is checked by default — granting is opt-in, per database.
readorread_writefor each. The least-privilege default isread.
Per-agent scope sits on top of the project policy — it doesn’t replace it. The policy is the ceiling for every agent on the project; the consent grant narrows one credential below that ceiling. See per-agent database scope.
Machine and CI agents
OAuth covers interactive agents. For headless callers — CI jobs, scheduled tasks, anything without a browser — mint a machine token instead and present it as a bearer header:read or read_write per database — except you set it when you mint the token. The token is a secret, shown once at creation; store it like any other credential. Clients that can’t set a header can use the legacy https://{eu|us}.midplane.ai/mcp/<token> URL form.
Manage connected agents
In Cloud, every agent connected to a project — interactive OAuth clients and headless tokens alike — appears in the project’s Agents pane. Revoke any agent and its access stops on the next request — there’s no waiting for a credential to expire. Revoke the moment a laptop or runner goes missing. See projects & access for the Agents pane and the machine-token lifecycle.The tools your agent gets
Once connected, the agent sees a small, fixed set of tools:
Every
query call also carries an intent — a short, plain-language “why,” filled in by the agent automatically, that lands on the audit row next to the SQL and the decision. It’s recorded for the audit trail only; it never relaxes or tightens a decision, which is made on the parsed SQL. For the full argument and response shapes, see the MCP tools reference.
Try it
With the tools connected, run these prompts to confirm the engine is enforcing policy. The first is an allowed read; the rest each hit a different rule.1
List the tables — allowed
“What tables are in the database?”The agent calls
list_tables and returns your tables. This is a read, so the default read-only policy allows it.2
Delete all users — denied by table access
“Delete all users.”The agent calls
query with DELETE FROM users. Midplane denies it: writes are read-only by default, so the table_access rule blocks the statement, naming the table and the policy key you’d flip to grant the write. See table access.3
Stacked statements — denied by multi-statement
“Run this SQL:
SELECT 1; DROP TABLE users”Two statements in one call. The multi_statement rule denies it at parse time — the stacked DROP never reaches the database.ATTEMPTED → DECIDED → EXECUTED; a denied query stops at ATTEMPTED → DECIDED and never executes.
Next steps
Write a policy
Grant the reads and writes your agent actually needs.
Read the audit trail
See every attempt, decision, and result your agent produced.