MCP Gateway vs MCP Server: Do You Need a Gateway?
MCP gateway vs MCP server explained: what each does, when a generic gateway helps, and why database access needs SQL-aware controls a tool proxy lacks.
On this page
The MCP gateway vs MCP server question is simpler than it looks. An MCP server exposes tools to AI clients: it’s the thing that actually runs the query or calls the API. An MCP gateway sits in front of one or more MCP servers and adds what they share: sign-in, routing, policy and logging. If you’re connecting one AI client to one database on your laptop, a server is enough. If several people will let AI agents query a production database, you need gateway-style controls: who is asking, what they may read, and a record of what happened. For databases those controls have to understand SQL, which generic gateways usually don’t. That’s the difference this post explains.
Definitions first
Model Context Protocol (MCP) is an open protocol that lets AI clients such as Claude, ChatGPT, Cursor, VS Code and Claude Code discover and call tools provided by other software.
MCP server: a program that offers tools over MCP. A database MCP server typically offers tools like list_tables, describe_table and query. It may run on your machine (connected over standard input/output) or as a remote service over HTTP.
MCP client: the AI application that connects to servers and lets the model call their tools.
MCP gateway: a layer between clients and servers. In the common, generic sense it’s a proxy that:
- presents many MCP servers behind one endpoint,
- handles authentication (often single sign-on or OAuth),
- allows or blocks tools per user or group,
- logs tool calls,
- sometimes runs servers in containers and manages their secrets.
These generic gateways come from infrastructure, API-management and security vendors, and from open-source projects. They’re designed for any kind of tool: GitHub, Slack, Jira, file systems, databases.
MCP gateway vs MCP server at a glance
| MCP server | Generic MCP gateway | Database-specific governed gateway | |
|---|---|---|---|
| Main job | Offer tools | Route, authenticate and log calls to many servers | Let AI query databases under policy |
| Typical deployment | Local process or remote service | Central proxy | Central remote MCP server |
| Authentication | Often none locally; a key or OAuth remotely | Central SSO / OAuth | Per-person sign-in or personal keys |
| Policy level | Whatever the server implements | Per tool (allow query, block execute) | Per query: SQL, tables and columns |
| Read-only enforcement | Depends on the server and the database login | Only by blocking tools | Parses SQL, then read-only at the database too |
| Table and column limits | Rarely | No | Yes |
| Audit content | Varies | Tool name, arguments, caller | Person, question, SQL, outcome, rule, rows, timing |
| Works across tool types | One server, one domain | Yes, any MCP server | Databases only |
What a single database MCP server gives you
Open-source database MCP servers are a great way to start. You give one a connection string, add it to your AI client, and the model can explore and query the database.
What you usually don’t get:
- Identity. A local server acts as whoever’s connection string it holds. There’s no notion of which person asked.
- Enforced read-only access. Some servers offer a read-only mode. Many rely on the database login, and some on the model choosing to run only SELECT.
- Column-level limits. If the login can read
customers.phone, so can the agent. - A shared audit log. Logs, if any, stay on the machine running the server.
- Central revocation. Removing access means finding every laptop with the connection string.
For a developer exploring a local or staging database, those gaps may not matter. For a team on production data, they do.
What a generic MCP gateway adds, and what it doesn’t
A generic MCP gateway fixes identity, central configuration and logging across many servers. That’s real value if your AI agents use a dozen tools.
The limit for databases is that a generic gateway works at the tool level. It sees a call to a tool named query with an argument containing a string of SQL. Unless it was built for databases, it doesn’t:
- parse that SQL to tell a SELECT from an UPDATE hidden in a CTE,
- know which tables the project should expose,
- expand
SELECT *to check for a hidden column, - open a read-only session on the database,
- cap the rows returned or stop a query that runs too long.
So a generic gateway in front of a database MCP server still leaves the important decisions to the server and to the database login. That can work, but only if the server and login are locked down. The gateway can’t check that for you.
What a database-specific governed gateway does
A governed gateway for databases puts the policy where the risk is: in the query.
- Authentication per person, so every query is tied to someone, even if they connect from different AI clients.
- SQL inspection with a dialect-aware parser. Only plain reads are allowed; writes, multiple statements and dangerous functions are refused.
- Read-only at the database too, so a parser gap can’t become a write.
- Tables and columns chosen per project, with hidden columns left out of the schema the agent sees and refused in queries.
- Roles, so some people can query and others can only oversee.
- Limits on rows, time and concurrency, so an agent can’t overload the database.
- An audit log of the question, SQL and outcome, without storing the result rows.
The trade-off is scope. A database gateway governs databases. It won’t proxy your GitHub or Slack tools.
Do you need a gateway? A quick decision guide
- One developer, local or staging database, no personal data: a database MCP server with a read-only login is fine.
- A team asking questions of production data: you need gateway controls. Identity, read-only enforcement, table and column limits and an audit log aren’t optional once customer data is involved.
- Many kinds of tools across the company: a generic MCP gateway helps you manage them. For the database part, put a SQL-aware layer behind it, or use a database-specific gateway alongside it.
- Regulated data (DPDP, GDPR, health, finance): favour the layer that can show, per query, who asked, what SQL ran and why anything was refused.
Generic and database-specific gateways aren’t mutually exclusive. Some teams route general tools through a company-wide gateway and connect database access through a governed database gateway, each doing what it’s built for.
Where Datablare fits
Datablare is a governed MCP gateway for databases. Each project gets one MCP link, a remote MCP server that Claude, ChatGPT, Cursor, VS Code, Claude Code or any MCP client can connect to by signing in, or with a personal key for tools that can’t sign in.
Behind that link:
- Authentication checks the person and their project role on every call. Keys are stored only as fingerprints and can be revoked at once.
- Policy checks the tool is allowed for that role and reserves the query against plan and daily limits.
- The SQL guard allows only a single plain read against exposed tables, and refuses denied functions.
- The column guard refuses any query that reads a hidden column, including through
SELECT *. - The driver connects to your database in a read-only session (on SQL Server and Snowflake, in a transaction that is always rolled back), with a statement timeout and a row cap.
- The audit record stores who asked, the question, the SQL, the outcome and the rule, row count and timing. The results go to the agent and aren’t stored.
It supports PostgreSQL, MySQL, MariaDB, SQL Server, Oracle, ClickHouse and Snowflake, with an SSH tunnel for private databases. It’s hosted in India, and self-hosting is available to discuss on Enterprise.
What it isn’t: a general-purpose proxy for non-database MCP servers. If you need that too, run a generic gateway for those tools and Datablare for database access.
See the full path a question takes on how it works, or create a free account and connect an AI client to the sample dataset in a few minutes.
Frequently asked questions
What is the difference between an MCP gateway and an MCP server?
An MCP server exposes tools, such as 'run a query' or 'create an issue', to AI clients. An MCP gateway sits between clients and one or more servers and adds shared concerns: authentication, routing, policy and logging. A server does the work; a gateway decides who may ask for it and records that they did.
Do I need an MCP gateway for database access?
If AI agents will query a database with real customer or financial data, you need the controls a gateway provides: per-person authentication, read-only enforcement, table and column limits and an audit log. Whether that comes from a generic gateway plus a database server, or from a database-specific governed gateway, depends on what else you are connecting.
Can a generic MCP gateway enforce read-only database access?
Usually only at the tool level, for example allowing a 'query' tool and blocking an 'execute' tool. It does not normally parse the SQL inside the call, so it cannot tell a SELECT from a DELETE or a hidden column from an allowed one. That has to happen in something that understands SQL.
Is Datablare an MCP server or an MCP gateway?
Both, in the sense that matters. Each Datablare project is a remote MCP server that AI clients connect to, and it acts as a governed gateway in front of your databases, enforcing read-only access, table and column limits, roles and an audit trail. It covers databases only, not other kinds of tools.