Sept. 24, 2026 (英语).
大多数企业能力都位于agents看不到的REST API后面。 为了让一个今天被agent调用,团队通常站立并运行一个单独的MCP服务器,重新执行他们的网关已经处理的路由,认证和配额逻辑。 模型背景协议(MCP)已经成为agents发现和引用工具的标准方式,Agent Development Kit(ADK)和Gemini Entertainment(英语:Gemini Entertainment)等框架都以本土语言发音。
Google 云态 API 通道现在关闭了这个缺口。 在公共预览中,API Gateway可以作为远程的MCP服务器:注释您已经部署,部署的OpenAPI spec,您现有的REST操作作为agent准备的MCP工具——没有单独的服务器来构建,主机,或维护。
API Gateway是Google Cloud的网关线条中的轻量级 on-ramp. 如果您在Cloud Run上有一个服务,并且您想要它的API安全,管理,并在几分钟内暴露在agents上,这就是快速路径。 对于一个完整的企业API和MCP平台——生命周期管理,先进的交通政策,货币化——使用Apigee. 为了治理你的agents在出道时所呼唤的东西,包括这种MCP服务器,使用Agent Gateway. 模式路由(Model routing),它为外出LLM的通话提供一个稳定的端点,是AI流量的另一方向的配套能力。
API Gateway接受标准MCP JSON-RPC在一个单一端点上的请求,将每个工具/调用代码转换为相应的REST请求,应用你现有的政策,并将回复翻译回。 由于转码请求与正常的REST呼叫是无法区分的,所以JWT或API-key认证,配额,以及您已经配置的用于该操作的日志都保持不变——MCP和REST流量完全共享一个政策路径,一个特定操作使用一个配额分配,但是它被引用。
- 注释您的 OpenAPI 光谱。 MCP 需要 OpenAPI 3. 0. x 或 3. 1. x; OpenAPI 2.0 不支持,因此,如果您的网关仍然运行 2.0 光谱,请先迁移它。 使用 x- google- api 管理程序选择文档级别。 mcp,并使用x-google-mcp-工具自定义或跳过单个操作。 每次曝光操作都需要一个后端和非空的描述。
打开页:3. 0.4
资讯:
标题:命令服务
版本:1.0.0
x- google- api 管理:
mcp:真 # 以 MCP 工具曝光此 spec 操作
后端:
命令后端:
地址:https://orders-a1b2c3-uc.a.run.app
路径:
命令/{命令Id}:
获取:
命令状态
说明:返回命令的当前状态、载体和ETA。
x- google 后端:命令后端
x-google-mcp-工具:
名称:get order status
说明:"查询客户订单的交货状态和ETA.
用户询问订单在哪里或订单何时到时使用此语".
参数:
- 名称:命令
在:路径
需要:真实
计划:
类型:字符串
纯文本
复制
一个工具的描述是用于决定何时调用的主要信号LLM,所以写出何时和为什么使用工具,而不仅仅是它返回什么。
2. 部署门户。 如往常一样部署API配置。 API网关生成MCP-意识配置,并开始在/mcp基路服务MCP,没有额外的基础设施可以提供。
3. 决定谁可以发现你的工具。 默认的工具/列表是未经认证的,这对于开发是方便的,但向任何询问者公布您的工具名称和输入计划。 对于生产,需要JWT——注意API密钥无法保证这种方法:
x- google- api 管理:
mcp: (英语).
工具列表:
安全性:
命令ServiceJwt: [] # 对象形式也允许全球MCP
工具/呼叫总是强制执行基础的 REST 操作所需的任何认证,无论你是否获得发现。
4. 连接您的 agent。 在网关的/mcp端点对准任何MCP客户端。 在 ADK 中,这是工具夹加上您已经期望的证书:
从 google.adk.agents 导入 Agent
从 google.adk.tools.mcp tool 导入 McpToolset,流式HTTPConnectionParams
命令工具 = McpToolset ()
连接 params= Streamable HTTPConnectionParams ()
url="https://my-gateway-a12bcd345e67f89g0h.uc.gateway.dev/mcp" (中文(简体) ).
(原始内容存档于2017-09-21). Headers QQ"x-api-key": API KEY].
)
)
agent = Agent(
型号="gemini-2.5-flash"
名称="顺序支持 agent"
指令="帮助用户检查他们的订单".
工具=[顺序工具]
)
Python
网关将工具的参数映射回您操作的 REST 路径、 查询、 机构、 和信头,通过您现有的策略运行请求,并将后端的响应作为 MCP 的结果返回。 为了检查电线上的情况:
卷曲 - X POST "https://my-gateway-a12bcd345e67f89g0h.uc.gateway.dev/mcp"\?
-H"内容类型:应用程序/json"\\
-H "MCP-Protocol-Version: 2025-11-25" \
-H "x-api-key: $API_KEY" \
-d'{"jsonrpc":"2.0""id":1"方法":"工具/呼叫"
"参数":{"名称":"get order status" "参数":{"orderId":"A-1042"}}}"
贝壳
{"jsonrpc":"2.0","id":1,结果"{"内容":[{"类型":"文本"
"文本":"{\"命令Id\":\"A-1042\","状态\":"IN TRANSIT\","eta\":\"2026-09-24\"}
"是错":假}}.
贾森
- 发现了将您的网关连接到API中枢,其MCP服务器在那里以MCP特定元数据发布,并自动出现在Agent注册中,因此agents和开发者可以找到其曝光的工具。
- 没有新的操作。 您现有的光谱、网关、认证、配额和记录都做了工作——MCP和REST的流量保持不变,因为它们共享一个政策路径。
公共预览覆盖了 REST 和 OpenAPI 3.x 后端与您的当前认证。 MCP资源和提示、反应流和模型装甲有效载荷检查都在路线图上。 少数限制值得在前方知道:HTTP 204等返回空体的操作没有暴露,深嵌对象计划可能无法在工具/列表中充分渲染,一个网关服务多达1000个工具,MCP和模型路由无法在同一API配置中启用。 见目前范围的文件。
MCP支持现已在公共预览中提供。 检查文档,将您的第一个 API 转换为 agent 工具。
本文由 AI图鉴自动抓取并翻译,版权归原作者所有;如需查看原文请点下方链接。
SEPT. 24, 2026
Most enterprise capability sits behind REST APIs that agents cannot see. To make one callable by an agent today, teams typically stand up and operate a separate MCP server that re-implements the routing, authentication, and quota logic their gateway already handles. The Model Context Protocol (MCP) has become the standard way for agents to discover and invoke tools, and frameworks like the Agent Development Kit (ADK) and Gemini Enterprise speak it natively.
Google Cloud API Gateway now closes that gap. In Public Preview, API Gateway can act as a remote MCP server: annotate the OpenAPI spec you already deploy, deploy it, and your existing REST operations are available as agent-ready MCP tools — with no separate server to build, host, or maintain.
API Gateway is the lightweight on-ramp in Google Cloud's gateway lineup. If you have a service on Cloud Run and you want its API secured, managed, and exposed to agents in minutes, this is the fast path. For a full enterprise API and MCP platform — lifecycle management, advanced traffic policies, monetization — use Apigee. To govern what your agents call on the way out, including MCP servers like this one, use Agent Gateway. Model routing, which gives you one stable endpoint for outbound LLM calls, is the companion capability for the other direction of AI traffic.
API Gateway accepts standard MCP JSON-RPC requests on a single endpoint, transcodes each tools/call into the corresponding REST request, applies your existing policies, and translates the response back. Because the transcoded request is indistinguishable from a normal REST call, the JWT or API-key authentication, quota, and logging you already configured for that operation keep working unchanged — MCP and REST traffic share exactly one policy path, and a given operation draws on one quota allocation however it is invoked.
- Annotate your OpenAPI spec. MCP requires OpenAPI 3.0.x or 3.1.x; OpenAPI 2.0 is not supported, so if your gateway still runs a 2.0 spec, migrate it first. Opt in at the document level with x-google-api-management.mcp, and customize or skip individual operations with x-google-mcp-tool. Each exposed operation needs a backend and a non-empty description.
openapi: 3.0.4
info:
title: Order Service
version: 1.0.0
x-google-api-management:
mcp: true # expose this spec's operations as MCP tools
backends:
orders-backend:
address: https://orders-a1b2c3-uc.a.run.app
paths:
/orders/{orderId}:
get:
operationId: getOrderStatus
description: Returns the current status, carrier, and ETA for an order.
x-google-backend: orders-backend
x-google-mcp-tool:
name: get_order_status
description: "Look up the delivery status and ETA of a customer order.
Use this when the user asks where an order is or when it will arrive."
parameters:
- name: orderId
in: path
required: true
schema:
type: string
Plain text
Copied
A tool's description is the primary signal an LLM uses to decide when to call it, so write when and why to use the tool, not just what it returns.
2. Deploy the gateway. Deploy the API config as usual. API Gateway generates an MCP-aware configuration and begins serving MCP on the /mcp base path, with no extra infrastructure to provision.
3. Decide who can discover your tools. By default tools/list is unauthenticated, which is convenient for development but publishes your tool names and input schemas to anyone who asks. For production, require a JWT — note that API keys cannot secure this method:
x-google-api-management:
mcp:
tools-list:
security:
orderServiceJwt: [] # the object form also enables MCP globally
tools/call always enforces whatever authentication the underlying REST operation requires, whether or not you secure discovery.
4. Connect your agent. Point any MCP client at the gateway's /mcp endpoint. In ADK, that is the toolset plus the credential your gateway already expects:
from google.adk.agents import Agent
from google.adk.tools.mcp_tool import McpToolset, StreamableHTTPConnectionParams
order_tools = McpToolset(
connection_params=StreamableHTTPConnectionParams(
url="https://my-gateway-a12bcd345e67f89g0h.uc.gateway.dev/mcp",
headers={"x-api-key": API_KEY},
)
)
agent = Agent(
model="gemini-2.5-flash",
name="order_support_agent",
instruction="Help the user check on their orders.",
tools=[order_tools],
)
Python
The gateway maps the tool's arguments back onto the REST path, query, body, and headers of your operation, runs the request through your existing policies, and returns the backend's response as an MCP result. To inspect that on the wire:
curl -X POST "https://my-gateway-a12bcd345e67f89g0h.uc.gateway.dev/mcp" \
-H "content-type: application/json" \
-H "MCP-Protocol-Version: 2025-11-25" \
-H "x-api-key: $API_KEY" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call",
"params":{"name":"get_order_status","arguments":{"orderId":"A-1042"}}}'
Shell
{"jsonrpc":"2.0","id":1,"result":{"content":[{"type":"text",
"text":"{\"orderId\":\"A-1042\",\"status\":\"IN_TRANSIT\",\"eta\":\"2026-09-24\"}"}],
"isError":false}}
JSON
- Discoverable. Connect your gateway to API hub and its MCP server is published there with MCP-specific metadata and appears in Agent Registry automatically, so agents and developers can find the tools it exposes.
- Nothing new to operate. Your existing spec, gateway, authentication, quotas, and logging do the work — MCP and REST traffic stay consistent because they share one policy path.
The Public Preview covers REST and OpenAPI 3.x backends with your current authentication. MCP resources and prompts, response streaming, and Model Armor payload inspection are on the roadmap. A few limits are worth knowing up front: operations returning empty bodies such as HTTP 204 are not exposed, deeply nested object schemas may not render fully in tools/list, a gateway serves up to 1,000 tools, and MCP and model routing cannot be enabled in the same API config. See the documentation for the current scope.
MCP support is available now in Public Preview. Check out the documentation and turn your first API into an agent-ready tool today.
Auto-fetched and translated by AI Atlas. All rights belong to the original author.