MCP gateway for databases: what it is and when you need one
6 min read · Updated November 14, 2026
MCP (Model Context Protocol) became the standard way to connect agents such as Cursor and Claude to tools and databases. An MCP gateway is the control point in the middle of that path.
What an MCP gateway does
Instead of the agent talking straight to the database MCP server, it talks to the gateway. The gateway identifies who is using the agent, checks each call against a policy, decides whether to run, block, or ask for approval, and records everything. The database credential stays with the gateway, not with the agent.
How it compares to the alternatives
- Read-only user: a good first step, but no middle ground ("allowed if someone approves"), no identity of the person, and the password is still on the laptop.
- VPN or bastion: protects the network path, not what the agent does once inside.
- PAM (privileged access management): built for people's sessions, not for tool calls made by an agent on someone's behalf.
- Prompt instructions: guide the model, but are not a permission.
What to evaluate when choosing a gateway
- Identity per person: each call tied to whoever triggered the agent.
- Classification by the SQL's effect, not the tool name, with a safe default for the unknown.
- Human approval outside the chat, bound to the exact call and single use.
- Where data and credentials live: on your network or the vendor's.
- Behavior when the vendor is down: it should fail closed.
- A searchable audit with a defined retention.
- Supported clients (Cursor, Claude) and databases.
When you need one
- More than one person uses AI agents on the same database.
- Someone already put a production credential in an agent config file.
- There is personal or financial data in the tables the agent reaches.
- You need to answer who did what, for audit or compliance.
Where GatekeeperID Agents fits
GatekeeperID Agents is an MCP gateway for PostgreSQL with control in the Cloud and execution on your network. The Connector sits in front of the database, keeps the password, and applies the signed policy. The Cloud handles identity, approvals, and audit, and only receives masked SQL. Cursor and Claude work as clients.
An MCP gateway built for your PostgreSQL
See the architecture and a call blocked and approved in a 20-minute demo.
Book a 20-minute demoQuestions about this guide
Is an MCP gateway the same as an MCP server?
No. The MCP server exposes tools, such as running SQL. The gateway sits in front and decides who may use those tools and how.
Do I need to expose the database to use a gateway?
Not with GatekeeperID Agents. The Connector runs on your network and only opens outbound connections to the Cloud.
Which databases are supported?
PostgreSQL first. Risk classification is separate from the SQL dialect so other databases can follow.
More guides
How to connect Cursor to PostgreSQL safely
The usual way to connect Cursor to PostgreSQL puts the database password on a laptop. See the risks, what to do with PostgreSQL alone, and how to give each person a limit without handing out the password.
Claude on your database: how to limit what the agent can do
Claude Code and Claude Desktop reach PostgreSQL over MCP with whatever credential you give them. See how to set it up without handing out the password and how to stop a request from becoming a DELETE without approval.
Human approval for AI agents: how to require approval before DELETE and DROP
Real human-in-the-loop is not the agent asking in the chat. See the six properties of an approval that protects the database and how to apply them to AI agents on PostgreSQL.
