Google Cloud API Gateway illustration for connecting services and APIs
Technology Analysis

How to Turn REST APIs into MCP Tools with Google Cloud API Gateway

Google Cloud API Gateway can expose annotated REST endpoints as remote MCP tools in Public Preview. This practical analysis explains the protocol translation, security boundary, OpenAPI pattern, limitations, and a safer rollout plan.

Sep 26, 202611 min readMuhammad FarooqLast reviewed: Sep 26, 2026

The Model Context Protocol is becoming a practical integration surface for agents, but many teams already have valuable REST APIs, authentication, quotas, logs, and business rules. Google Cloud’s new API Gateway capability targets that gap: annotate an OpenAPI document, deploy the gateway, and let it expose selected REST operations as remote MCP tools. The important story is not simply that a gateway can speak MCP. It is where the security and authorization boundary remains when an agent turns a natural-language request into an API call.

What Google Cloud announced

A protocol adapter for existing OpenAPI-backed APIs, currently in Public Preview.

Google Cloud’s official announcement describes API Gateway support for remote MCP servers. An existing OpenAPI 3.0.x or 3.1.x definition can be annotated with Google-specific MCP extensions, then deployed through the normal API Gateway workflow. The gateway accepts MCP JSON-RPC requests, maps tool calls to REST operations, and maps the backend response back into MCP format.

That means a team does not have to rebuild every capability as a separate MCP server before an agent can discover it. The gateway becomes a translation and policy point in front of the API you already operate. It also means the OpenAPI description is no longer only documentation: its names, descriptions, parameters, schemas, and annotations influence what an agent can discover and invoke.

This is complementary to an agent runtime such as the managed harness discussed in our ​Agents API architecture guide. The gateway exposes capabilities; the agent runtime decides when to use them, subject to the permissions your application provides.

Architecture showing an AI client sending MCP JSON-RPC to Google Cloud API Gateway, which translates it to an existing REST API while preserving authentication, quota, logging, and backend authorization
The gateway translates the protocol; it does not replace the backend’s business authorization or make an unsafe API safe by itself.
The new path through the system
StageWhat happensWhat to verify
DiscoveryThe client calls tools/list and receives tool metadata from the annotated API definition.Descriptions and schemas reveal only the intended capability and data shape.
InvocationThe client sends tools/call; the gateway maps it to the selected REST operation.Authentication, parameters, validation, quota, and rate limits are enforced.
BackendThe existing API performs business logic and returns a REST response.Tenant checks and side-effect authorization remain correct for agent traffic.
ResponseThe gateway maps the REST response into MCP content for the client.Errors, sensitive fields, and large payloads are handled intentionally.

MCP discovery is not the same as permission

The most important preview detail is the split between tools/list and tools/call.

Google’s documentation says tools/list is unauthenticated by default in this preview, while tools/call enforces authentication for the underlying REST API. A team can secure tools/list with JWT, but API keys cannot be used to secure that discovery request. This creates a boundary that deserves explicit testing: tool metadata may be visible to a caller even when tool execution is denied.

A tool name and description can leak operational information. For example, a tool called rotate-production-key, even if every call is rejected, tells an attacker that the capability exists. Treat discovery metadata as an information surface. Use neutral descriptions where appropriate, secure discovery when the threat model requires it, and avoid placing tenant data, secrets, internal hostnames, or privileged workflow details in descriptions and schemas.

The backend must still authorize the actual operation for the authenticated principal and tenant. Gateway-level authentication answers who reached the route; it does not automatically answer whether that user may update this invoice, export that dataset, delete this resource, or trigger a production deployment.

  • Test unauthenticated tools/list behavior before exposing a public endpoint.
  • Use JWT-based discovery protection when tool inventory is sensitive.
  • Keep tenant and resource authorization in deterministic backend policy.
  • Log the user, agent, MCP tool name, gateway request, and backend operation together.
  • Treat tool descriptions and schemas as public-facing security metadata.

Common Mistakes

  • Assuming a successful tools/list response grants permission to call a tool.
  • Putting internal URLs, database names, secrets, or customer data in tool metadata.
  • Relying on an LLM to decide whether a destructive REST operation is allowed.
  • Adding write endpoints before idempotency, approval, audit, and rollback behavior are tested.

A minimal OpenAPI exposure pattern

Expose a narrow, well-described operation instead of turning an entire API into agent access.

The practical workflow starts with an existing OpenAPI definition and adds MCP annotations to the operations you want agents to discover. The exact extension fields and deployment syntax should be checked against Google Cloud’s current preview documentation, but the design principle is stable: make the tool contract small, explicit, and safe to retry.

A read-only operation is a better first candidate than a destructive write. Give it a useful operation name, a bounded parameter schema, a response schema that omits sensitive fields, and backend authorization that is independent of the model’s interpretation.

Illustrative shape: annotate only the operation that is ready for agent discovery.openapi.yaml
openapi: 3.0.3
info:
  title: Orders API
  version: 1.0.0
paths:
  /orders/{orderId}:
    get:
      operationId: get_order_status
      summary: Read the status of one order
      x-google-api-management:
        mcp:
          enabled: true
      x-google-mcp-tool:
        name: get_order_status
      parameters:
        - name: orderId
          in: path
          required: true
          schema:
            type: string
            pattern: '^[A-Z0-9-]{8,32}$'
      responses:
        '200':
          description: Order status without payment details
        '404':
          description: Order not found

Tips

  • Start with read-only operations that return bounded payloads.
  • Use operationId and tool names that describe the business action precisely.
  • Keep parameter schemas strict enough to reject malformed or ambiguous requests.
  • Make writes idempotent where possible and require an explicit approval path for irreversible actions.

Preview limitations change the rollout plan

A useful adapter today is not yet a complete MCP platform.

The announcement lists meaningful preview boundaries. The current path is for REST and OpenAPI 3.x backends. MCP resources and prompts are not available in the same way as tools, streaming support and Model Armor payload inspection are on the roadmap, and empty-body HTTP 204 responses are not exposed as MCP tools. Deeply nested schemas may not render completely in tools/list, and the preview has a 1,000-tool limit.

There is also an architecture constraint: MCP and model routing cannot be enabled in the same API configuration. That matters if a team expects one gateway configuration to serve both model-routing traffic and MCP tools. Separate the concerns deliberately and document the operational ownership of each gateway configuration.

For an agent system that needs richer resources, prompts, streaming, or custom mediation, a dedicated MCP server may still be the better fit. The gateway is most compelling when the main value is safely exposing a curated slice of an existing REST estate without duplicating every backend integration.

Preview fit test
Good first fitNeeds extra designProbably use another pattern
Read-only REST endpoints with clear OpenAPI schemasTenant-aware writes with approvals and reconciliationStreaming-first tools or MCP resources and prompts
A small curated tool inventorySchemas with deep nesting or large responsesAPIs whose behavior is not expressible in OpenAPI 3.x
Teams already operating API Gateway controlsOperations that return empty 204 responsesA single configuration that must also use model routing

A safer production adoption sequence

Treat MCP exposure as an API product launch, not a checkbox in a gateway config.

Before exposing a tool, inventory its data classification, side effects, identity requirements, quota behavior, failure modes, and rollback path. Then test the complete chain: discovery, authentication, parameter validation, tenant authorization, backend execution, response mapping, logging, retries, and cancellation. An agent can call the same operation repeatedly or with an incomplete understanding of its consequences, so deterministic controls must sit outside the model.

The same principle applies to agent workflows built with Python: keep tool boundaries narrow and test them independently, as described in our production AI agent engineering guide. For security-sensitive agent research, our PageBreak analysis also shows why discovery and verification should be separated from execution authority.

  • Choose one read-only endpoint and one low-risk tenant for the pilot.
  • Protect discovery if tool inventory is sensitive; never assume execution auth covers metadata leakage.
  • Add correlation IDs connecting MCP requests, gateway logs, backend logs, and business audit events.
  • Set quotas and payload limits before connecting an autonomous agent.
  • Run adversarial tests for prompt injection, confused deputy behavior, replay, parameter smuggling, and cross-tenant access.
  • Promote tools gradually, with an owner, expiry review, and a documented removal procedure.

What this announcement does not prove

A REST-to-MCP bridge does not prove that an API is safe for autonomous use. It proves that the protocol boundary can be standardized. Reliability, authorization correctness, data minimization, cost control, and human accountability still belong to the system owner.

It also does not mean every REST endpoint should become a tool. An agent-facing contract should be curated for clear intent and bounded consequences. A large legacy API may be technically exposable but operationally confusing, overly permissive, or too easy to misuse.

The durable takeaway is simple: use API Gateway when it reduces integration duplication while preserving your existing controls, but make the MCP surface smaller and safer than the underlying API surface.

FAQ

Does Google Cloud API Gateway replace my REST API?

No. It acts as a remote MCP entry point and translates tool calls to existing REST operations. Your backend still owns business logic, resource authorization, and data behavior.

Is tools/list protected by authentication by default?

In the Public Preview behavior described by Google, tools/list is unauthenticated by default. JWT can be used to secure discovery, while API keys cannot secure tools/list. Verify the current product documentation and test the deployed configuration before launch.

Should I expose write endpoints as MCP tools?

Only after idempotency, authorization, approval, audit, retry, and rollback behavior are designed and tested. Begin with read-only or reversible operations and keep destructive actions behind explicit policy.

When should I build a dedicated MCP server instead?

Use a dedicated server when you need MCP resources, prompts, streaming, custom mediation, complex state, or behavior that cannot be represented cleanly by an OpenAPI-backed REST operation.

Sources

Primary and authoritative sources reviewed for this article.

Conclusion

Google Cloud API Gateway’s MCP support is a useful bridge between an existing REST estate and the agent ecosystem. Its value is strongest when a team curates a small tool surface, keeps discovery metadata deliberate, and preserves deterministic identity and business authorization in the gateway and backend. The protocol adapter can remove integration work; it cannot remove the responsibility to decide what an agent may know, call, and change.