Generated banner for API Gateway MCP Server
Generated logo for API Gateway MCP Server

API Gateway MCP Server

GoogleOfficialPublished by Google

  • Skill
  • Tool integration
  • Cloud and DevOps
  • Apache-2.0
  • Low risk
  • Has scripts

From the author

Configures Google Cloud API Gateway to act as a remote Model Context Protocol (MCP) server (Public Preview) that exposes REST APIs as agent tools over HTTP (POST /mcp). Use when migrating OpenAPI 2.0 specs to OpenAPI 3.x for MCP, annotating specs with x-google-api-management.mcp and x-google-mcp-tool, securing tools/list with JWTs or API keys, connecting Google ADK (McpToolset) or Apigee API hub and Agent Registry, or troubleshooting MCP JSON-RPC errors (-32601, -32602, -32000). Do not use for Apigee X proxy bundles, outbound LLM model routing, or GKE Gateway API.
— the description by Google

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

This skill enables the transformation of REST APIs hosted on Google Cloud API Gateway into remote Model Context Protocol (MCP) servers. By annotating OpenAPI 3.x specifications with specific extensions, the gateway can translate MCP JSON-RPC 2.0 requests into standard HTTP REST calls. The skill provides a structured workflow for migrating OpenAPI 2.0 specs to 3.x, validating configurations, securing the MCP endpoint, and integrating with tools like the Google Agent Development Kit (ADK).

What it does

  • Converts REST APIs into MCP-compatible tools via OpenAPI 3.x annotations.
  • Validates OpenAPI specifications for MCP compatibility using a provided Python script.
  • Configures security for the MCP tools/list endpoint using JWTs or API keys.
  • Facilitates integration with Google ADK McpToolset and API hub discovery.
  • Provides guidance on troubleshooting common MCP JSON-RPC error codes.
  • Manages the lifecycle of API Gateway resources including creation, updates, and deletion.

When to use it

  • When you need to expose existing REST APIs as tools for AI agents using the Model Context Protocol.
  • When migrating legacy OpenAPI 2.0 specifications to OpenAPI 3.x for MCP support.
  • When you need to secure MCP tool discovery with specific authentication schemes.
  • When integrating Google Cloud-hosted APIs with agent frameworks like the Google ADK.

Advantages

  • Enables standard MCP communication over HTTP for Google Cloud-hosted services.
  • Leverages existing API Gateway authentication and quota management policies.
  • Supports automated discovery in API hub and Agent Registry.
  • Provides a deterministic validation loop to catch configuration errors before deployment.

Usage examples

“How do I annotate my OpenAPI 3.0 spec to expose a REST endpoint as an MCP tool?”
The skill provides the necessary x-google-mcp-tool annotations and explains how to define the tool name, description, and request body properties for LLM tool selection.
“Validate my OpenAPI spec for MCP deployment.”
The skill guides you to run the provided scripts/validate_mcp_openapi.py script to ensure your specification meets all requirements before attempting to create an API config.
“How can I connect my agent to the API Gateway MCP server?”
The skill provides a Python code sample using McpToolset and StreamableHTTPConnectionParams to connect to the gateway's /mcp endpoint.

Install

  1. Download the skill as a ZIP:

    https://mp-staging.autogineer.com/agent-skills/google/api-gateway-mcp-server/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip api-gateway-mcp-server.zip -d .agents/skills

Documentation by Google

API Gateway Remote MCP Server (Public Preview)

This skill converts new or existing REST APIs on Google Cloud API Gateway into remote Model Context Protocol (MCP) servers (POST https://{default_hostname}/mcp, Public Preview). By annotating an OpenAPI 3.x (3.0.x or 3.1.x) specification with x-google-api-management.mcp and x-google-mcp-tool, API Gateway translates MCP JSON-RPC 2.0 requests (initialize, notifications/initialized, tools/list, tools/call) into standard HTTP REST requests to your backend while enforcing existing authentication and quota policies.

Attribution

MUST READ: Before executing any gcloud, REST API, or MCP command, you MUST read Usage Attribution. For commands executed directly in the terminal (never in generated scripts, Terraform, or user code), prefix gcloud with CLOUDSDK_METRICS_REQUEST_ATTRIBUTION="agent-skills/1.0 (skill:api-gateway-mcp-server)" and append agent-skills/1.0 (skill:api-gateway-mcp-server) to User-Agent headers.

Prerequisites

  1. Install the Google Cloud CLI and the validator dependency:

    • Install the Google Cloud CLI. Then update it to the latest version with gcloud components update. An old CLI can fail when it uploads an OpenAPI 3.x API config.

    • Install Python 3.10 or later and PyYAML for the local OpenAPI MCP validator script:

      pip install "PyYAML>=6.0,<7.0"
  2. Authenticate your environment:

    • Local CLI session: gcloud auth login

    • Application Default Credentials (SDKs / ADK): gcloud auth application-default login

  3. Select or create a project, confirm billing, and pick a supported gateway location:

    • Select an existing project (gcloud config set project {project_id}) or create one (gcloud projects create {project_id}).

    • Confirm that an active billing account is linked to {project_id}. API Gateway has a free monthly allowance of API calls for each billing account, but you still need an active billing account to deploy. Calls above the allowance and network data transfer out are charged. For current prices, see API Gateway pricing.

    • Use us-central1 as the default --location for gateway commands. For the other supported regions, see API Gateway deployment model.

  4. Enable the required Google Cloud APIs:

    gcloud services enable \
      apigateway.googleapis.com \
      servicemanagement.googleapis.com \
      servicecontrol.googleapis.com \
      --project={project_id}

    For API hub discovery (optional), enable the API hub API in the API hub host project: gcloud services enable apihub.googleapis.com --project={hub_project_id}. To query Agent Registry (optional), also run gcloud services enable agentregistry.googleapis.com --project={project_id}.

  5. Verify the IAM roles (use the most restrictive role for each step):

    • To create and update the API, API configs, and gateways: API Gateway Admin (roles/apigateway.admin) on {project_id}. To run the gcloud services enable commands: Service Usage Admin (roles/serviceusage.serviceUsageAdmin) on that project.

    • To reference the gateway service account in an API config: Service Account User (roles/iam.serviceAccountUser) on {gateway_sa_name}@{project_id}.iam.gserviceaccount.com.

    • For a Cloud Run backend: grant the gateway service account the Cloud Run Invoker role (roles/run.invoker) on the service.

    • To mint test ID tokens as a caller service account: Service Account Token Creator (roles/iam.serviceAccountTokenCreator) on {caller_sa_email}.

    • Reference: Configure the development environment.

Decision Matrix: MCP Server Configuration and Client Integration

TaskRequired MechanismCritical GuardrailDetailed Reference
Migrate OpenAPI 2.0 (swagger: "2.0") or author OpenAPI 3.x for MCPRoot x-google-api-management.mcp + named backends + operation-level x-google-mcp-toolNEVER add MCP extensions to an OpenAPI 2.0 spec. Rationale: MCP is not supported for OpenAPI 2.0. Use OpenAPI 3.0.x or 3.1.x, and deploy the spec with gcloud api-gateway api-configs create. Keep all MCP operations in one OpenAPI document: if an API config has several documents, API Gateway serves the MCP tools of only one of them.OpenAPI 2.0 to 3.x Migration
Optimize tool names, descriptions, and schemas for LLM tool selectionx-google-mcp-tool (name, description, false) + described requestBody propertiesEvery operation MUST have an operationId, with or without MCP. Every exposed tool MUST resolve to a unique name that matches [A-Za-z0-9_.-]{1,128} (x-google-mcp-tool.name, or else the operationId), a non-empty description, and a non-empty response body (HTTP 204 is unsupported). Only GET, POST, PUT, PATCH, and DELETE operations can be tools, and a gateway serves at most 1,000 tools. API Gateway rejects complex nested schemas when you create the API config, but a simple nested object body works. In OpenAPI 3.1, give each schema one type, because API Gateway also rejects a type list such as type: ["string", "null"]. Describe each property, and check each tool's inputSchema in tools/list after you deploy.OpenAPI Agent Tool Optimizer
Secure tools/list and hide internal/admin routesx-google-api-management.mcp.tools-list.security (exactly one JWT or API key scheme; a JWT scheme is also listed in root security) + x-google-mcp-tool: falsetools/list is unauthenticated by default. It accepts one JWT scheme, or one API key scheme sent in the x-api-key header. API Gateway rejects a config whose JWT tools-list.security scheme is missing from the root security list, and that root entry also requires the JWT on every REST operation without its own security. If the root list already has an API key scheme, add the JWT to the same requirement object (AND): API Gateway does not support alternative (OR) requirements with an API key. An mcp object (for tools-list) also enables MCP for every eligible operation, so opt out each operation that agents must not use. x-google-mcp-tool: false hides a route from MCP only; keep REST security on admin routes.OpenAPI 2.0 to 3.x Migration
Connect Google ADK (McpToolset) and discover in API hub / Agent RegistryMcpToolset (StreamableHTTPConnectionParams) + API hub project attachmentNo separate registration step is needed. After you attach the API Gateway project to API hub, the MCP server appears in API hub as {your_api} (MCP) and in Agent Registry automatically.ADK and API Hub Discovery
Verify /mcp JSON-RPC lifecycle and troubleshoot -32601 / -32602 / -32000 errorsPOST https://{default_hostname}/mcp with MCP-Protocol-Version: 2025-11-25Keep /mcp at the host root: a servers base path (such as /v2) applies to REST paths only, and {basepath}/mcp returns HTTP 404. Nest JSON request bodies under params.arguments.body ({"body": {...}}). NEVER combine x-google-api-management.mcp with x-google-model-router in one config. Rationale: API Gateway does not allow MCP and model routing in the same API config.MCP Verification and Troubleshooting

Execution Workflow and Validation Loop

  1. Upgrade and annotate the OpenAPI 3.x specification:

    • The references in this skill contain the conversion rules: the Swagger 2.0 Construct Conversion Map covers each Swagger 2.0 construct, and the Complete Converted Example shows a finished spec with a Google ID token scheme. Use them before you search other sources.

    • Follow OpenAPI 2.0 to 3.x Migration and OpenAPI Agent Tool Optimizer to set openapi to a 3.0.x or 3.1.x version (the examples use 3.0.4), remove unsupported OpenAPI 2.0 fields (x-google-allow), define x-google-api-management.backends (with jwtAudience or disableAuth), configure x-google-api-management.mcp.tools-list.security with exactly one JWT or API key scheme (add a JWT scheme to the root security list too, in the same requirement object as any API key scheme), author x-google-mcp-tool descriptions stating when and why to invoke each tool, and opt out administrative routes (x-google-mcp-tool: false).

    • Before you deploy, give the user a short summary that states each of these points, and get approval:

      • MCP is not supported for OpenAPI 2.0, so you converted the spec to OpenAPI 3.x.

      • Which operations you exposed as tools, and which you opted out with x-google-mcp-tool: false. Opted-out operations stay on REST.

      • If tools/list uses a JWT scheme, the root security entry makes every REST operation without its own security require the JWT. The gateway rejects REST callers without it.

      • The MCP endpoint is https://{default_hostname}/mcp, at the host root even when the spec sets a servers base path.

      • The limits that apply: only GET, POST, PUT, PATCH, and DELETE operations can be tools, a gateway serves at most 1,000 tools, request parameters must be primitive types, API Gateway rejects complex nested schemas and OpenAPI 3.1 type lists (such as type: ["string", "null"]) when you create the API config, tools cannot return HTTP 204, and MCP is stateless with UTF-8 text responses only.

    • Give the same points when the user only asks for the converted spec or for advice, without a deploy.

    • Preserve exact quota metric names in x-google-api-management.metrics across API configs so existing gateways do not fail with HTTP 500 Failed to call Service Control Quota.

  2. Run the deterministic MCP OpenAPI validation loop before creating the API config:

    • Execute scripts/validate_mcp_openapi.py on {candidate_openapi_spec}:

      python3 scripts/validate_mcp_openapi.py --spec={candidate_openapi_spec}
    • If scripts/validate_mcp_openapi.py exits with code 1 (status: "FAIL"), fix every reported error in {candidate_openapi_spec} (such as OpenAPI 2.0 syntax, x-google-allow, path-level x-google-mcp-tool, undefined backend names, an operation without an operationId, missing descriptions, invalid or duplicate tool names, a header parameter with the reserved x-google- prefix, a tools-list.security scheme that is neither an oauth2 JWT nor an apiKey scheme, a JWT tools-list.security scheme missing from the root security list, alternative (OR) security requirements with an API key, or an x-google-model-router operation in an MCP spec) and re-run the script until it exits with code 0 (status: "PASS"). If it exits with code 2, fix the file path or YAML syntax error printed to stderr.

    • Read every warning (such as an HTTP 204 response, a request parameter that is not a primitive type, or operations that an mcp object exposes by default). Fix it, or tell the user why you keep it.

  3. Create the API (if new), create the API config, deploy the gateway, and enable the managed service (request human approval before updating a production gateway):

    gcloud api-gateway apis create {api_id} --project={project_id}
    
    gcloud api-gateway api-configs create {config_id} \
      --api={api_id} \
      --openapi-spec={candidate_openapi_spec} \
      --backend-auth-service-account={gateway_sa_name}@{project_id}.iam.gserviceaccount.com \
      --project={project_id}
    
    gcloud api-gateway gateways update {gateway_id} \
      --api={api_id} \
      --api-config={config_id} \
      --location={region} \
      --project={project_id}
    
    gcloud services enable $(gcloud api-gateway apis describe {api_id} --project={project_id} --format="value(managedService)") --project={project_id}

    (For a brand-new gateway, run gcloud api-gateway gateways create {gateway_id} ... instead of gateways update).

    • Run one api-configs create at a time per API. Wait for it to finish before you start the next one, because API Gateway creates only one config for an API at a time. A complex API config can take up to ten minutes to create.

    • If clients use API keys from other projects, enable the managed service in each of those projects too. API Gateway rejects an API key unless the API is enabled in the project that created the key.

  4. Verify the JSON-RPC 2.0 lifecycle and connect ADK / API hub:

    • Send every probe to https://{default_hostname}/mcp, even when the spec sets a servers base path.

    • An HTML 404 Page not found means that the gateway may not be deployed correctly. Check that the gateway state is ACTIVE and that the last create or update finished, and retry before you change the config. During a gateway update, some requests can still reach the previous API config. A JSON 404 (The current request is not defined by this API.) means that the active config does not define the path.

    • If tools/list requires a JWT, mint a Google ID token whose audience is in x-google-auth.audiences: gcloud auth print-identity-token --impersonate-service-account={caller_sa_email} --audiences={jwt_audience}. If tools/list requires an API key, send it in the x-api-key header.

    • Run the initialize, notifications/initialized, tools/list, and tools/call verification probes in MCP Verification and Troubleshooting.

    • Connect Google ADK (McpToolset) and verify automatic catalog discovery in Apigee API hub ({your_api} (MCP)) and Agent Registry using ADK and API Hub Discovery.

Pre-Deployment Checklist

  • [ ] Specification version is openapi: 3.0.x or 3.1.x (not swagger: "2.0"), omits x-google-allow, and does not contain x-google-model-router.

  • [ ] python3 scripts/validate_mcp_openapi.py --spec={candidate_openapi_spec} returns status: "PASS" (exit code 0).

  • [ ] Every operation has an operationId, and all MCP operations are in one OpenAPI document.

  • [ ] x-google-api-management.mcp.tools-list.security names exactly one scheme: an oauth2 JWT scheme with x-google-auth that the root security list also references, or an apiKey scheme with in: header and name: x-api-key.

  • [ ] If tools/list uses a JWT scheme, the user knows that REST operations without their own security now require that JWT.

  • [ ] Administrative, health-check, and HTTP 204 endpoints are opted out with x-google-mcp-tool: false, and opted-out admin paths remain protected on REST.

  • [ ] MCP clients call https://{default_hostname}/mcp (not {basepath}/mcp), nest tools/call JSON request bodies inside params.arguments.body, and send MCP-Protocol-Version: 2025-11-25.

Resource Cleanup

To avoid ongoing charges when tearing down a test or staging environment, request human approval and delete the gateway, API config, API, and service account in dependency order:

gcloud api-gateway gateways delete {gateway_id} --location={region} --project={project_id}
gcloud api-gateway api-configs delete {config_id} --api={api_id} --project={project_id}
gcloud api-gateway apis delete {api_id} --project={project_id}
gcloud iam service-accounts delete {gateway_sa_name}@{project_id}.iam.gserviceaccount.com --project={project_id}

Files

references/mcp-limitations-and-troubleshooting.md

MCP Verification, Limitations, and Troubleshooting Reference

  • MCP Endpoint Verification with curl (JSON-RPC 2.0 Lifecycle): Lines 7-93

  • JSON-RPC and HTTP Error Diagnosis on /mcp: Lines 95-135

  • Mutual Exclusion with Model Routing and Preview Limits: Lines 137-152

MCP Endpoint Verification with curl (JSON-RPC 2.0 Lifecycle)

API Gateway exposes MCP over stateless HTTP POST at https://{default_hostname}/mcp. The /mcp path stays at the host root: a servers base path set with x-google-endpoint (such as /v2) applies to REST paths only, and https://{default_hostname}/{basepath}/mcp returns HTTP 404. Send the MCP-Protocol-Version: 2025-11-25 header on every request after initialize (if omitted, the gateway falls back to 2025-03-26).

1. Handshake (initialize)

initialize requires no authentication:

curl -sS -X POST "https://{default_hostname}/mcp" \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "initialize",
    "params": {
      "protocolVersion": "2025-11-25",
      "capabilities": {},
      "clientInfo": {"name": "verify-client", "version": "1.0.0"}
    }
  }'
2. Acknowledge Handshake (notifications/initialized)

The gateway responds with HTTP 202 Accepted. Include the MCP-Protocol-Version: 2025-11-25 header on notifications/initialized and on all later requests (tools/list, tools/call). If the header is omitted, API Gateway falls back to protocol version 2025-03-26:

curl -i -sS -X POST "https://{default_hostname}/mcp" \
  -H "Content-Type: application/json" \
  -H "MCP-Protocol-Version: 2025-11-25" \
  -d '{"jsonrpc": "2.0", "method": "notifications/initialized"}'
3. Discover Tools (tools/list)

Include Authorization: Bearer <token> when x-google-api-management.mcp.tools-list.security names a JWT scheme, or x-api-key: {api_key} when it names an API key scheme (tools/list does not read API keys from query parameters).

For a test token, mint a Google ID token for a caller service account (you need roles/iam.serviceAccountTokenCreator on {caller_sa_email}). The token audience must be in the x-google-auth.audiences list of the JWT scheme in the API config's OpenAPI spec. If you do not have the spec file, print the spec of the config that the gateway serves:

config_id="$(gcloud api-gateway gateways describe {gateway_id} \
  --location={region} --project={project_id} \
  --format="value(apiConfig.basename())")"

gcloud api-gateway api-configs describe "${config_id}" \
  --api={api_id} --project={project_id} --view=FULL \
  --format="value(openapiDocuments[0].document.contents)" \
  | tr '_-' '/+' | base64 --decode

Then mint the token and list the tools:

jwt_token="$(gcloud auth print-identity-token \
  --impersonate-service-account={caller_sa_email} \
  --audiences={jwt_audience})"

curl -sS -X POST "https://{default_hostname}/mcp" \
  -H "Content-Type: application/json" \
  -H "MCP-Protocol-Version: 2025-11-25" \
  -H "Authorization: Bearer ${jwt_token}" \
  -d '{"jsonrpc": "2.0", "id": 2, "method": "tools/list"}'
4. Invoke a Tool (tools/call)

Include the credentials required by the underlying REST operation (x-api-key and/or Authorization: Bearer <token>), and nest any JSON request body inside arguments.body:

curl -sS -X POST "https://{default_hostname}/mcp" \
  -H "Content-Type: application/json" \
  -H "MCP-Protocol-Version: 2025-11-25" \
  -H "x-api-key: {api_key}" \
  -H "Authorization: Bearer ${jwt_token}" \
  -d '{
    "jsonrpc": "2.0",
    "id": 3,
    "method": "tools/call",
    "params": {
      "name": "get_order_status",
      "arguments": {"orderId": "ORD-10042"}
    }
  }'

Reference: Configure Model Context Protocol - Verify MCP support

JSON-RPC and HTTP Error Diagnosis on /mcp

Most MCP errors return HTTP 200 with a JSON-RPC error object, because many MCP clients fail at the HTTP transport layer on a non-200 response. The exceptions are 400, 401, 403, 404, 405, and 413. Check both the HTTP status and the JSON-RPC error field, then find the symptom in the tables below.

Connection and routing
What you seeCauseFix
HTTP 404 with an HTML Page not found pageThe gateway may not be deployed correctly, or a gateway create or update has not finished.Check that the gateway state is ACTIVE (gcloud api-gateway gateways describe {gateway_id} --location={region}) and that the last operation finished. During an update, some requests can still reach the previous API config, so retry for a few minutes before you change the config.
HTTP 404 with the JSON message The current request is not defined by this API.The request went to {basepath}/mcp, or the active API config does not enable MCP.Send requests to https://{default_hostname}/mcp at the host root, and check that the deployed spec has x-google-api-management.mcp.
HTTP 405 Method Not AllowedThe client sent GET or OPTIONS to /mcp.Send HTTP POST only. The gateway has no SSE GET stream and does not handle CORS preflight (OPTIONS) on /mcp.
HTTP 413 (transport body too large)The raw HTTP request body is larger than the gateway transport limit.Send a smaller request.
Authentication
What you seeCauseFix
HTTP 401 or 403, JSON-RPC -32000 Tool list response is invalid or has error status code. (JWT scheme on tools/list)401: the JWT is missing or malformed. 403: the JWT has a wrong audience. The message does not name the cause. Today every failed tools/list request returns this code and message. Both can change, so check the HTTP status first.Send Authorization: Bearer <token> with an audience from x-google-auth.audiences. The WWW-Authenticate header points at the protected resource metadata.
HTTP 401 or 200, JSON-RPC -32000 Tool list response is invalid or has error status code. (API key scheme on tools/list)401: the API key is missing, or the client sent it only as a query parameter. 200: the API key is not valid. The code, the message, and the HTTP 200 are today's behavior and can change.Send a valid key in the x-api-key header. Because an invalid key returns HTTP 200, check the JSON-RPC error field as well as the HTTP status.
Protocol
What you seeCauseFix
HTTP 400, JSON-RPC -32700 (parse error)The request body is not valid JSON.Send valid JSON.
HTTP 200, JSON-RPC -32600 (invalid request)The body is valid JSON but not a valid JSON-RPC request.Set the required fields jsonrpc, method, and id.
HTTP 200, JSON-RPC -32601 Method ... is not supportedThe client called a method that the gateway does not support, such as resources/*, prompts/*, sampling/*, completion/*, or logging/*.Use only initialize, notifications/initialized, ping, tools/list, and tools/call.
HTTP 400, JSON-RPC -32602 Unsupported protocol versionA request after initialize sent an MCP-Protocol-Version header that the gateway does not support. initialize itself does not fail on an unknown protocolVersion: the gateway answers with 2025-11-25.Send MCP-Protocol-Version: 2025-11-25.
HTTP 200, JSON-RPC -32602 Missing valid protocolVersion in initialize requestThe initialize params omit protocolVersion, or its value is not a string.Send "protocolVersion": "2025-11-25" in the initialize params.
Tool calls
What you seeCauseFix
HTTP 200, JSON-RPC -32602 (unknown tool)params.name does not match an exposed tool in the active API config, or the operation is opted out with x-google-mcp-tool: false.Run tools/list again, and call a listed tool name.
HTTP 200, JSON-RPC -32602 (invalid tool arguments)params.arguments misses required parameters, or the JSON request body is not nested inside "body": { ... }.Pass path and query parameters as top-level arguments, and nest the request body under arguments.body.
HTTP 200, result.isError: trueThe backend returned a 4xx or 5xx error.Read result.content[0].text for the backend's error body, and fix the request or the backend.
HTTP 200, JSON-RPC -32000 (body too large)The backend response is larger than the size limit.Return a smaller response, for example with paging.
HTTP 200, JSON-RPC -32000 Server errorAn internal gateway error. It is not a backend error: backend errors return result.isError: true.Retry. If the error continues, contact Cloud Customer Care.

Reference: Configure Model Context Protocol - Troubleshooting MCP failures

Mutual Exclusion with Model Routing and Preview Limits

  • Model Routing mutual exclusion: NEVER set x-google-api-management.mcp and use x-google-model-router on an operation in the same OpenAPI specification. Model routers are defined in x-google-api-management.ai.models.routing. Rationale: API Gateway does not allow MCP and Model Routing in the same API config. If you need both an inbound /mcp server and an outbound LLM model router, deploy two separate API configs and gateways.

  • Stateless UTF-8 text only: Session headers (MCP-Session-Id), SSE streaming, binary/multi-modal responses (such as raw PDF or image downloads; return a UTF-8 JSON object with a signed URL or opt out binary endpoints with x-google-mcp-tool: false), and empty HTTP 204 responses are not supported in Public Preview.

  • Other Public Preview limits:

    • JSON-RPC batch arrays are rejected. Send one JSON-RPC request in each HTTP POST.

    • The stdio transport is not supported. Clients connect over HTTP POST only.

    • OpenAPI 2.0 is not supported. Use OpenAPI 3.0.x or 3.1.x.

    • A gateway serves at most 1,000 MCP tools.

    • Tool declarations do not include annotations such as destructiveHint or readOnlyHint.

    • API Gateway rejects complex nested schemas when you create the API config. A simple nested object body works.

    • In OpenAPI 3.1, each schema needs one type. A type list such as type: ["string", "null"] fails config creation with Schema has multiple types defined. More than one type is not supported, please define only one type.

References:

Requirements and compatibility

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Needs: Needs an MCP server, Needs an API key, Needs a command-line tool, Needs Python

Security

What our scanner noticed· Low risk

  • Instructions that use the network
  • Scripts that your agent may run

This skill includes scripts that your agent may run. Read them before you use it.

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Published by
Google
Publisher
Google (Official)
Source
google/skills · skills/cloud/api-gateway-mcp-server · commit 2194d3b
Licence
Apache License 2.0 (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by Google.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download api-gateway-mcp-server.zip